Conquer Chess
Chess and Starcraft combined
Loading...
Searching...
No Matches
Functions
user_inputs.cpp File Reference
#include "user_inputs.h"
#include "game.h"
#include "game_controller.h"
#include "square.h"
#include "game_coordinate.h"
#include "piece.h"
#include "piece_actions.h"
#include <cassert>
#include <iostream>
#include <sstream>
Include dependency graph for user_inputs.cpp:

Functions

void add (user_inputs &current, const user_inputs &to_be_added)
 Add new user inputs.
 
int count_user_inputs (const user_inputs &a)
 Count the total number of control actions to be done by the game, which should be zero after each tick.
 
void do_select (game_controller &c, const std::string &square_str, const side player_side)
 Select a piece.
 
void do_select_and_move_piece (game_controller &c, const std::string &from_square_str, const std::string &to_square_str, const side player_side, const physical_controller_type t)
 Select a piece and move it to a target square.
 
bool is_empty (const user_inputs &inputs) noexcept
 See if the user_inputs} holds zero elements.
 
void start_en_passant_attack (game &g, const game_controller &c, const game_coordinate &coordinat, const chess_color player_color)
 
void start_attack (game &g, const game_controller &c, const game_coordinate &coordinat, const chess_color player_color)
 Process an A or right-mouse-button down.
 
void start_move_unit (game &g, const game_controller &c, const game_coordinate &coordinat, const chess_color player_color)
 Process an M or right-mouse-button down.
 
void test_user_inputs ()
 Test this class and its free functions.
 
bool operator== (const user_inputs &lhs, const user_inputs &rhs) noexcept
 
bool operator!= (const user_inputs &lhs, const user_inputs &rhs) noexcept
 
std::ostream & operator<< (std::ostream &os, const user_inputs &actions) noexcept
 

Function Documentation

◆ add()

void add ( user_inputs current,
const user_inputs to_be_added 
)

Add new user inputs.

◆ count_user_inputs()

int count_user_inputs ( const user_inputs a)

Count the total number of control actions to be done by the game, which should be zero after each tick.

◆ do_select()

void do_select ( game_controller c,
const std::string &  square_str,
const side  player_side 
)

Select a piece.

◆ do_select_and_move_piece()

void do_select_and_move_piece ( game_controller c,
const std::string &  from_square_str,
const std::string &  to_square_str,
const side  player_side,
const physical_controller_type  t 
)

Select a piece and move it to a target square.

◆ is_empty()

bool is_empty ( const user_inputs inputs)
noexcept

See if the user_inputs} holds zero elements.

◆ operator!=()

bool operator!= ( const user_inputs lhs,
const user_inputs rhs 
)
noexcept

◆ operator<<()

std::ostream & operator<< ( std::ostream &  os,
const user_inputs actions 
)
noexcept

◆ operator==()

bool operator== ( const user_inputs lhs,
const user_inputs rhs 
)
noexcept

◆ start_attack()

void start_attack ( game g,
const game_controller c,
const game_coordinate coordinat,
const chess_color  player_color 
)

Process an A or right-mouse-button down.

◆ start_en_passant_attack()

void start_en_passant_attack ( game g,
const game_controller c,
const game_coordinate coordinat,
const chess_color  player_color 
)

◆ start_move_unit()

void start_move_unit ( game g,
const game_controller c,
const game_coordinate coordinat,
const chess_color  player_color 
)

Process an M or right-mouse-button down.

◆ test_user_inputs()

void test_user_inputs ( )

Test this class and its free functions.