forked from Yao-class-cpp-studio/battle_game_2024
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplayer.h
39 lines (36 loc) · 863 Bytes
/
player.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#pragma once
#include "cstdint"
#include "input_data.h"
namespace battle_game {
class GameCore;
class Player {
public:
Player(GameCore *game_core, uint32_t id);
[[nodiscard]] uint32_t GetId() const {
return id_;
}
void SetInputData(const InputData &input_data) {
input_data_ = input_data;
}
[[nodiscard]] const InputData &GetInputData() const {
return input_data_;
}
[[nodiscard]] uint32_t GetPrimaryUnitId() const {
return primary_unit_id_;
}
int &SelectedUnit() {
return selected_unit_;
}
void Update();
[[nodiscard]] uint32_t GetResurrectionCountDown() const {
return resurrection_count_down_;
}
private:
GameCore *game_core_{};
uint32_t id_{};
InputData input_data_{};
uint32_t primary_unit_id_{};
uint32_t resurrection_count_down_{1};
int selected_unit_{0};
};
} // namespace battle_game