Class LOGIC::cla_session
ClassList > LOGIC > cla_session
The cla_session class is the main class of the game logic. It initializes the players with their methods and it provides essential methods for the game logic.
#include <logic.hpp>
Public Attributes
Type | Name |
---|---|
cla_player * | array_players Array of pointers to the players. |
uint8_t | u8_is_occupied_player_id |
uint8_t | u8_is_occupied_token_number |
Public Functions
Type | Name |
---|---|
uint8_t | Get_Computer_Quantity () Returns the number of computer players. |
uint8_t | Get_Player_Quantity () Returns the number of players. |
bool | Is_Occupied (uint8_t & _u8_is_occupied_player_id, uint8_t & _u8_is_occupied_token_number, uint8_t _u8_affected_track_position) Checks if the position on the map is occupied. |
bool | Return_Home (uint8_t _u8_affected_track_position) Returns a token to its home position. |
cla_session (uint8_t _u8_player_quantity, uint8_t _u8_computer_quantity, mode _en_mode) Constructor for the cla_session class. |
Public Attributes Documentation
variable array_players
cla_player* LOGIC::cla_session::array_players[4];
variable u8_is_occupied_player_id
uint8_t LOGIC::cla_session::u8_is_occupied_player_id;
The ID of the player at the occupied track position.
variable u8_is_occupied_token_number
uint8_t LOGIC::cla_session::u8_is_occupied_token_number;
The token number at the occupied track position.
Public Functions Documentation
function Get_Computer_Quantity
uint8_t LOGIC::cla_session::Get_Computer_Quantity ()
function Get_Player_Quantity
uint8_t LOGIC::cla_session::Get_Player_Quantity ()
function Is_Occupied
Checks if the position on the map is occupied.
bool LOGIC::cla_session::Is_Occupied (
uint8_t & _u8_is_occupied_player_id,
uint8_t & _u8_is_occupied_token_number,
uint8_t _u8_affected_track_position
)
Parameters:
&u8_is_occupied_player_id
Reference to variable to store the player ID of the occupied track position.&u8_is_occupied_token_number
Reference to variable to store the token number of the occupied track position._u8_affected_track_position
The track position to check.
Returns:
true if occupied, false otherwise.
function Return_Home
Returns a token to its home position.
bool LOGIC::cla_session::Return_Home (
uint8_t _u8_affected_track_position
)
Parameters:
_u8_affected_track_position
The affected track position.
Returns:
true if the token is successfully returned home, false otherwise.
function cla_session
Constructor for the cla_session class.
LOGIC::cla_session::cla_session (
uint8_t _u8_player_quantity,
uint8_t _u8_computer_quantity,
mode _en_mode
)
Parameters:
_u8_player_quantity
Number of all players._u8_computer_quantity
Number of computer-controlled players.
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