27 std::deque<std::pair<Constants::Action, int>> actionQueue;
154 std::shared_ptr<BaseState>
state =
nullptr;
161 bool build(
int idx,
bool ignoreCost);
203 void tryMove(int16_t x, int16_t y);
Definition: BaseState.h:14
Definition: StateManager.h:15
std::string name
Definition: Unit.h:99
StateManager * stateManager
Definition: Unit.h:153
int foodConsumption
Definition: Unit.h:94
bool military
Definition: Unit.h:85
int combatTargetID
Definition: Unit.h:135
int damageMin
Definition: Unit.h:68
Unit & getBuildEntity() const
Definition: Unit.cpp:537
Tile * getNextTile()
Definition: Unit.cpp:388
float lumberCarry
Definition: Unit.h:74
int harvestTimer
Definition: Unit.h:122
bool build(int idx)
Definition: Unit.cpp:118
int height
Definition: Unit.h:97
int distance(Tile &tile) const
Definition: Unit.cpp:317
bool canAttack
Definition: Unit.h:83
bool canMove
Definition: Unit.h:84
int spawnTimer
Definition: Unit.h:129
Tile * tile
Definition: Unit.h:152
int stoneCost
Definition: Unit.h:91
Unit * getCombatTarget() const
Definition: Unit.cpp:542
Position worldPosition
Definition: Unit.h:190
int buildEntityID
Definition: Unit.h:130
bool structure
Definition: Unit.h:86
int animationCounter
Definition: Unit.h:149
Tile * centerTile() const
Definition: Unit.cpp:106
Game * game
Definition: Unit.h:31
int damageRange
Definition: Unit.h:70
Player & player_
Definition: Unit.h:102
int health_max
Unit Max Health.
Definition: Unit.h:58
double walking_interval
Definition: Unit.h:146
int harvestTargetID
Definition: Unit.h:124
int armor
Definition: Unit.h:72
void attack(Tile &tile)
Definition: Unit.cpp:250
void rightClick(Tile &tile)
Definition: Unit.cpp:224
void transitionState()
Definition: Unit.cpp:283
bool isDead()
Definition: Unit.cpp:369
double harvestInterval
Definition: Unit.h:121
int builtByID
Definition: Unit.h:110
void setPosition(Tile &tile)
Definition: Unit.cpp:75
float goldCarry
Definition: Unit.h:75
void rightClickRelative(int x, int y)
Definition: Unit.cpp:49
void enqueueState(const std::shared_ptr< BaseState > &state)
Definition: Unit.cpp:279
int stepsLeft
Definition: Unit.h:145
Constants::Unit typeId
Unit Type.
Definition: Unit.h:52
void update()
Definition: Unit.cpp:102
bool position_in_bounds(int x, int y) const
Definition: Unit.cpp:573
int id
Unit ID.
Definition: Unit.h:46
Position distanceVector(Tile &target) const
Definition: Unit.cpp:337
int spawnTileID
Definition: Unit.h:109
int goldCost
Definition: Unit.h:90
const Config & config
Definition: Unit.h:33
double combatTimer
Definition: Unit.h:138
void despawn()
Definition: Unit.cpp:203
float stoneCarry
Definition: Unit.h:76
int walkingGoalID
Definition: Unit.h:144
int waterUnit
Definition: Unit.h:66
int getDamage(Unit &target) const
Definition: Unit.cpp:373
int groundUnit
Definition: Unit.h:64
void harvest(Tile &tile)
Definition: Unit.cpp:270
void setDirection(int newX, int newY)
Definition: Unit.cpp:395
bool recallable
Definition: Unit.h:87
Unit & getBuiltBy() const
Definition: Unit.cpp:532
int width
Definition: Unit.h:96
void moveRelative(int x, int y)
Definition: Unit.cpp:38
Unit(Player &player)
Constructor.
Definition: Unit.cpp:13
int walking_timer
Definition: Unit.h:142
Unit * closestRecallBuilding() const
Definition: Unit.cpp:344
void clearStateForTile(Tile *t)
Definition: Unit.cpp:582
int health
Unit Current Health.
Definition: Unit.h:55
void move(Tile &targetTile)
Definition: Unit.cpp:59
double combatInterval
Definition: Unit.h:137
std::vector< Tile * > walking_path
Definition: Unit.h:143
std::vector< Constants::State > stateList
Definition: Unit.h:156
std::set< int > getVisionTileIDs() const
Definition: Unit.cpp:550
int lumberCost
Definition: Unit.h:89
int damageMax
Definition: Unit.h:69
void tryAttack()
Definition: Unit.cpp:447
int spawnDuration
Definition: Unit.h:108
Tile * getTile(int tileID) const
Definition: Unit.cpp:525
int speed
Definition: Unit.h:79
void tryMove(int16_t x, int16_t y)
Definition: Unit.cpp:465
std::shared_ptr< BaseState > state
Definition: Unit.h:154
void clearTiles()
Definition: Unit.cpp:216
Tile & getSpawnTile() const
Definition: Unit.cpp:520
std::string nameID
Unit Name ID (i.e Peasant1)
Definition: Unit.h:49
void afflictDamage(int dmg_)
Definition: Unit.cpp:359
int foodProduction
Definition: Unit.h:93
int sight
Definition: Unit.h:80
bool removedFromGame
Definition: Unit.h:199
int buildTimer
Definition: Unit.h:132
void tryHarvest()
Definition: Unit.cpp:502
int damagePiercing
Definition: Unit.h:71
Player & getPlayer()
Definition: Unit.cpp:578
std::vector< Constants::Unit > buildInventory
Definition: Unit.h:78
int harvestIterator
Definition: Unit.h:123
void spawn(Tile &x, int initValue)
Definition: Unit.cpp:29
int direction
Unit Direction.
Definition: Unit.h:61
float carryCapacity
Definition: Unit.h:77
bool operator==(int id) const
Definition: Unit.cpp:442
bool canHarvest
Definition: Unit.h:82
void setStateForTile(Tile *t)
State alterations.
Definition: Unit.cpp:593
Unit
Definition: Constants.h:20