#ifndef TILES_H #define TILES_H #include "pixelGameEngine.h" #include "map.h" using namespace olc; extern std::map SPRITES; class TILE{ public: int tileX; int tileY; char tileDegree=0; //-1 is slanted from bottom-left to top-right. 1 is slanted from top-left to bottom-right. TILE(int tileX,int tileY,char tileDegree) :tileX(tileX),tileY(tileY),tileDegree(tileDegree){} static char GetTileDegree(Map*map,int tileX,int tileY) { if (map->tileset==SPRITES["terrainmap.png"]) { if (tileX==12&&tileY==0|| tileX==12&&tileY==1) { return -1; } if (tileX==14&&tileY==0|| tileX==14&&tileY==1) { return 1; } } return 0; } bool operator==(const TILE* rhs) { return tileX==rhs->tileX&& tileY==rhs->tileY&& tileDegree==rhs->tileDegree; } bool operator!=(const TILE*t) { return !(*this==t); } }; #endif