C# Class Descent.GUI.Screens.BoardElement

The element on the screen that visualizes the game board and marking fields on the board if needed.
Inheritance: GUIElement
Afficher le fichier Open project: nezbo/Descent

Méthodes publiques

Méthode Description
BoardElement ( Microsoft.Xna.Framework.Game game, Board board, Role role ) : System

Creates a new BoardGUIElement for the given parameters.

ClearMarks ( ) : void

Clears the board for all markings.

Draw ( SpriteBatch draw ) : void
HandleClick ( int x, int y ) : bool
MarkSquare ( int x, int y, bool positive ) : void

Marks a square on the board with a transparent color.

Update ( GameTime gameTime ) : void

Private Methods

Méthode Description
CalcBoardSquare ( int mouseX, int mouseY ) : Point
CalcScreenVector ( int boardX, int boardY ) : Vector2
DrawMark ( SpriteBatch draw, int boardX, int boardY, bool positiveMark ) : void
RightPosition ( Figure f, Point toTest ) : bool

Method Details

BoardElement() public méthode

Creates a new BoardGUIElement for the given parameters.
public BoardElement ( Microsoft.Xna.Framework.Game game, Board board, Role role ) : System
game Microsoft.Xna.Framework.Game The current Game object.
board Descent.Model.Board.Board The Board to visualize.
role Role The Role determines how much of the Board is visible.
Résultat System

ClearMarks() public méthode

Clears the board for all markings.
public ClearMarks ( ) : void
Résultat void

Draw() public méthode

public Draw ( SpriteBatch draw ) : void
draw Microsoft.Xna.Framework.Graphics.SpriteBatch
Résultat void

HandleClick() public méthode

public HandleClick ( int x, int y ) : bool
x int
y int
Résultat bool

MarkSquare() public méthode

Marks a square on the board with a transparent color.
public MarkSquare ( int x, int y, bool positive ) : void
x int The x-coordinate of the square on the board.
y int The y-coordinate of the square on the board.
positive bool True if the highlight should indicate a eligible. False if it should indicate inaccessibility.
Résultat void

Update() public méthode

public Update ( GameTime gameTime ) : void
gameTime Microsoft.Xna.Framework.GameTime
Résultat void