C# Class Descent.Model.Board.Board

A board of
Afficher le fichier Open project: nezbo/Descent Class Usage Examples

Méthodes publiques

Méthode Description
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

Private Methods

Méthode Description
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

Method Details

AddDoor() public méthode

Adds a door to the board
public AddDoor ( Door door ) : void
door Door /// The door to be added ///
Résultat void

Board() public méthode

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. ///
Résultat System

CanFigureMoveToPoint() public méthode

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 ///
Résultat bool

CanOverlordSpawn() public méthode

Indicates whether the overlord can spawn on a space
public CanOverlordSpawn ( Point point ) : bool
point Point /// The point ///
Résultat bool

Distance() public méthode

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 ///
Résultat int

FigureSquares() public méthode

Creates an array of all points a figure is on
public FigureSquares ( Figure figure ) : Point[]
figure Descent.Model.Player.Figure.Figure /// The figure ///
Résultat Point[]

IsSquareWithinBoard() public méthode

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. ///
Résultat bool

IsSquareWithinBoard() public méthode

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 ///
Résultat bool

IsStandable() public méthode

Is all points in the array standable?
public IsStandable ( Point points ) : bool
points Point
Résultat bool

IsStandable() public méthode

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 ///
Résultat bool

IsThereLineOfSight() public méthode

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.
Résultat bool

IsThereLineOfSight() public méthode

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 ///
Résultat bool

IsValidStartSquare() public méthode

Indicates whether a point is a valid start/spawn point
public IsValidStartSquare ( Point point ) : bool
point Point /// The point to check ///
Résultat bool

MoveFigure() public méthode

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 ///
Résultat void

OpenDoor() public méthode

Open a door
public OpenDoor ( Point point ) : void
point Point /// A point adjacent to a door ///
Résultat void

PlaceFigure() public méthode

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 ///
Résultat void

RespawnDeadHeroes() public méthode

Respawns a dead hero next to the start glyph
public RespawnDeadHeroes ( ) : void
Résultat void

SquareVisibleByPlayers() public méthode

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 ///
Résultat bool

this() public méthode

Access a point on the board
public this ( Point p ) : Square
p Point /// The point to be accessed ///
Résultat Square

this() public méthode

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 ///
Résultat Square