mirror of
https://github.com/ProgramSnail/rts_game_backend.git
synced 2026-01-12 06:27:16 +00:00
some additional functions
This commit is contained in:
parent
8553878b4a
commit
5173f4f2a9
23 changed files with 214 additions and 24 deletions
|
|
@ -0,0 +1,9 @@
|
|||
#pragma ONCE
|
||||
|
||||
namespace map {
|
||||
class Action {
|
||||
private:
|
||||
public:
|
||||
void update();
|
||||
};
|
||||
}
|
||||
|
|
@ -0,0 +1 @@
|
|||
// include all actions from folder
|
||||
|
|
@ -0,0 +1 @@
|
|||
#include "cell.hpp"
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
#pragma ONCE
|
||||
|
||||
namespace map {
|
||||
enum CellType { // needed to choose final types
|
||||
ctNone,
|
||||
ctUnit,
|
||||
ctWeapon,
|
||||
ctForest,
|
||||
ctMoutain
|
||||
};
|
||||
|
||||
enum CellPlayer {
|
||||
cpNone,
|
||||
cpPlayer0,
|
||||
cpPlayer1,
|
||||
cpPlayer2,
|
||||
cpPlayer3
|
||||
};
|
||||
|
||||
struct Cell {
|
||||
CellType type;
|
||||
// int ??speed??; // speed when move inside
|
||||
};
|
||||
}
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
#include "unit_obj.hpp"
|
||||
|
||||
namespace map {
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
#include <utility>
|
||||
#include <cstdint>
|
||||
#include "cell.hpp"
|
||||
#include "../unit/unit.hpp"
|
||||
|
||||
#pragma ONCE
|
||||
|
||||
namespace map {
|
||||
class UnitObj {
|
||||
private:
|
||||
Unit* unit;
|
||||
std::pair<int32_t, int32_t> pos;
|
||||
std::pair<int32_t, int32_t> size;
|
||||
CellType cellType;
|
||||
public:
|
||||
UnitObj(Unit* unit) : unit(unit) {
|
||||
|
||||
}
|
||||
void updateValues() {
|
||||
// from unit size, pos
|
||||
}
|
||||
void updatePosition() {
|
||||
// from unit position
|
||||
}
|
||||
void updateAll() {
|
||||
|
||||
}
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue