Skip to content

Commit

Permalink
Merge pull request #10 from labermt/master
Browse files Browse the repository at this point in the history
Herd returned from getFeature.
  • Loading branch information
TheJonBovi authored Mar 2, 2018
2 parents b87729f + 6a9aded commit 6c4c713
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion CST126SRS03/CST126SRS03.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<ProjectGuid>{C440EE3F-D582-4410-8662-500FC38565B5}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>CST126SRS03</RootNamespace>
<WindowsTargetPlatformVersion>10.0.16299.0</WindowsTargetPlatformVersion>
<WindowsTargetPlatformVersion>10.0.15063.0</WindowsTargetPlatformVersion>
<ProjectName>Elephant</ProjectName>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
Expand Down
8 changes: 8 additions & 0 deletions CST126SRS03/preserve.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,18 @@ Preserve::Preserve():

Preserve::Feature Preserve::getFeature(const int lat, const int lng) const
{
auto herdLat{ herd_.getlat() };
auto herdLng{ herd_.getlng() };

auto result = Feature::kRock;

if (lat >= 0 && lat < latExtent && lng >= 0 && lng < lngExtent)
{
result = feature_[lat][lng];
if (lat == herdLat && lng == herdLng)
{
result = Feature::kHerd;
}
}

return result;
Expand Down

0 comments on commit 6c4c713

Please sign in to comment.