Skip to content

Commit

Permalink
renamed validators
Browse files Browse the repository at this point in the history
  • Loading branch information
eadium committed May 16, 2018
1 parent 615791c commit c346a49
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions session_data.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,19 +39,19 @@ short SurfaceData::getSurface(coord& point) {
return surfaceMatrix[point.x][point.y];
}

bool SurfaceData::IsValidCoord(coord& point) {
bool SurfaceData::CoordIsValid(coord& point) {
if ((point.x < 0 || point.x > mapWidth) || (point.y < 0 || point.y > mapHeight))
return false;
return true;
}

bool SurfaceData::IsValidRadius(coord& point, short radius) {
bool SurfaceData::RadiusIsValid(coord& point, short radius) {
if (
(point.x - radius <= 0) ||
(point.x + radius >= mapWidth) ||
(point.y + radius >= mapHeight) ||
(point.y - radius <= 0) ||
(!IsValidCoord(point))
(!CoordIsValid(point))
) return false;

bool flag = false;
Expand Down
8 changes: 4 additions & 4 deletions session_data.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#include <unordered_map>

#include "units.h"
#include "things.h"
#include "event_factory.h"
#include "artifact.h"
// #include "artifact_factory.h"
Expand All @@ -29,14 +28,15 @@ class SurfaceData {
bool Init();
int getWidth();
int getHeight();
bool IsValidRadius(coord&, short);
bool IsValidCoord(coord&);
bool RadiusIsValid(coord&, short);
bool IsWalkable(coord&);
short getSurface(coord&);
Surface& getSurface(str);
private:
bool CoordIsValid(coord&);
int mapWidth, mapHeight;
short** surfaceMatrix; // std::unordered_map<str, Surface> currentSurfaceList; // currently useless
short** surfaceMatrix;
// std::unordered_map<str, Surface> currentSurfaceList; // currently useless
// std::unordered_map<str, Surface> globalSurfaceList; //will be added in future
};

Expand Down

0 comments on commit c346a49

Please sign in to comment.