mirror of
https://github.com/ProgramSnail/rts_game_backend.git
synced 2026-01-12 06:27:16 +00:00
develop classes
This commit is contained in:
parent
9be0f50790
commit
580ef8ac3c
15 changed files with 62 additions and 22 deletions
|
|
@ -1,4 +1,4 @@
|
|||
#pragma ONCE
|
||||
#pragma once
|
||||
|
||||
namespace map {
|
||||
class Action {
|
||||
|
|
|
|||
|
|
@ -1 +1,3 @@
|
|||
#pragma once
|
||||
|
||||
// include all actions from folder
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
#pragma ONCE
|
||||
#pragma once
|
||||
|
||||
namespace map {
|
||||
enum CellType { // needed to choose final types
|
||||
|
|
|
|||
|
|
@ -1,26 +1,20 @@
|
|||
#include <utility>
|
||||
#include <cstdint>
|
||||
#include "cell.hpp"
|
||||
#include "../unit/unit.hpp"
|
||||
|
||||
#pragma ONCE
|
||||
#pragma once
|
||||
|
||||
namespace map {
|
||||
class UnitObj {
|
||||
class UnitObj { // may be useless
|
||||
private:
|
||||
Unit* unit;
|
||||
std::pair<int32_t, int32_t> pos;
|
||||
std::pair<int32_t, int32_t> size;
|
||||
using Coord = std::pair<int32_t, int32_t>;
|
||||
Coord pos;
|
||||
Coord size;
|
||||
CellType cellType;
|
||||
public:
|
||||
UnitObj(Unit* unit) : unit(unit) {
|
||||
UnitObj(const Coord& pos, const Coord& size, const CellType& cellType) :
|
||||
pos(pos), size(size), cellType(cellType) {
|
||||
|
||||
}
|
||||
void updateValues() {
|
||||
// from unit size, pos
|
||||
}
|
||||
void updatePosition() {
|
||||
// from unit position
|
||||
}
|
||||
void updateAll() {
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue