OSDN Git Service

[Refactor] #963 Renamed take_turn() to update_player_turn_energy()
[hengbandforosx/hengbandosx.git] / src / player-status / player-energy.cpp
1 /*
2  * @file player-energy.cpp
3  * @brief ゲームターン当たりの行動エネルギー増減処理
4  * @author Hourier
5  * @date 2021/04/29
6  */
7
8 #include "player-status/player-energy.h"
9 #include "system/player-type-definition.h"
10
11 // todo 第3引数 (演算:代入、加算、減算、他)を導入する。enumを使う
12 void update_player_turn_energy(player_type *creature_ptr, PERCENTAGE need_cost)
13 {
14     creature_ptr->energy_use = (ENERGY)need_cost;
15 }
16
17 /*
18  * @brief ターン消費をなくす (主にコマンド実行に失敗した場合)
19  * @param player_type プレーヤーへの参照ポインタ
20  * @return なし
21  */
22 void reset_player_turn(player_type *creature_ptr)
23 {
24     creature_ptr->energy_use = 0;
25 }