From c346a493d8cc672b7e4320cdc19a647860b7d2e6 Mon Sep 17 00:00:00 2001 From: Artem Andryukhov Date: Wed, 16 May 2018 18:11:16 +0300 Subject: [PATCH] renamed validators --- session_data.cpp | 6 +++--- session_data.h | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/session_data.cpp b/session_data.cpp index 48e5468..98ca0a5 100644 --- a/session_data.cpp +++ b/session_data.cpp @@ -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; diff --git a/session_data.h b/session_data.h index ac7e951..85c3860 100644 --- a/session_data.h +++ b/session_data.h @@ -5,7 +5,6 @@ #include #include "units.h" -#include "things.h" #include "event_factory.h" #include "artifact.h" // #include "artifact_factory.h" @@ -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 currentSurfaceList; // currently useless + short** surfaceMatrix; + // std::unordered_map currentSurfaceList; // currently useless // std::unordered_map globalSurfaceList; //will be added in future };