32#ifndef RCSC_PLAYER_STAMINA_MODEL_H
33#define RCSC_PLAYER_STAMINA_MODEL_H
114 return M_capacity <= 1.0e-5
115 && M_capacity >= 0.0;
130 const double sensed_effort,
131 const double sensed_capacity,
143 const double new_effort,
144 const double new_recovery,
145 const double new_capacity );
154 M_stamina = new_stamina;
165 M_effort = new_effort;
175 M_recovery = new_recovery;
185 M_capacity = new_capacity;
214 const double & dash_power );
224 const double & dash_power );
236 const double & dash_power );
246 const double dash_power,
247 const double stamina_buffer = 1.0 )
const;
game time object
Definition: game_time.h:43
heterogeneous player parametor class
Definition: player_type.h:50
stamina management class
Definition: stamina_model.h:44
bool capacityIsEmpty() const
check if stamina capacity is empty.
Definition: stamina_model.h:112
void init(const PlayerType &player_type)
initialize internal variables with server settings
StaminaModel()
init members by built-in values
void updateBySenseBody(const double sensed_stamina, const double sensed_effort, const double sensed_capacity, const GameTime ¤t)
update by sense_body information
void simulateDashes(const PlayerType &player_type, const int n_dash, const double &dash_power)
simulate stamina variables after nr dashes.
void simulateWaits(const PlayerType &player_type, const int n_wait)
simulate stamina variables after nr waits.
double capacity() const
get the current remained stamina capacity
Definition: stamina_model.h:103
double getSafetyDashPower(const PlayerType &player_type, const double dash_power, const double stamina_buffer=1.0) const
get dash power to save recovery
void simulateDash(const PlayerType &player_type, const double &dash_power)
simulate stamina variables after one dash.
const StaminaModel & setStamina(const double new_stamina)
set new stamina value
Definition: stamina_model.h:152
double recovery() const
get current recovery value
Definition: stamina_model.h:85
double effort() const
get current effort value
Definition: stamina_model.h:94
void simulate(const PlayerType &player_type, const int n_wait, const int n_dash, const double &dash_power)
simulate stamina variables
const StaminaModel & setCapacity(const double new_capacity)
set new stamina capacity value
Definition: stamina_model.h:183
const StaminaModel & setRecovery(const double new_recovery)
set new recovery value
Definition: stamina_model.h:173
double stamina() const
get current stamina value
Definition: stamina_model.h:76
const StaminaModel & setEffort(const double new_effort)
set new effort value
Definition: stamina_model.h:163
void simulateWait(const PlayerType &player_type)
simulate stamina variables after one wait.
const StaminaModel & setValues(const double new_stamina, const double new_effort, const double new_recovery, const double new_capacity)
set all values