C# Класс Descent.Model.Board.Board

A board of
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
AddDoor ( Door door ) : void

Adds a door to the board

Board ( int width, int height, Microsoft.Xna.Framework.Graphics.Texture2D floorTexture ) : System

Initializes a new instance of the Board class.

CanFigureMoveToPoint ( Figure figure, Point point ) : bool

Gets a value indicating whether a figure can move to a point

CanOverlordSpawn ( Point point ) : bool

Indicates whether the overlord can spawn on a space

Distance ( Point here, Point there ) : int

Get the distance between to squares. This distance does not take blocking into account, such has there being a wall in the way

FigureSquares ( Figure figure ) : Point[]

Creates an array of all points a figure is on

IsSquareWithinBoard ( Point point ) : bool

Determines whether the point is within the board, and if there is a square on that point.

IsSquareWithinBoard ( int x, int y ) : bool

Determines wether the point (x, y) is within the board, and a square in the dungeon

IsStandable ( Point points ) : bool

Is all points in the array standable?

IsStandable ( int x, int y ) : bool

Is the square inside the dungeon, and is there no figure?

IsThereLineOfSight ( Figure from, Figure to, bool ignoreMonsters ) : bool

Indicates whethere there's nothing in the way from one figure to another. Can ignore monsters.

IsThereLineOfSight ( Point from, Point to, bool ignoreMonsters ) : bool

Indicates whether there is nothing in the way from one point to another Monsters can be ignored, so it can be used to calculate where to spawn monsters

IsValidStartSquare ( Point point ) : bool

Indicates whether a point is a valid start/spawn point

MoveFigure ( Figure figure, Point point ) : void

Moves a figure to a specific point.

OpenDoor ( Point point ) : void

Open a door

PlaceFigure ( Figure figure, Point point ) : void

Places a figure at a specific point

RespawnDeadHeroes ( ) : void

Respawns a dead hero next to the start glyph

SquareVisibleByPlayers ( int x, int y ) : bool

Should the square be shown on the board? A square is visible by players if it has something on it, and if that squares area has been revealed

this ( Point p ) : Square

Access a point on the board

this ( int x, int y ) : Square

Access the (x, y)'th in the board

Приватные методы

Метод Описание
CanOpenDoor ( Point point ) : bool
GetDoor ( Point point ) : Door

Gets a door at a specific point, if there is any

PlaceDeadHero ( Hero hero ) : void
RemoveFigure ( Point point ) : void

Removes a figure from all squares where it was previously on the board

SquaresBetweenPoints ( Point from, Point to ) : Point[]

Get a (non-sorted) array of squares between two squares.

UpdateCanSpawn ( ) : void

Описание методов

AddDoor() публичный Метод

Adds a door to the board
public AddDoor ( Door door ) : void
door Door /// The door to be added ///
Результат void

Board() публичный Метод

Initializes a new instance of the Board class.
public Board ( int width, int height, Microsoft.Xna.Framework.Graphics.Texture2D floorTexture ) : System
width int /// The width of the board ///
height int /// The height of the board ///
floorTexture Microsoft.Xna.Framework.Graphics.Texture2D /// The floor Texture. ///
Результат System

CanFigureMoveToPoint() публичный Метод

Gets a value indicating whether a figure can move to a point
public CanFigureMoveToPoint ( Figure figure, Point point ) : bool
figure Descent.Model.Player.Figure.Figure /// The figure ///
point Point /// The upper left corner of the end point ///
Результат bool

CanOverlordSpawn() публичный Метод

Indicates whether the overlord can spawn on a space
public CanOverlordSpawn ( Point point ) : bool
point Point /// The point ///
Результат bool

Distance() публичный Метод

Get the distance between to squares. This distance does not take blocking into account, such has there being a wall in the way
public Distance ( Point here, Point there ) : int
here Point /// The 'here' point ///
there Point /// The 'there' point ///
Результат int

FigureSquares() публичный Метод

Creates an array of all points a figure is on
public FigureSquares ( Figure figure ) : Point[]
figure Descent.Model.Player.Figure.Figure /// The figure ///
Результат Point[]

IsSquareWithinBoard() публичный Метод

Determines whether the point is within the board, and if there is a square on that point.
public IsSquareWithinBoard ( Point point ) : bool
point Point /// The point. ///
Результат bool

IsSquareWithinBoard() публичный Метод

Determines wether the point (x, y) is within the board, and a square in the dungeon
public IsSquareWithinBoard ( int x, int y ) : bool
x int /// The x coordinate ///
y int /// The y coordinate ///
Результат bool

IsStandable() публичный Метод

Is all points in the array standable?
public IsStandable ( Point points ) : bool
points Point
Результат bool

IsStandable() публичный Метод

Is the square inside the dungeon, and is there no figure?
public IsStandable ( int x, int y ) : bool
x int /// The x coordinate ///
y int /// The y coordinate ///
Результат bool

IsThereLineOfSight() публичный Метод

Indicates whethere there's nothing in the way from one figure to another. Can ignore monsters.
public IsThereLineOfSight ( Figure from, Figure to, bool ignoreMonsters ) : bool
from Descent.Model.Player.Figure.Figure "From" figure.
to Descent.Model.Player.Figure.Figure "To" figure.
ignoreMonsters bool Will ignore monsters if true.
Результат bool

IsThereLineOfSight() публичный Метод

Indicates whether there is nothing in the way from one point to another Monsters can be ignored, so it can be used to calculate where to spawn monsters
public IsThereLineOfSight ( Point from, Point to, bool ignoreMonsters ) : bool
from Point /// The start point ///
to Point /// The end point ///
ignoreMonsters bool /// If true, monsters will be ignored so they do not break line of sight ///
Результат bool

IsValidStartSquare() публичный Метод

Indicates whether a point is a valid start/spawn point
public IsValidStartSquare ( Point point ) : bool
point Point /// The point to check ///
Результат bool

MoveFigure() публичный Метод

Moves a figure to a specific point.
public MoveFigure ( Figure figure, Point point ) : void
figure Descent.Model.Player.Figure.Figure /// The figure that is moved ///
point Point /// The upper left corner of the figure, that is moved to ///
Результат void

OpenDoor() публичный Метод

Open a door
public OpenDoor ( Point point ) : void
point Point /// A point adjacent to a door ///
Результат void

PlaceFigure() публичный Метод

Places a figure at a specific point
public PlaceFigure ( Figure figure, Point point ) : void
figure Descent.Model.Player.Figure.Figure /// The figure that is placed ///
point Point /// The upper left corner of the figure ///
Результат void

RespawnDeadHeroes() публичный Метод

Respawns a dead hero next to the start glyph
public RespawnDeadHeroes ( ) : void
Результат void

SquareVisibleByPlayers() публичный Метод

Should the square be shown on the board? A square is visible by players if it has something on it, and if that squares area has been revealed
public SquareVisibleByPlayers ( int x, int y ) : bool
x int /// The x coordinate ///
y int /// The y coordinate ///
Результат bool

this() публичный Метод

Access a point on the board
public this ( Point p ) : Square
p Point /// The point to be accessed ///
Результат Square

this() публичный Метод

Access the (x, y)'th in the board
public this ( int x, int y ) : Square
x int /// The x coordinate ///
y int /// The y coordinate ///
Результат Square