BoardPositions

BoardPosition

class miniworldmaker.board_positions.board_position.BoardPosition(x, y)[source]

A BoardPosition Object represents a position on a Board.

As a subclass of namedtuple, BoardPosition is for performance reasons not mutable.

On a tiled board, the BoardPosition does not describe pixels but tiles coordinates.

add(x, y)[source]

Adds x and y to the board positions x and y coordinate

Returns: The new BoardPosition

down(value)[source]

Gets the board position below the actual board-position

Parameters

value – the number of fields below the actual position

Returns

A new BoardPosition

left(value)[source]

Gets the board position left of the the actual board-position

Parameters

value – the number of fields left of the the actual position

Returns

A new BoardPosition

right(value)[source]

Gets the board position right of the actual board-position

Parameters

value – the number of fields right of the actual position

Returns

A new BoardPosition

up(value)[source]

Gets the board position above the actual board-position

Parameters

value – the number of fields above the actual position

Returns

A new BoardPosition