GameApi 28
Library used by GameApi Builder tool
Loading...
Searching...
No Matches
test.cpp File Reference
#include "GameApi.hh"
#include <iostream>
#include <cstdlib>
#include <cassert>
Include dependency graph for test.cpp:

Classes

struct  Pos
class  Move
struct  MoveStatus
struct  BlockStatus
struct  BlockStatusBoard
struct  Line
struct  Envi

Functions

void color_change2 (GameApi::WorldObj &obj, int x, int y, int c)
int charsmap (char c)
std::vector< Pos > possible_moves (WorldObj &o, int x, int y, Envi &e, bool attack)
bool check_towering (WorldObj *pieces, bool left, bool white, bool check)
Pos towering_new_block (bool left, bool white)
Move global_best_move (bool is_white, WorldObj &o, Envi &e)
void print_move (WorldObj &o, const Move &m)
std::string piece_name (int c)
void get_block_status (WorldObj &o, Envi &e, BlockStatusBoard &board)
MoveStatus get_move_status (WorldObj &o, Envi &e, int x, int y, int xx, int yy, const BlockStatusBoard &board)
int move_status_score (const MoveStatus &s, bool is_white)
int line_array_score (std::vector< Line > v, bool is_white)
int line_score (const Line &l, bool is_white)
std::vector< Line > calculate_lines (WorldObj &o, Envi &e, int x, int y)
bool check_status (WorldObj &o, Envi &e, bool is_white)
bool piece_color_is_white (int c)
bool is_inside_board (Pos p)
bool piece_action (std::vector< Pos > &pos, int piece2, int piece_color, int opponent_color, Pos p1, bool attack)
Pos position_attacked (WorldObj &o, int x, int y, bool attacker_is_white, Envi &e)
void do_promotion (WorldObj *board)
void color_change (int c, P &p, EveryApi &ev)
PT horse_head_func (EveryApi &ev, int idx, void *data)
P chars_blocks (int c, EveryApi &ev)
int boardmap (char c)
void board_color2 (WorldObj &obj, int x, int y, int c)
P board_blocks (int c, EveryApi &ev)
void store_board (WorldObj &o, int *array)
void restore_board (int *array, WorldObj &o, bool is_board)
bool towering_needs_update (WorldObj *pieces, int chosen_x, int chosen_y, int cursor_x, int cursor_y)
void towering_update (WorldObj *pieces, bool left, bool white)
bool update_towering_allowed (int x, int y, bool left, bool white)
void iter ()
int main (int argc, char *argv[])
void print_block_status (const BlockStatusBoard &b, int val)
int piece_score (int c)
bool opp_king_attack_prevention (WorldObj &o, Envi &e, int x, int y, int xx, int yy, bool is_white)
void print_move_status (const MoveStatus &s)
Move find_best_move (bool is_white, WorldObj &o, Envi &e, const BlockStatusBoard &board)

Variables

char chars []
struct Envi env
char board []

Function Documentation

◆ board_blocks()

P board_blocks ( int c,
EveryApi & ev )
Here is the caller graph for this function:

◆ board_color2()

void board_color2 ( WorldObj & obj,
int x,
int y,
int c )
Here is the caller graph for this function:

◆ boardmap()

int boardmap ( char c)
Here is the caller graph for this function:

◆ calculate_lines()

std::vector< Line > calculate_lines ( WorldObj & o,
Envi & e,
int x,
int y )
Here is the caller graph for this function:

◆ chars_blocks()

P chars_blocks ( int c,
EveryApi & ev )
Here is the caller graph for this function:

◆ charsmap()

int charsmap ( char c)
Here is the caller graph for this function:

◆ check_status()

bool check_status ( WorldObj & o,
Envi & e,
bool is_white )
Here is the caller graph for this function:

◆ check_towering()

bool check_towering ( WorldObj * pieces,
bool left,
bool white,
bool check )
Here is the caller graph for this function:

◆ color_change()

void color_change ( int c,
P & p,
EveryApi & ev )
Here is the caller graph for this function:

◆ color_change2()

void color_change2 ( GameApi::WorldObj & obj,
int x,
int y,
int c )
Here is the caller graph for this function:

◆ do_promotion()

void do_promotion ( WorldObj * board)
Here is the caller graph for this function:

◆ find_best_move()

Move find_best_move ( bool is_white,
WorldObj & o,
Envi & e,
const BlockStatusBoard & board )
Here is the caller graph for this function:

◆ get_block_status()

void get_block_status ( WorldObj & o,
Envi & e,
BlockStatusBoard & board )
Here is the caller graph for this function:

◆ get_move_status()

MoveStatus get_move_status ( WorldObj & o,
Envi & e,
int x,
int y,
int xx,
int yy,
const BlockStatusBoard & board )
Here is the caller graph for this function:

◆ global_best_move()

Move global_best_move ( bool is_white,
WorldObj & o,
Envi & e )
Here is the caller graph for this function:

◆ horse_head_func()

PT horse_head_func ( EveryApi & ev,
int idx,
void * data )
Here is the caller graph for this function:

◆ is_inside_board()

bool is_inside_board ( Pos p)
Here is the caller graph for this function:

◆ iter()

void iter ( )
Here is the caller graph for this function:

◆ line_array_score()

int line_array_score ( std::vector< Line > v,
bool is_white )
Here is the caller graph for this function:

◆ line_score()

int line_score ( const Line & l,
bool is_white )
Here is the caller graph for this function:

◆ main()

int main ( int argc,
char * argv[] )

◆ move_status_score()

int move_status_score ( const MoveStatus & s,
bool is_white )
Here is the caller graph for this function:

◆ opp_king_attack_prevention()

bool opp_king_attack_prevention ( WorldObj & o,
Envi & e,
int x,
int y,
int xx,
int yy,
bool is_white )
Here is the caller graph for this function:

◆ piece_action()

bool piece_action ( std::vector< Pos > & pos,
int piece2,
int piece_color,
int opponent_color,
Pos p1,
bool attack )
Here is the caller graph for this function:

◆ piece_color_is_white()

bool piece_color_is_white ( int c)
Here is the caller graph for this function:

◆ piece_name()

std::string piece_name ( int c)
Here is the caller graph for this function:

◆ piece_score()

int piece_score ( int c)
Here is the caller graph for this function:

◆ position_attacked()

Pos position_attacked ( WorldObj & o,
int x,
int y,
bool attacker_is_white,
Envi & e )

◆ possible_moves()

std::vector< Pos > possible_moves ( WorldObj & o,
int x,
int y,
Envi & e,
bool attack )
Here is the caller graph for this function:

◆ print_block_status()

void print_block_status ( const BlockStatusBoard & b,
int val )

◆ print_move()

void print_move ( WorldObj & o,
const Move & m )
Here is the caller graph for this function:

◆ print_move_status()

void print_move_status ( const MoveStatus & s)
Here is the caller graph for this function:

◆ restore_board()

void restore_board ( int * array,
WorldObj & o,
bool is_board )
Here is the caller graph for this function:

◆ store_board()

void store_board ( WorldObj & o,
int * array )
Here is the caller graph for this function:

◆ towering_needs_update()

bool towering_needs_update ( WorldObj * pieces,
int chosen_x,
int chosen_y,
int cursor_x,
int cursor_y )
Here is the caller graph for this function:

◆ towering_new_block()

Pos towering_new_block ( bool left,
bool white )
Here is the caller graph for this function:

◆ towering_update()

void towering_update ( WorldObj * pieces,
bool left,
bool white )
Here is the caller graph for this function:

◆ update_towering_allowed()

bool update_towering_allowed ( int x,
int y,
bool left,
bool white )
Here is the caller graph for this function:

Variable Documentation

◆ board

char board[]
Initial value:
=
"OXOXOXOX"
"XOXOXOXO"
"OXOXOXOX"
"XOXOXOXO"
"OXOXOXOX"
"XOXOXOXO"
"OXOXOXOX"
"XOXOXOXO"

◆ chars

char chars[]
Initial value:
=
"thlkqlht"
"pppppppp"
"........"
"........"
"........"
"........"
"PPPPPPPP"
"THLKQLHT"

◆ env

struct Envi env