mirror of
https://github.com/ProgramSnail/rts_game_backend.git
synced 2026-01-25 12:57:08 +00:00
added factory, unit maiden easier
This commit is contained in:
parent
52024e4b06
commit
1c87c30dda
13 changed files with 230 additions and 69 deletions
|
|
@ -10,15 +10,29 @@ namespace map {
|
|||
private:
|
||||
using Coord = std::pair<int32_t, int32_t>;
|
||||
Coord pos;
|
||||
Coord size;
|
||||
CellType cellType;
|
||||
public:
|
||||
UnitObj() {}
|
||||
UnitObj(const Coord& pos, const Coord& size,
|
||||
const CellType& cellType, map::GameMap* map) :
|
||||
pos(pos), size(size), cellType(cellType) {}
|
||||
void updateAll() {
|
||||
Coord size;
|
||||
GameMap* gameMap;
|
||||
Cell cellPrototype;
|
||||
|
||||
|
||||
Coord getEndPos() {
|
||||
return {pos.first + size.first,
|
||||
pos.second + size.second};
|
||||
}
|
||||
public:
|
||||
UnitObj() = default;
|
||||
UnitObj(const Coord& pos, const Coord& size,
|
||||
const CellType& cellType,
|
||||
const CellPlayer& cellPlayer, GameMap* gameMap) :
|
||||
pos(pos), size(size), gameMap(gameMap),
|
||||
cellPrototype(cellType, cellPlayer) {}
|
||||
|
||||
void resize(Coord newSize);
|
||||
|
||||
void move(Coord newPos);
|
||||
|
||||
void setPlayer(int player);
|
||||
|
||||
void setCellType(int cellType);
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue