![]() |
Deep RTS
|
#include <Tile.h>
Public Member Functions | |
| float | getWalkModifier () const |
| 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) | |
| Position | getPosition () const |
| bool | isAttackable (Unit &unit) |
| bool | isWalkable () const |
| bool | isHarvestable () const |
| bool | isBuildable () const |
| int | distance (Tile &sourceTile) const |
| Unit * | getOccupant () |
| int | getOccupantID () const |
| bool | hasOccupant () const |
| int | getResources () const |
| bool | isDepleted () const |
| int | getTypeId () const |
| Tilemap & | getTilemap () const |
| const std::string & | getName () const |
| int | getDepleteTile () const |
| void | triggerOnTileChange () |
| void | setOccupant (Unit *unit) |
| void | setOccupantID (int unitID) |
| void | setDepleted () |
| Sets the tile to deplted. More... | |
| void | setResources (uint16_t resource_count) |
| void | takeResource (uint8_t n) |
| void | reset () |
| Reset tile. More... | |
Public Attributes | |
| const int | id |
| The TileID. More... | |
| const int | x |
| The x position of the tile. More... | |
| const int | y |
| THe y position of the tile. More... | |
| const int | width |
| The width of the tile (usually 1) More... | |
| const int | height |
| The height of the tile (usually 1) More... | |
| const float | lumberYield |
| The number of lumber the tile yields on harvesting. More... | |
| const float | goldYield |
| The number of hgold the tile yields on harvesting. More... | |
| const float | stoneYield |
| The number of stone the tile yields on harvesting. More... | |
The tile class represent a single tile in the Tilemap A unit can occupy a tile Resources can occupy a tile A tile can be swimable, walkable, non-walkable and so on.
| Tile::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 | ||
| ) |
A horrible Tile constructor which requires all properties of a tile. Usually you dont want to touch this....
| tilemap | |
| id | |
| x | |
| y | |
| w | |
| h | |
| newName | |
| newTypeId | |
| newHarvestable | |
| newWalkable | |
| newWalkModifier | |
| newResources | |
| depletedName | |
| depletedTypeId | |
| depletedHarvestable | |
| depletedWalkable | |
| depletedWalkmMdifier | |
| depletedResources | |
| lumberYield | |
| goldYield | |
| stoneYield |
| int Tile::distance | ( | Tile & | sourceTile | ) | const |
Get distance between this tile and another tile
| sourceTile | the source tile |
| int Tile::getDepleteTile | ( | ) | const |
Get the tile ID when this tile is depleted.
| const std::string & Tile::getName | ( | ) | const |
Get the name of the tile
| int Tile::getOccupantID | ( | ) | const |
Get ID for a occupant on this tile
| Position Tile::getPosition | ( | ) | const |
Getters Retrieve the position of the tile
| int Tile::getResources | ( | ) | const |
Get resource count
| Tilemap & Tile::getTilemap | ( | ) | const |
Get the tilemap reference (tile's parent)
| int Tile::getTypeId | ( | ) | const |
Get the type if this tile
| float Tile::getWalkModifier | ( | ) | const |
Get the walk modifier of the specified tile
| bool Tile::hasOccupant | ( | ) | const |
Check if tile has a occupant
| bool Tile::isAttackable | ( | Unit & | unit | ) |
Check if there is a entity occupying the tile which is attackable
| unit | attacker unit reference |
| bool Tile::isBuildable | ( | ) | const |
Check if tile is Buildable
| bool Tile::isDepleted | ( | ) | const |
Check if the tile is depleted.
| bool Tile::isHarvestable | ( | ) | const |
Check if tile is Harvestable
| bool Tile::isWalkable | ( | ) | const |
Check if tile is Walkable
| void Tile::reset | ( | ) |
Reset tile.
Functions
| void Tile::setDepleted | ( | ) |
Sets the tile to deplted.
| void Tile::setOccupant | ( | Unit * | unit | ) |
Setters SEt the occupant using a Pointer to the unit.
| unit |
| void Tile::setOccupantID | ( | int | unitID | ) |
Set the occupant id of this tile
| unitID |
| void Tile::setResources | ( | uint16_t | resource_count | ) |
Set the resouce count of this tile
| resource_count |
| void Tile::takeResource | ( | uint8_t | n | ) |
Take a n count of resources from this tile.
| n |
| void Tile::triggerOnTileChange | ( | ) |
This function is used to trigger a callback which signifies that a tile has changed. Used to render graphics when required.
| const float Tile::goldYield |
The number of hgold the tile yields on harvesting.
| const int Tile::height |
The height of the tile (usually 1)
| const int Tile::id |
The TileID.
| const float Tile::lumberYield |
The number of lumber the tile yields on harvesting.
| const float Tile::stoneYield |
The number of stone the tile yields on harvesting.
| const int Tile::width |
The width of the tile (usually 1)
| const int Tile::x |
The x position of the tile.
| const int Tile::y |
THe y position of the tile.