Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Final Submit #5

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions CST136SRS02/CST136SRS02.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.27428.2027
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Waka", "Waka\Waka.vcxproj", "{F13CAD80-3D59-489E-A3CF-54BB92252DC3}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{EE4D6162-00F3-4DE0-B30B-32BA8E95D1D9}"
ProjectSection(SolutionItems) = preProject
..\README.md = ..\README.md
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{F13CAD80-3D59-489E-A3CF-54BB92252DC3}.Debug|x64.ActiveCfg = Debug|x64
{F13CAD80-3D59-489E-A3CF-54BB92252DC3}.Debug|x64.Build.0 = Debug|x64
{F13CAD80-3D59-489E-A3CF-54BB92252DC3}.Debug|x86.ActiveCfg = Debug|Win32
{F13CAD80-3D59-489E-A3CF-54BB92252DC3}.Debug|x86.Build.0 = Debug|Win32
{F13CAD80-3D59-489E-A3CF-54BB92252DC3}.Release|x64.ActiveCfg = Release|x64
{F13CAD80-3D59-489E-A3CF-54BB92252DC3}.Release|x64.Build.0 = Release|x64
{F13CAD80-3D59-489E-A3CF-54BB92252DC3}.Release|x86.ActiveCfg = Release|Win32
{F13CAD80-3D59-489E-A3CF-54BB92252DC3}.Release|x86.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {DC8E5A85-F4C5-48BE-874A-05B1ED095373}
EndGlobalSection
EndGlobal
Binary file added CST136SRS02/CST136SRS02/CST136SRS02.cpp
Binary file not shown.
165 changes: 165 additions & 0 deletions CST136SRS02/CST136SRS02/CST136SRS02.vcxproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,165 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>15.0</VCProjectVersion>
<ProjectGuid>{14A19570-9C83-4B28-A905-D2CBB5B37D86}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>CST136SRS02</RootNamespace>
<WindowsTargetPlatformVersion>10.0.16299.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PrecompiledHeader>Use</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<PrecompiledHeader>Use</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<PrecompiledHeader>Use</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<PrecompiledHeader>Use</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClInclude Include="stdafx.h" />
<ClInclude Include="targetver.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="CST136SRS02.cpp" />
<ClCompile Include="stdafx.cpp">
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader>
</ClCompile>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
33 changes: 33 additions & 0 deletions CST136SRS02/CST136SRS02/CST136SRS02.vcxproj.filters
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hh;hpp;hxx;hm;inl;inc;ipp;xsd</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClInclude Include="stdafx.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="targetver.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="stdafx.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="CST136SRS02.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
</Project>
Binary file added CST136SRS02/CST136SRS02/stdafx.cpp
Binary file not shown.
Binary file added CST136SRS02/CST136SRS02/stdafx.h
Binary file not shown.
Binary file added CST136SRS02/CST136SRS02/targetver.h
Binary file not shown.
47 changes: 47 additions & 0 deletions CST136SRS02/Waka/Boat.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
#include "stdafx.h"
#include "Boat.h"


Boat::Boat(const std::string boatName, Propulsion* propType)
:name(boatName), myProp(propType)
{
}

std::string Boat::getName()
{
return name;
}

void Boat::setHull(Hull* hullType)
{
myHull = hullType;
}

void Boat::setWindSpeed(int const windSpeed)
{
windConditions.setWindSpeed(windSpeed);
}

void Boat::setWaterCurrentSpeed(int const waterSpeed)
{
waterConditions.setWaterSpeed(waterSpeed);
}

void Boat::bringChart()
{
myChart.equipChart();
}


int Boat::getCurrentBoatSpeed() const
{
auto const windSpeedRatio{ 3 }; // according to wiki winds can drive the sail boats 3.35 times the speed of the wind

auto const adjustForWinds{ windConditions.returnWindSpeed() * windSpeedRatio }; // treating wind direction as a constant tailwind

auto const waterCurrentSpeed{ waterConditions.returnWaterSpeed() };

auto const currentBoatSpeed{ ( myProp->currentKnots() + adjustForWinds ) - waterCurrentSpeed }; // add initial boat speed to added wind speed and subtract the water current speed

return currentBoatSpeed;
}
39 changes: 39 additions & 0 deletions CST136SRS02/Waka/Boat.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#pragma once
#include <string>
#include "Propulsion.h"
#include "Hull.h"
#include "Wind.h"
#include "Water.h"
#include "Chart.h"


class Boat
{
protected:
virtual ~Boat() = default;

public:
Boat() = default;
Boat(std::string boatName, Propulsion* propType);

virtual std::string getName() = 0;
virtual void setHull(Hull* hullType) = 0;

void setWindSpeed(int const windSpeed);
void setWaterCurrentSpeed(int const waterSpeed);
void bringChart();
int getCurrentBoatSpeed() const;

private:
std::string name{};

Propulsion* myProp{ nullptr };
Hull* myHull{ nullptr };

Wind windConditions;
Water waterConditions;

Chart myChart;

};

20 changes: 20 additions & 0 deletions CST136SRS02/Waka/Canoe.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#include "stdafx.h"
#include "Canoe.h"
#include "Paddle.h"


Canoe::Canoe(const std::string boatName)
: Boat(boatName, new Paddle())
{
}

std::string Canoe::getName()
{
return Boat::getName();
}

void Canoe::setHull(Hull* hullType)
{
Boat::setHull(hullType);
}

14 changes: 14 additions & 0 deletions CST136SRS02/Waka/Canoe.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#pragma once
#include "Boat.h"

class Canoe final : public Boat
{
public:
Canoe() = default;
Canoe(const std::string boatName);

std::string getName() override;
void setHull(Hull* hullType) override;

};

8 changes: 8 additions & 0 deletions CST136SRS02/Waka/Chart.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#include "stdafx.h"
#include "Chart.h"


void Chart::equipChart()
{
haveChart = true;
}
13 changes: 13 additions & 0 deletions CST136SRS02/Waka/Chart.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#pragma once

class Chart
{
public:
Chart() = default;

void equipChart();

private:
bool haveChart{};
};

Loading