Click or drag to resize
Game Class
The Game class contains the methods needed to process moves.
Inheritance Hierarchy
SystemObject
  VikingChess.ModelGame

Namespace: VikingChess.Model
Assembly: VikingChess (in VikingChess.exe) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
public class Game

The Game type exposes the following members.

Constructors
Methods
  NameDescription
Public methodcapturePiece
Loops through each of the nieghbours of the destination Square and checks if any piece has been captured.
Public methodcheckCapture
Checks if there is a Piece that can be captured in the passed in direction.
Public methodcheckKingCapture
Checks to see if the king is surrounded
Public methodcheckKingMoves
Checks to see if the King has moved to an edge.
Public methodcheckWin
Checks to see if a Player has won or not.
Public methodEquals (Inherited from Object.)
Protected methodFinalize (Inherited from Object.)
Public methodgetBoard
Returns the Board of this game.
Public methodgetCurrentPlayer
Returns the currentPlayer of this Game
Public methodGetHashCode (Inherited from Object.)
Public methodgetPlayer1
Get the player1Player
Public methodgetPlayer2
Get the player2Player
Public methodgetTurnCount
Returns the turnCount of this Game
Public methodGetType (Inherited from Object.)
Protected methodMemberwiseClone (Inherited from Object.)
Public methodmovePiece
Move a Piece on the board
Public methodmovePieceAndGetBoard
Move a Piece on the board
Public methodPlaySound
Plays a sound
Public methodsetCurrentPlayer
Sets the currentPlayer for this Game
Public methodsetScore
Sets the score for this Game
Public methodToString (Inherited from Object.)
Public methodundoMove
Undo the last move
Public methodupdateCurrentPlayer
Updates the currentPlayer of this Game
Public methodupdateTurnCount
Update the turnCount for this Game
Top
Fields
  NameDescription
Private fieldblackPieces
The number of black pieces
Private fieldboard
The Board to use for this Game
Private fieldcapturedPiece
The piece (if any) that has been captured.
Private fieldcurrentPlayer
The current player
Private fieldgameOver
A Boolean representing if the Game is over or not.
Private fieldgameType
A String defining the type of Game.
Private fieldkingCaptured
A Boolean representing if the king has been captured or not.
Private fieldkingEscaped
A Boolean representing if the king has escaped or not.
Private fieldmoveNotation
A String to store the move notation
Private fieldpieceCaptured
A Boolean representing if a piece has been captured or not.
Private fieldplayer1
The Attacking Player
Private fieldplayer2
The Defending Player
Private fieldscore
The score for this Game
Private fieldsimulated
A Boolean representing if the Game is being simulated or not.
Private fieldstateHistory
Contains all previous Board objects so that a move can be undone.
Private fieldturnCount
The current turn count;
Private fieldwhitePieces
The number of white pieces
Top
See Also