PHP Class PHPWarrior\Position

Mostrar archivo Open project: yandod/php-warrior Class Usage Examples

Public Properties

Property Type Description
$DIRECTIONS
$RELATIVE_DIRECTIONS
$floor

Public Methods

Method 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 method

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

direction() public method

public direction ( )

direction_of() public method

public direction_of ( $space ) : string
$space
return string

direction_stub() public method

public direction_stub ( )

distance_from_stairs() public method

distance_of() public method

public distance_of ( $space ) : mixed
$space
return mixed

is_at() public method

public is_at ( integer $x, integer $y ) : boolean
$x integer
$y integer
return boolean

move() public method

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

normalize_direction() public static method

public static normalize_direction ( $direction ) : mixed
$direction
return mixed

relative_direction() public method

public relative_direction ( $direction ) : mixed
$direction
return mixed

relative_direction_of() public method

public relative_direction_of ( $space ) : mixed
$space
return mixed

relative_direction_of_stairs() public method

relative_space() public method

public relative_space ( $forward, integer $right ) : mixed
$forward
$right integer
return mixed

rotate() public method

public rotate ( $amount )
$amount

space() public method

public space ( )

translate_offset() public method

public translate_offset ( $forward, $right ) : array
$forward
$right
return 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