62 const bool newHarvestable;
65 const bool newWalkable;
68 const float newWalkModifier;
74 const int newResources;
77 const std::string newName;
85 const bool depletedHarvestable;
88 const bool depletedWalkable;
91 const float depletedWalkModifier;
94 const int depletedTypeId;
97 const int depletedResources;
100 const std::string depletedName;
161 const std::string& newName,
165 float newWalkModifier,
167 const std::string& depletedName,
169 bool depletedHarvestable,
170 bool depletedWalkable,
171 float depletedWalkmMdifier,
172 int depletedResources,
242 [[nodiscard]]
const std::string &
getName()
const;
const int height
The height of the tile (usually 1)
Definition: Tile.h:121
Tile(Tilemap &tilemap, int id, int x, int y, int w, int h, const std::string &newName, int newTypeId, bool newHarvestable, bool newWalkable, float newWalkModifier, int newResources, const std::string &depletedName, int depletedTypeId, bool depletedHarvestable, bool depletedWalkable, float depletedWalkmMdifier, int depletedResources, float lumberYield, float goldYield, float stoneYield)
Definition: Tile.cpp:8
int getTypeId() const
Definition: Tile.cpp:230
Position getPosition() const
Definition: Tile.cpp:222
float getWalkModifier() const
Definition: Tile.cpp:246
const int id
The TileID.
Definition: Tile.h:109
bool isWalkable() const
Definition: Tile.cpp:131
void setOccupant(Unit *unit)
Definition: Tile.cpp:139
bool isDepleted() const
Definition: Tile.cpp:226
void setResources(uint16_t resource_count)
Definition: Tile.cpp:213
bool isBuildable() const
Definition: Tile.cpp:161
void setDepleted()
Sets the tile to deplted.
Definition: Tile.cpp:193
const int y
THe y position of the tile.
Definition: Tile.h:115
Unit * getOccupant()
Definition: Tile.cpp:107
void triggerOnTileChange()
Definition: Tile.cpp:209
Tilemap & getTilemap() const
Definition: Tile.cpp:234
const int x
The x position of the tile.
Definition: Tile.h:112
bool hasOccupant() const
Definition: Tile.cpp:101
bool isHarvestable() const
Definition: Tile.cpp:135
const float goldYield
The number of hgold the tile yields on harvesting.
Definition: Tile.h:127
const int width
The width of the tile (usually 1)
Definition: Tile.h:118
void takeResource(uint8_t n)
Definition: Tile.cpp:218
void reset()
Reset tile.
Definition: Tile.cpp:170
const float stoneYield
The number of stone the tile yields on harvesting.
Definition: Tile.h:130
int getDepleteTile() const
Definition: Tile.cpp:242
int distance(Tile &sourceTile) const
Definition: Tile.cpp:166
int getOccupantID() const
Definition: Tile.cpp:155
int getResources() const
Definition: Tile.cpp:117
bool isAttackable(Unit &unit)
Definition: Tile.cpp:122
const float lumberYield
The number of lumber the tile yields on harvesting.
Definition: Tile.h:124
const std::string & getName() const
Definition: Tile.cpp:238
void setOccupantID(int unitID)
Definition: Tile.cpp:149