Class LOGIC::cla_computer_player
ClassList > LOGIC > cla_computer_player
This class represents a computer opponent in the game. It provides methods for automatic movement of tokens. It is derived from the cla_player .
#include <logic.hpp>
Inherits the following classes: LOGIC::cla_player
Public Functions
Type | Name |
---|---|
virtual int8_t | Auto_Move (uint8_t _u8_dice_value, bool & _bool_occupied_flag, uint8_t & _u8_old_position) override Automatic movement for a computer opponent. |
virtual bool | Is_Computer () override const Checks if the player is a computer opponent. |
cla_computer_player (uint8_t _u8_player_id, uint8_t _u8_start_position, uint8_t _u8_computer_quantity, cla_session * _obj_my_session, mode _en_mode) Constructor for the cla_computer_player class. |
Public Functions inherited from LOGIC::cla_player
Type | Name |
---|---|
virtual int8_t | Auto_Move (uint8_t _u8_dice_value, bool & _bool_occupied_flag, uint8_t & _u8_old_position) |
uint8_t | Calculate_Possible_Position (uint8_t _u8_token_number, uint8_t _u8_dice_value) Calculates the possible position of a token. |
uint8_t | Get_Player_Progress () Returns the overall progress of the player (Value between 1-28). |
status | Get_Player_Status () Outputs the status of player. |
uint8_t | Get_Start_Position () Returns the starting position of the player. |
uint8_t | Get_Token_Position (uint8_t _u8_token_number) Returns the current position of a token. |
uint8_t | Get_Token_Progress (uint8_t _u8_token_number) Returns the progress of a token on the track. |
virtual bool | Is_Computer () const = 0 Checks if the player is a computer opponent. |
int8_t | Is_Start_Field_Occupied_By_Own_Token () Checks if the starting square is occupied by own token while other tokens are home. |
uint8_t | Move_Token (uint8_t _u8_token_number, uint8_t _u8_dice_value) Moves a token on the track. |
uint8_t | Set_Token_Position (uint8_t _u8_token_number, uint8_t _u8_new_position) Changes the position of a token. |
cla_player (uint8_t _u8_player_id, uint8_t _u8_start_position, uint8_t _u8_computer_quantity, cla_session * _obj_my_session) Constructor for the cla_player class. |
Protected Attributes
Type | Name |
---|---|
mode | en_mode The mode of the computer opponent. |
Protected Attributes inherited from LOGIC::cla_player
Type | Name |
---|---|
cla_session * | obj_my_session Pointer to the associated session. |
uint8_t | u8_player_id The id of the player. |
uint8_t | u8_start_position The starting position of the player. |
uint8_t | u8_token_position The positions of the player's four tokens. |
Public Functions Documentation
function Auto_Move
Automatic movement for a computer opponent.
virtual int8_t LOGIC::cla_computer_player::Auto_Move (
uint8_t _u8_dice_value,
bool & _bool_occupied_flag,
uint8_t & _u8_old_position
) override
Parameters:
_u8_dice_value
The value of the rolled dice.&_bool_occupied_flag
Reference to a variable to store the occupied flag.&_u8_old_position
Reference to a variable to store the old position.
Returns:
The token that was automatically moved.
Implements LOGIC::cla_player::Auto_Move
function Is_Computer
Checks if the player is a computer opponent.
inline virtual bool LOGIC::cla_computer_player::Is_Computer () override const
Returns:
true if the player is a computer opponent, false otherwise.
Implements LOGIC::cla_player::Is_Computer
function cla_computer_player
Constructor for the cla_computer_player class.
LOGIC::cla_computer_player::cla_computer_player (
uint8_t _u8_player_id,
uint8_t _u8_start_position,
uint8_t _u8_computer_quantity,
cla_session * _obj_my_session,
mode _en_mode
)
Parameters:
_u8_player_id
The ID of the player._u8_start_position
The individual starting position of the player._u8_computer_quantity
The number of computer controlled players._u8_mode
The mode of the computer opponent.
Protected Attributes Documentation
variable en_mode
mode LOGIC::cla_computer_player::en_mode;
The documentation for this class was generated from the following file /home/runner/work/Arduino_DHBW_Spiel/Arduino_DHBW_Spiel/Engineering/COD_ENG_OUT_arduino_code/lib/Game_Logic/logic.hpp