Sokoban
Static Public Member Functions | List of all members
MapUtils Class Reference

Class which provides arithmetics operations over map data using map element constants. More...

#include <Map.h>

Static Public Member Functions

static bool is_walkable_element (element el)
 Checks if element is waklable (groud or target) More...
 
static bool is_barrel_movable_element (element el, int barrel_info)
 Check if element is movable and with no barrel. More...
 
static element make_full_element (element el, int barrel_info)
 Makes data complete element from gamegrid element and barrel information. More...
 
static element make_sokoban_element (element el, element sokoban_el)
 Makes data complete sokoban element from gamegrid element and sokoban element. More...
 
static bool is_dead_position_triangle (element el_1, int b_1, element el_2, int b_2, element el_3, int b_3)
 Checks if elements of corner triangle allows to move barrel or not (dead position). More...
 
static int number_of_new_barrel_on_target (element el_of_new_barrel, element el_of_old_barrel)
 Count the number of new barrel on target (+1, 0, -1). More...
 

Detailed Description

Class which provides arithmetics operations over map data using map element constants.

See also
Map

Member Function Documentation

◆ is_barrel_movable_element()

static bool MapUtils::is_barrel_movable_element ( element  el,
int  barrel_info 
)
static

Check if element is movable and with no barrel.

Parameters
elElement which is checked
barrel_infoInformation about the barrel for this element. 0 no barrel, otherwise barrel.
Returns
If it is possible to move barrel on this element.

◆ is_dead_position_triangle()

static bool MapUtils::is_dead_position_triangle ( element  el_1,
int  b_1,
element  el_2,
int  b_2,
element  el_3,
int  b_3 
)
static

Checks if elements of corner triangle allows to move barrel or not (dead position).

@ el_1 Element of the first part of corner. @ b_1 Barrel information of the first part of corner. @ el_2 Element of the second part of corner. @ b_2 Barrel information of the second part of corner. @ el_3 Element of the third part of corner. @ b_3 Barrel information of the third part of corner.

Returns
True if corner does not allow to move barrel.

◆ is_walkable_element()

static bool MapUtils::is_walkable_element ( element  el)
static

Checks if element is waklable (groud or target)

Parameters
elElement which is checked.
Returns
If element el is walkable.

◆ make_full_element()

static element MapUtils::make_full_element ( element  el,
int  barrel_info 
)
static

Makes data complete element from gamegrid element and barrel information.

Parameters
elGamegrid element.
barrel_infoInformation about the barrel for this element. 0 no barrel, otherwise barrel.
Returns
Data complete game element.

◆ make_sokoban_element()

static element MapUtils::make_sokoban_element ( element  el,
element  sokoban_el 
)
static

Makes data complete sokoban element from gamegrid element and sokoban element.

Parameters
elGamegrid element
sokoban_elSokoban element.
Returns
Data complete game element.

◆ number_of_new_barrel_on_target()

static int MapUtils::number_of_new_barrel_on_target ( element  el_of_new_barrel,
element  el_of_old_barrel 
)
static

Count the number of new barrel on target (+1, 0, -1).

Parameters
el_of_new_barrelNew element which barrel is now sitting on.
el_of_old_barrelOriginal element which barrel was sitting on previously.
Returns
1, 0 or -1 according to the change.

The documentation for this class was generated from the following file: