-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathBattleResult.h
More file actions
68 lines (62 loc) · 2.09 KB
/
BattleResult.h
File metadata and controls
68 lines (62 loc) · 2.09 KB
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
//
// Created by Owner on 2024/04/13.
//
#ifndef NEWDIRECTORY_BATTLERESULT_H
#define NEWDIRECTORY_BATTLERESULT_H
/**
* @class BattleResult
* @brief バトルの結果を記録・管理するクラス
*
* このクラスは、各ターンにおける行動やダメージ、バフやデバフの状態など、バトルの詳細な結果を記録します。
* また、記録されたデータを更新するためのメソッドを提供します。
*/
class BattleResult {
public:
// 各メンバの内容を 0 にリセットする clear 関数
void clear() {
position = 0;
turn = 0;
}
static void
add(BattleResult* obj, int action, int damage, bool isEnemy, int BuffTurns, int PoisonTurns,
int speedTurn, int turn,
bool player0_has_initiative, int ehp, int ahp, uint64_t nowState, int scTurn, int amp, bool defenseFlag, bool sleepFlag) {
if (!obj) return; // ← これが最重要
const int pos = obj->position;
obj->actions[pos] = action;
obj->damages[pos] = damage;
obj->isEnemy[pos] = isEnemy;
obj->BuffTurnss[pos] = BuffTurns;
obj->PoisonTurns[pos] = PoisonTurns;
obj->SpeedTurn[pos] = speedTurn;
obj->turns[pos] = turn;
obj->initiative[pos] = player0_has_initiative;
obj->ehp[pos] = ehp;
obj->ahp[pos] = ahp;
obj->state[pos] = nowState;
obj->scTurn[pos] = scTurn;
obj->amp[pos] = amp;
obj->defenseFlag[pos] = defenseFlag;
obj->sleepFlag[pos] = sleepFlag;
obj->turn = turn;
obj->position = pos + 1;
}
int position = 0;
int turn = 0;
int actions[1000] = {};
int damages[1000] = {};
int isEnemy[1000] = {};
int BuffTurnss[1000] = {};
int PoisonTurns[1000] = {};
int SpeedTurn[1000] = {};
int turns[1000] = {};
bool initiative[1000] = {};
int ehp[1000] = {};
int ahp[1000] = {};
int scTurn[1000] = {};
int amp[1000] = {};
uint64_t state[1000] = {};
bool defenseFlag[1000] = {};
bool sleepFlag[1000] = {};
};
#endif //NEWDIRECTORY_BATTLERESULT_H