PHP Class PHPWarrior\Position

Afficher le fichier Open project: yandod/php-warrior Class Usage Examples

Méthodes publiques

Свойство Type Description
$DIRECTIONS
$RELATIVE_DIRECTIONS
$floor

Méthodes publiques

Méthode Description
__construct ( $floor, $x, $y, null $direction = null ) Position constructor.
direction ( )
direction_of ( $space ) : string
direction_stub ( )
distance_from_stairs ( )
distance_of ( $space ) : mixed
is_at ( integer $x, integer $y ) : boolean
move ( $forward, integer $right )
normalize_direction ( $direction ) : mixed
relative_direction ( $direction ) : mixed
relative_direction_of ( $space ) : mixed
relative_direction_of_stairs ( )
relative_space ( $forward, integer $right ) : mixed
rotate ( $amount )
space ( )
translate_offset ( $forward, $right ) : array

Method Details

__construct() public méthode

Position constructor.
public __construct ( $floor, $x, $y, null $direction = null )
$floor
$x
$y
$direction null

direction() public méthode

public direction ( )

direction_of() public méthode

public direction_of ( $space ) : string
$space
Résultat string

direction_stub() public méthode

public direction_stub ( )

distance_from_stairs() public méthode

distance_of() public méthode

public distance_of ( $space ) : mixed
$space
Résultat mixed

is_at() public méthode

public is_at ( integer $x, integer $y ) : boolean
$x integer
$y integer
Résultat boolean

move() public méthode

public move ( $forward, integer $right )
$forward
$right integer

normalize_direction() public static méthode

public static normalize_direction ( $direction ) : mixed
$direction
Résultat mixed

relative_direction() public méthode

public relative_direction ( $direction ) : mixed
$direction
Résultat mixed

relative_direction_of() public méthode

public relative_direction_of ( $space ) : mixed
$space
Résultat mixed

relative_direction_of_stairs() public méthode

relative_space() public méthode

public relative_space ( $forward, integer $right ) : mixed
$forward
$right integer
Résultat mixed

rotate() public méthode

public rotate ( $amount )
$amount

space() public méthode

public space ( )

translate_offset() public méthode

public translate_offset ( $forward, $right ) : array
$forward
$right
Résultat array

Property Details

$DIRECTIONS public_oe static_oe property

public static $DIRECTIONS

$RELATIVE_DIRECTIONS public_oe static_oe property

public static $RELATIVE_DIRECTIONS

$floor public_oe property

public $floor