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
Show file Open project: nezbo/Descent

Public Methods

Method 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

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

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.
return System

ClearMarks() public method

Clears the board for all markings.
public ClearMarks ( ) : void
return void

Draw() public method

public Draw ( SpriteBatch draw ) : void
draw Microsoft.Xna.Framework.Graphics.SpriteBatch
return void

HandleClick() public method

public HandleClick ( int x, int y ) : bool
x int
y int
return bool

MarkSquare() public method

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.
return void

Update() public method

public Update ( GameTime gameTime ) : void
gameTime Microsoft.Xna.Framework.GameTime
return void