C#Code
C#Code
Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | Properties | Private Member Functions | Private Attributes
TheForum.GameCode.BaseGameBoard Class Reference
Inheritance diagram for TheForum.GameCode.BaseGameBoard:
TheForum.GameCode.BackgroundBoard TheForum.GameCode.BackgroundBoard TheForum.GameCode.BasicGameBoard TheForum.GameCode.BasicGameBoard TheForum.GameCode.PieceDisplayBoard TheForum.GameCode.PieceDisplayBoard

List of all members.

Public Member Functions

 BaseGameBoard ()
virtual void Initialize ()
virtual void Setup (Libraries.AssetManager assetM, Libraries.StringType posterID)
virtual void Load (Libraries.AssetManager assetM)
virtual bool CheckForFlag (Libraries.StringType flag)
int BoardSize ()
void Clear ()
void SetUpperLeftPos (float startX, float startY, float startZ)
int GetNumCols ()
int GetNumRows ()
int RemoveAllGroupPieces ()
void RemoveAllPieces ()
int GetNumGroupPieces ()
BasePiece[] GetRemoveAllGroupPieces ()
BasePiece[] GetRemovePiecesByColor (Libraries.StringType color)
BasePiece[] GetPiecesByItem (Libraries.StringType itemType)
bool RectCollisCheckWithPieceRect (int col, int row, Libraries.Collision.RectCollision2D check)
bool CheckIsEmpty ()
bool CheckForPieceIntersection (Libraries.ScreenPicking.ScreenPicker picker3D, ref float dist, ref Point slot)
bool CheckIsValidPieceSlot (int col, int row)
void ClampPos (ref int col, ref int row)
virtual void StorePiece (BasePiece piece, int col, int row, bool settle)
void SetBoardDims (int numC, int numR)
void SetPieceOffset (Vector3 offset)
Vector3 GetPlayAreaRect ()
Vector3 GetPlayAreaRect (int numC, int numR)
Vector3 GetPieceWorldPos (int col, int row, Vector3 pieceDims)
Vector3 GetPieceWorldPos (int col, int row)
void SetAllowPieceItemUpdate (bool allow)
bool CheckIfSlotContainsPiece (int col, int row)
BasePiece GetPieceInSlot (int col, int row)
bool CheckForAllRemovals ()
void SetPieceWorldPos (BasePiece piece, int col, int row)
void SetPieceWorldPosOnly (BasePiece piece, int col, int row)
bool GetPiecePositionProperitesForSlot (int col, int row, ref Vector3 trans, ref Vector3 rot, ref Vector3 scale, bool isPiece3D)
Vector3 GetPiece3DInitialScale ()
abstract void Update (int framesPassed, Libraries.AssetManager assetM)
virtual void HandleKeyboardInputDelegate (object message)
virtual void HandleGameMessageDelegate (object message)
abstract void Render (GraphicsDevice device)
void EmptyBoard ()
Point[] FindEmptyRowSlots (int row)
Point[] FindFilledRowSlots (int row)
int CountOpenRowSlots (int row)
bool FindPieceSlot (BasePiece piece, out int col, out int row)
Point GetPieceSlotForWorldCoord (Vector3 pos)
bool SettleAllColumns ()
Vector3 GetStartPos ()
Vector3 GetTopLeftPlayAreaPos ()
Point GetCurrentSelectionSlot ()
int GetNumPiecesStored ()
PieceSwapper GetPieceSwapper ()
int GetFillHeight ()
 BaseGameBoard ()
virtual void Initialize ()
virtual void Setup (Libraries.AssetManager assetM)
virtual void Load (Libraries.AssetManager assetM)
virtual bool CheckForFlag (Libraries.StringType flag)
int BoardSize ()
void Clear ()
void SetUpperLeftPos (float startX, float startY, float startZ)
int GetNumCols ()
int GetNumRows ()
int RemoveAllGroupPieces ()
int GetNumGroupPieces ()
BasePiece[] GetRemoveAllGroupPieces ()
BasePiece[] GetRemovePiecesByColor (Libraries.StringType color)
bool RectCollisCheckWithPieceRect (int col, int row, Libraries.Collision.RectCollision2D check)
bool CheckForPieceIntersection (Libraries.ScreenPicking.ScreenPicker picker3D, ref float dist, ref Point slot)
bool CheckIsValidPieceSlot (int col, int row)
virtual void StorePiece (BasePiece piece, int col, int row, bool settle)
void SetBoardDims (int numC, int numR)
void SetPieceOffset (Vector3 offset)
Vector3 GetPlayAreaRect ()
Vector3 GetPlayAreaRect (int numC, int numR)
Vector3 GetPieceWorldPos (int col, int row, Vector3 pieceDims)
Vector3 GetPieceWorldPos (int col, int row)
void SetAllowPieceItemUpdate (bool allow)
bool CheckIfSlotContainsPiece (int col, int row)
BasePiece GetPieceInSlot (int col, int row)
bool CheckForAllRemovals ()
void SetPieceWorldPos (BasePiece piece, int col, int row)
abstract void Update (int framesPassed, Libraries.AssetManager assetM)
virtual void HandleKeyboardInputDelegate (object message)
virtual void HandleGameMessageDelegate (object message)
abstract void Render (GraphicsDevice device)
void EmptyBoard ()
Point[] FindEmptyRowSlots (int row)
Point[] FindFilledRowSlots (int row)
int CountOpenRowSlots (int row)
bool FindPieceSlot (BasePiece piece, out int col, out int row)
Point GetPieceSlotForWorldCoord (Vector3 pos)
bool SettleAllColumns ()
Vector3 GetStartPos ()
Vector3 GetTopLeftPlayAreaPos ()
Point GetCurrentSelectionSlot ()
int GetNumPiecesStored ()

Static Public Member Functions

static Vector3 DeterminePlayAreaSize (int numR, int numC, Vector3 pieceDims)
static Vector3 GetPiecePos (int col, int row, Vector3 pieceDims)
static Vector3 DeterminePlayAreaSize (int numR, int numC, Vector3 pieceDims)
static Vector3 GetPiecePos (int col, int row, Vector3 pieceDims)

Static Public Attributes

static Libraries.StringType s_preventSettlePieces = new Libraries.StringType("PreventSettlePieces")
 Flag, means pieces should be prevented from settling.
static Libraries.StringType s_preventReceivePieces = new Libraries.StringType("PreventReceivePieces")
 Flag, means pieces can't be added to the player board at the current time.
static Libraries.StringType s_preventSwapPieces = new Libraries.StringType("PreventSwapPieces")
 Flag, means pieces can't be swapped on the player board at the current time.
static Libraries.StringType s_preventPostPieces = new Libraries.StringType("PreventPostPieces")
 Flag, means pieces can't be posted on the player board at the current time.
static Libraries.StringType s_preventOppPostPieces = new Libraries.StringType("PreventOppPostPieces")
 Flag, means pieces can't be posted by the opponent at the current time.
static Libraries.StringType s_preventItemTriggerFromUpdate = new Libraries.StringType("PreventItemTriggerFromUpdate")
 Flag, means items in pieces won't update there triggers, so they won't go off. If they are time based, their timers won't update.
static Libraries.StringType s_preventExpensesItemTriggerUpdate = new Libraries.StringType("PreventUnforseenItemTriggerFromUpdate")
 Flag, means unforseen expenses items in pieces won't update there triggers, so they won't go off. If they are time based, their timers won't update.
static Libraries.StringType s_paused = new Libraries.StringType("Paused")
 Flag, means the game should be paused. Updates shouldn't happen, messages shouldn't be handled. This should only be used with the pause menu.
static Libraries.StringType s_freeze = new Libraries.StringType("Freeze")
static Libraries.StringType s_preventPause = new Libraries.StringType("PreventPause")
 Flag, means the game isn't allowed to be paused.
static Libraries.StringType s_preventRumble = new Libraries.StringType("PreventRumble")
 Flag, means the game isn't allowed to run controller rumble.
static Libraries.StringType s_useDesktop = new Libraries.StringType("UseDesktop")
 Flag, means the desktop should be displayed if it is turned on in the options.

Protected Member Functions

bool MarkIfGrouped (int col, int row)
bool CheckForMatch (Libraries.StringType typeCheck, int indCheck)
void CreateBoardArray ()
void UpdatePieces (int timePassed, Libraries.AssetManager assetM)
void RenderPieces (GraphicsDevice device)
bool SettleColumn (int col, int bottomR)
bool MarkIfGrouped (int col, int row)
bool CheckForMatch (Libraries.StringType typeCheck, int indCheck)
void CreateBoardArray ()
void UpdatePieces (int timePassed, Libraries.AssetManager assetM)
void RenderPieces (GraphicsDevice device)
bool SettleColumn (int col, int bottomR)

Protected Attributes

bool m_allowPieceItemUpdate
 wether items in pieces are allowed to update. Value is true if they are, false if not.
BaseHighlighter m_selectionHighlighter
 Board selection highlighter.
PieceSwapper m_pieceSwapper
 Holds whatever manages swapping pieces in and out of the board. So user pulling pieces out and putting them in.

Properties

BasePiece[] GamePieces [get, set]

Private Member Functions

 ~BaseGameBoard ()
bool SettlePiece (int col, int row)
 ~BaseGameBoard ()
void SetColToRem (int col)
bool GetPiecePositionProperitesForSlot (int col, int row, ref Vector3 trans, ref Vector3 rot, ref Vector3 scale, bool isPiece3D)
bool SettlePiece (int col, int row)

Private Attributes

int m_numR
 Number of rows and columns in the board.
int m_numC
Vector3 m_startP
 The upper left pixel coord to start drawing the board pieces at.
Vector2 m_lastPlaced
BasePiece[] m_gamePieces
bool m_makeTopLeftPieceMatchBoardPos
Vector3 m_piecesOffset
 Stores a offet to apply to the board pieces. Can be used in combination with m_makeTopLeftPieceMatchBoardPos for more fine tuning.
Color[] m_pieceCollisionTextureData
 Texture data used to check for a collision with a piece. Check if a pixel is transparent or not. If not then it would be selected.
int m_pieceCollisionTextureWidth
int m_pieceCollisionTextureHeight

Detailed Description

Stores a game board. Holds all the pieces in the play field, handles placing a piece, checking for and doing removals, and all the other basic game logic involving pieces. Other game type boards should derive from this board, adding whatever else is needed.


Constructor & Destructor Documentation

TheForum.GameCode.BaseGameBoard.BaseGameBoard ( )

Default constructor.

TheForum.GameCode.BaseGameBoard.~BaseGameBoard ( ) [private]

Destructor. Frees all drawing arrays.

TheForum.GameCode.BaseGameBoard.BaseGameBoard ( )

Default constructor.

TheForum.GameCode.BaseGameBoard.~BaseGameBoard ( ) [private]

Destructor. Frees all drawing arrays.


Member Function Documentation

int TheForum.GameCode.BaseGameBoard.BoardSize ( )

Get the size of the board.

Return:
Value is the maximum number of pieces the board can hold, columns * rows.

int TheForum.GameCode.BaseGameBoard.BoardSize ( )

Get the size of the board.

Return:
Value is the maximum number of pieces the board can hold, columns * rows.

bool TheForum.GameCode.BaseGameBoard.CheckForAllRemovals ( )

Goes through all the pieces on the board, checking each piece to see if it should be part of a group. Pieces that should be in groups get marked as such.

Return:
Value is true if at least one group was found, false if not.

bool TheForum.GameCode.BaseGameBoard.CheckForAllRemovals ( )

Goes through all the pieces on the board, checking each piece to see if it should be part of a group. Pieces that should be in groups get marked as such.

Return:
Value is true if at least one group was found, false if not.

virtual bool TheForum.GameCode.BaseGameBoard.CheckForFlag ( Libraries.StringType  flag) [virtual]

Check for the given flag.

flag - Flag to check for.

Reimplemented in TheForum.GameCode.BasicGameBoard, and TheForum.GameCode.BasicGameBoard.

virtual bool TheForum.GameCode.BaseGameBoard.CheckForFlag ( Libraries.StringType  flag) [virtual]

Check for the given flag.

flag - Flag to check for.

Reimplemented in TheForum.GameCode.BasicGameBoard, and TheForum.GameCode.BasicGameBoard.

bool TheForum.GameCode.BaseGameBoard.CheckForMatch ( Libraries.StringType  typeCheck,
int  indCheck 
) [protected]

Checks to see if the given piece type matches the type stored at the given index. Handles range checking, so the index can be off the board and it doesn't matter.

typeCheck - Piece type to check for a match with.
indCheck - Index of the piece to check against. This is allowed to be an invalid index.

Return:
Value is true if the piece types match, false if the piece types don't match or the given index doesn't contain a piece or is out of range.
bool TheForum.GameCode.BaseGameBoard.CheckForMatch ( Libraries.StringType  typeCheck,
int  indCheck 
) [protected]

Checks to see if the given piece type matches the type stored at the given index. Handles range checking, so the index can be off the board and it doesn't matter.

typeCheck - Piece type to check for a match with.
indCheck - Index of the piece to check against. This is allowed to be an invalid index.

Return:
Value is true if the piece types match, false if the piece types don't match or the given index doesn't contain a piece or is out of range.
bool TheForum.GameCode.BaseGameBoard.CheckForPieceIntersection ( Libraries.ScreenPicking.ScreenPicker  picker3D,
ref float  dist,
ref Point  slot 
)

Using the given picker, check for intersection with the pieces on the board. Find the closest intersection, if any.

picker3D - 3D picker to to use. Should have already been setup with the screen coord and be ready to check with.
dist - Distance to the closest intersection. Default sets to 0.
slot - Stores the slot the intersection piece is in, if any. x == col, y == row.

Return:
Value is true if a interseciton occured, false if not.
bool TheForum.GameCode.BaseGameBoard.CheckForPieceIntersection ( Libraries.ScreenPicking.ScreenPicker  picker3D,
ref float  dist,
ref Point  slot 
)

Using the given picker, check for intersection with the pieces on the board. Find the closest intersection, if any.

picker3D - 3D picker to to use. Should have already been setup with the screen coord and be ready to check with.
dist - Distance to the closest intersection. Default sets to 0.
slot - Stores the slot the intersection piece is in, if any. x == col, y == row.

Return:
Value is true if a interseciton occured, false if not.
bool TheForum.GameCode.BaseGameBoard.CheckIfSlotContainsPiece ( int  col,
int  row 
)

Check if the given piece slot on the board contains a piece.

int col, row - Column and row to check on the board.

Return:
Value is true if the position contains a piece, false if not.
bool TheForum.GameCode.BaseGameBoard.CheckIfSlotContainsPiece ( int  col,
int  row 
)

Check if the given piece slot on the board contains a piece.

int col, row - Column and row to check on the board.

Return:
Value is true if the position contains a piece, false if not.
bool TheForum.GameCode.BaseGameBoard.CheckIsEmpty ( )

Checks if the board contains any pieces.

Return:
Value is true if the board doesn't contain any pieces, false if it does.

bool TheForum.GameCode.BaseGameBoard.CheckIsValidPieceSlot ( int  col,
int  row 
)

Check if the given piece slot on the board is a valid position.

col, row - Column and row to check.

Return:
Value is true if the position lies on the board, false if not.
bool TheForum.GameCode.BaseGameBoard.CheckIsValidPieceSlot ( int  col,
int  row 
)

Check if the given piece slot on the board is a valid position.

col, row - Column and row to check.


Return:
Value is true if the position lies on the board, false if not.
void TheForum.GameCode.BaseGameBoard.ClampPos ( ref int  col,
ref int  row 
)

Clamp the given board slot to valid ranges.

col, row - Column and row values to clamp. Will store the clamped values.
void TheForum.GameCode.BaseGameBoard.Clear ( )

Clears all allocations in the object. Resets stored values to the defaults.

void TheForum.GameCode.BaseGameBoard.Clear ( )

Clears all allocations in the object. Resets stored values to the defaults.

int TheForum.GameCode.BaseGameBoard.CountOpenRowSlots ( int  row)

Find out how many open slots are in specific row.

row - Row to check for slots.

Return:
Value is a array containing the locations of all open spaces in the row. It contains 0 entries if nothing is open.
int TheForum.GameCode.BaseGameBoard.CountOpenRowSlots ( int  row)

Find out how many open slots are in specific row.

row - Row to check for slots.

Return:
Value is a array containing the locations of all open spaces in the row. It contains 0 entries if nothing is open.
void TheForum.GameCode.BaseGameBoard.CreateBoardArray ( ) [protected]

Creates the array the board uses to store pieces. Size is based on the stored number of rows and columns.

Return:
Value is the array the board uses to store pieces.

void TheForum.GameCode.BaseGameBoard.CreateBoardArray ( ) [protected]

Creates the array the board uses to store pieces. Size is based on the stored number of rows and columns.

Return:
Value is the array the board uses to store pieces.

static Vector3 TheForum.GameCode.BaseGameBoard.DeterminePlayAreaSize ( int  numR,
int  numC,
Vector3  pieceDims 
) [static]

Gets the world size of the rectangle that would contain a board of the given size.

numR, numC - Number of rows and columns the board would be.
pieceDims - Dimensions of a game piece.

Return:
Value is the size of the rectangle that goes around the specified play area.
static Vector3 TheForum.GameCode.BaseGameBoard.DeterminePlayAreaSize ( int  numR,
int  numC,
Vector3  pieceDims 
) [static]

Gets the world size of the rectangle that would contain a board of the given size.

numR, numC - Number of rows and columns the board would be.
pieceDims - Dimensions of a game piece.

Return:
Value is the size of the rectangle that goes around the specified play area.
void TheForum.GameCode.BaseGameBoard.EmptyBoard ( )

Set all slots on the board to contain null.

void TheForum.GameCode.BaseGameBoard.EmptyBoard ( )

Set all slots on the board to contain null.

Point [] TheForum.GameCode.BaseGameBoard.FindEmptyRowSlots ( int  row)

Find all the open slots in a specific row.

row - Row to check for slots.

Return:
Value is a array containing the locations of all open spaces in the row. It contains 0 entries if nothing is open or it is a invalid row.
Point [] TheForum.GameCode.BaseGameBoard.FindEmptyRowSlots ( int  row)

Find all the open slots in a specific row.

row - Row to check for slots.

Return:
Value is a array containing the locations of all open spaces in the row. It contains 0 entries if nothing is open or it is a invalid row.
Point [] TheForum.GameCode.BaseGameBoard.FindFilledRowSlots ( int  row)

Find all the filled slots in a specific row.

row - Row to check for filled slots.

Return:
Value is a array containing the locations of all filled spaces in the row. It contains 0 entries if nothing is filled or it is a invalid row.
Point [] TheForum.GameCode.BaseGameBoard.FindFilledRowSlots ( int  row)

Find all the filled slots in a specific row.

row - Row to check for filled slots.

Return:
Value is a array containing the locations of all filled spaces in the row. It contains 0 entries if nothing is filled or it is a invalid row.
bool TheForum.GameCode.BaseGameBoard.FindPieceSlot ( BasePiece  piece,
out int  col,
out int  row 
)

Find the slot on the board that the given piece is stored at.

piece - Piece to find.
col, row - Used to store the column and row the piece is at. Values are -1 if piece not found.

Return:
Value is true if the piece was found, false if not.
bool TheForum.GameCode.BaseGameBoard.FindPieceSlot ( BasePiece  piece,
out int  col,
out int  row 
)

Find the slot on the board that the given piece is stored at.

piece - Piece to find.
col, row - Used to store the column and row the piece is at. Values are -1 if piece not found.

Return:
Value is true if the piece was found, false if not.
Point TheForum.GameCode.BaseGameBoard.GetCurrentSelectionSlot ( )

Get the current slot selected on the board. That is where piece swapping would occur.

Return:
Value is the board column and row the selector is at, (-1, -1) if the selector is not at a valid location.

Point TheForum.GameCode.BaseGameBoard.GetCurrentSelectionSlot ( )

Get the current slot selected on the board. That is where piece swapping would occur.

Return:
Value is the board column and row the selector is at, (-1, -1) if the selector is not at a valid location.

int TheForum.GameCode.BaseGameBoard.GetFillHeight ( )

Determine the highest row that has a piece in it.

Return:
Value is the highest row that has a piece in it. If no rows have pieces, then it returns -1.

int TheForum.GameCode.BaseGameBoard.GetNumCols ( )

Retrives the number of columns in the board.

Return:
Value is the number of columns.

int TheForum.GameCode.BaseGameBoard.GetNumCols ( )

Retrives the number of columns in the board.

Return:
Value is the number of columns.

int TheForum.GameCode.BaseGameBoard.GetNumGroupPieces ( )

Goes through all the pieces on the board and counts how many of them are tagged as being in groups.

Return:
Value is the number of pieces on the board that are marked as being in a group.

int TheForum.GameCode.BaseGameBoard.GetNumGroupPieces ( )

Goes through all the pieces on the board and counts how many of them are tagged as being in groups.

Return:
Value is the number of pieces on the board that are marked as being in a group.

int TheForum.GameCode.BaseGameBoard.GetNumPiecesStored ( )

Get the number of pieces stored in the board.

Return:
Value is the number of pieces stored in the board.

int TheForum.GameCode.BaseGameBoard.GetNumPiecesStored ( )

Get the number of pieces stored in the board.

Return:
Value is the number of pieces stored in the board.

int TheForum.GameCode.BaseGameBoard.GetNumRows ( )

Retrives the number of rows in the board.

Return:
Value is the number of columns.

int TheForum.GameCode.BaseGameBoard.GetNumRows ( )

Retrives the number of rows in the board.

Return:
Value is the number of columns.

Vector3 TheForum.GameCode.BaseGameBoard.GetPiece3DInitialScale ( )

Get the initial scale to use for pieces on the board.

Return:
Value is the array the board uses to store pieces.

BasePiece TheForum.GameCode.BaseGameBoard.GetPieceInSlot ( int  col,
int  row 
)

Get the piece stored in the given slot, if any.

int col, row - Column and row to get.

Return:
Value is the piece if there is one, null if not or if the position is invalid.
BasePiece TheForum.GameCode.BaseGameBoard.GetPieceInSlot ( int  col,
int  row 
)

Get the piece stored in the given slot, if any.

int col, row - Column and row to get.

Return:
Value is the piece if there is one, null if not or if the position is invalid.
static Vector3 TheForum.GameCode.BaseGameBoard.GetPiecePos ( int  col,
int  row,
Vector3  pieceDims 
) [static]

Get the position a piece would be placed at for the given row and column. This is not the actual world position of a piece, just the position in world space. Use the world position version to get that.

col, row - Row and column to the the piece position for.
pieceDims - Piece dimensions.

Return:
Value is the position the piece would go at.
static Vector3 TheForum.GameCode.BaseGameBoard.GetPiecePos ( int  col,
int  row,
Vector3  pieceDims 
) [static]

Get the position a piece would be placed at for the given row and column. This is not the actual world position of a piece, just the position in world space. Use the world position version to get that.

col, row - Row and column to the the piece position for.
pieceDims - Piece dimensions.

Return:
Value is the position the piece would go at.
bool TheForum.GameCode.BaseGameBoard.GetPiecePositionProperitesForSlot ( int  col,
int  row,
ref Vector3  trans,
ref Vector3  rot,
ref Vector3  scale,
bool  isPiece3D 
)

Calculate and retrive the position properties a piece at a given slot would use.

col, row - Location of the slot on the board to determine the properties for.
trans - Stores the translation to use for the piece.
rot - Stores the rotation to use.
scale - Stores the scale to use.
isPiece3D - True if it is a 3D piece, false if 2D.

Return:
Value is true if the piece slot was valid, false if not.
bool TheForum.GameCode.BaseGameBoard.GetPiecePositionProperitesForSlot ( int  col,
int  row,
ref Vector3  trans,
ref Vector3  rot,
ref Vector3  scale,
bool  isPiece3D 
) [private]

Calculate and retrive the position properties a piece at a given slot would use.

col, row - Location of the slot on the board to determine the properties for.
trans - Stores the translation to use for the piece.
rot - Stores the rotation to use.
scale - Stores the scale to use.
isPiece3D - True if it is a 3D piece, false if 2D.

Return:
Value is true if the piece slot was valid, false if not.
BasePiece [] TheForum.GameCode.BaseGameBoard.GetPiecesByItem ( Libraries.StringType  itemType)

Goes through all the pieces on the board, grabbing any that have the given item type and returns them. None of the pieces are removed from the board.

itemType - Type of item to find pieces with.

Return:
Value is a array that stores the pieces, null if no items of the specified types where found.
Point TheForum.GameCode.BaseGameBoard.GetPieceSlotForWorldCoord ( Vector3  pos)

Get the piece slot that the given world position would be in.

pos - World position to match up with a slot.

Return:
Value is (-1, -1) if the location was not in a piece slot, otherwise
Point TheForum.GameCode.BaseGameBoard.GetPieceSlotForWorldCoord ( Vector3  pos)

Get the piece slot that the given world position would be in.

pos - World position to match up with a slot.

Return:
Value is (-1, -1) if the location was not in a piece slot, otherwise
PieceSwapper TheForum.GameCode.BaseGameBoard.GetPieceSwapper ( )

Get the piece swapper the board is using.

Return:
Value is the piece swapper the board uses.

Vector3 TheForum.GameCode.BaseGameBoard.GetPieceWorldPos ( int  col,
int  row,
Vector3  pieceDims 
)

Get the world position a piece would be placed at for the given row and column.

col, row - Row and column to the the piece position for.
pieceDims - Piece dimensions.

Return:
Value is the position the piece would go at.
Vector3 TheForum.GameCode.BaseGameBoard.GetPieceWorldPos ( int  col,
int  row 
)

Get the world position a piece would be placed at for the given row and column.

col, row - Row and column to the the piece position for.

Return:
Value is the position the piece would go at.
Vector3 TheForum.GameCode.BaseGameBoard.GetPieceWorldPos ( int  col,
int  row,
Vector3  pieceDims 
)

Get the world position a piece would be placed at for the given row and column.

col, row - Row and column to the the piece position for.
pieceDims - Piece dimensions.

Return:
Value is the position the piece would go at.
Vector3 TheForum.GameCode.BaseGameBoard.GetPieceWorldPos ( int  col,
int  row 
)

Get the world position a piece would be placed at for the given row and column.

col, row - Row and column to the the piece position for.

Return:
Value is the position the piece would go at.
Vector3 TheForum.GameCode.BaseGameBoard.GetPlayAreaRect ( int  numC,
int  numR 
)

Gets the world size of the rectangle that would containt the pieces for a section of the board the given size.

numC, numR - Number of columns and rows.

Return:
Value is the size of the rectangle that goes around the play area.
Vector3 TheForum.GameCode.BaseGameBoard.GetPlayAreaRect ( int  numC,
int  numR 
)

Gets the world size of the rectangle that would containt the pieces for a section of the board the given size.

numC, numR - Number of columns and rows.

Return:
Value is the size of the rectangle that goes around the play area.
Vector3 TheForum.GameCode.BaseGameBoard.GetPlayAreaRect ( )

Gets the world size of the rectangle that contains the pieces in the board play area.

Return:
Value is the size of the rectangle that goes around the play area.

Vector3 TheForum.GameCode.BaseGameBoard.GetPlayAreaRect ( )

Gets the world size of the rectangle that contains the pieces in the board play area.

Return:
Value is the size of the rectangle that goes around the play area.

BasePiece [] TheForum.GameCode.BaseGameBoard.GetRemoveAllGroupPieces ( )

Goes through all the pieces on the board, removing any that have been tagged as being part of a group. The pieces are added to a array and returned.

Return:
Value is a array that stores the pieces removed, null if nothing was removed.

BasePiece [] TheForum.GameCode.BaseGameBoard.GetRemoveAllGroupPieces ( )

Goes through all the pieces on the board, removing any that have been tagged as being part of a group. The pieces are added to a array and returned.

Return:
Value is a array that stores the pieces removed, null if nothing was removed.

BasePiece [] TheForum.GameCode.BaseGameBoard.GetRemovePiecesByColor ( Libraries.StringType  color)

Goes through all the pieces on the board, removing any that are the given color. The pieces are added to a array and returned.

Return:
Value is a array that stores the pieces removed, null if nothing was removed.

BasePiece [] TheForum.GameCode.BaseGameBoard.GetRemovePiecesByColor ( Libraries.StringType  color)

Goes through all the pieces on the board, removing any that are the given color. The pieces are added to a array and returned.

Return:
Value is a array that stores the pieces removed, null if nothing was removed.

Vector3 TheForum.GameCode.BaseGameBoard.GetStartPos ( )

Get the start display position of the board.

Return:
Value is the starting display position of the board.

Vector3 TheForum.GameCode.BaseGameBoard.GetStartPos ( )

Get the start display position of the board.

Return:
Value is the starting display position of the board.

Vector3 TheForum.GameCode.BaseGameBoard.GetTopLeftPlayAreaPos ( )

Get the top left position of the play area.

Return:
Value is the top left position of the play area.

Vector3 TheForum.GameCode.BaseGameBoard.GetTopLeftPlayAreaPos ( )

Get the top left position of the play area.

Return:
Value is the top left position of the play area.

virtual void TheForum.GameCode.BaseGameBoard.HandleGameMessageDelegate ( object  message) [virtual]

Used for a delegate to handle a input messages.

message - Message to handle. Should be of type KeyboardInputMessage.

Reimplemented in TheForum.GameCode.BasicGameBoard, and TheForum.GameCode.BasicGameBoard.

virtual void TheForum.GameCode.BaseGameBoard.HandleGameMessageDelegate ( object  message) [virtual]

Used for a delegate to handle a input messages.

message - Message to handle. Should be of type KeyboardInputMessage.

Reimplemented in TheForum.GameCode.BasicGameBoard, and TheForum.GameCode.BasicGameBoard.

virtual void TheForum.GameCode.BaseGameBoard.HandleKeyboardInputDelegate ( object  message) [virtual]

Used for a delegate to handle a input messages.

message - Message to handle. Should be of type KeyboardInputMessage.
virtual void TheForum.GameCode.BaseGameBoard.HandleKeyboardInputDelegate ( object  message) [virtual]

Used for a delegate to handle a input messages.

message - Message to handle. Should be of type KeyboardInputMessage.
virtual void TheForum.GameCode.BaseGameBoard.Initialize ( ) [virtual]

Handles all initialization for the object. This is called on object creation. It sets all values to their defaults.

virtual void TheForum.GameCode.BaseGameBoard.Initialize ( ) [virtual]

Handles all initialization for the object. This is called on object creation. It sets all values to their defaults.

virtual void TheForum.GameCode.BaseGameBoard.Load ( Libraries.AssetManager  assetM) [virtual]

Load anything that needs to be loaded for the board. Assumes properties have already been set for what is needed with the board.

assetM - Asset manager to use.

Reimplemented in TheForum.GameCode.BasicGameBoard, and TheForum.GameCode.BasicGameBoard.

virtual void TheForum.GameCode.BaseGameBoard.Load ( Libraries.AssetManager  assetM) [virtual]

Load anything that needs to be loaded for the board. Assumes properties have already been set for what is needed with the board.

assetM - Asset manager to use.

Reimplemented in TheForum.GameCode.BasicGameBoard, and TheForum.GameCode.BasicGameBoard.

bool TheForum.GameCode.BaseGameBoard.MarkIfGrouped ( int  col,
int  row 
) [protected]

Checks the piece stored at the given index to see if it could be part of a group. If it is, then it gets tagged as being part of a group.

col, row - Piece slot on the board to check.

Return:
Value true if the piece is part of a group, false if not.
bool TheForum.GameCode.BaseGameBoard.MarkIfGrouped ( int  col,
int  row 
) [protected]

Checks the piece stored at the given index to see if it could be part of a group. If it is, then it gets tagged as being part of a group.

col, row - Piece slot on the board to check.

Return:
Value true if the piece is part of a group, false if not.
bool TheForum.GameCode.BaseGameBoard.RectCollisCheckWithPieceRect ( int  col,
int  row,
Libraries.Collision.RectCollision2D  check 
)

Performs a rectangle collision check with the game piece at a given slot location. A rectangle is placed around the piece.

col, row - Column and row of the piece to check.
check - Rectangle to check with.

Return:
Value is true if there was a collision, false if not or there was not piece in the given slot.
bool TheForum.GameCode.BaseGameBoard.RectCollisCheckWithPieceRect ( int  col,
int  row,
Libraries.Collision.RectCollision2D  check 
)

Performs a rectangle collision check with the game piece at a given slot location. A rectangle is placed around the piece.

col, row - Column and row of the piece to check.
check - Rectangle to check with.

Return:
Value is true if there was a collision, false if not or there was not piece in the given slot.
int TheForum.GameCode.BaseGameBoard.RemoveAllGroupPieces ( )

Goes through all the pieces on the board, removing any that have been tagged as being part of a group.

Return:
Value is the number of pieces removed from the board. 0 if no pieces were removed.

int TheForum.GameCode.BaseGameBoard.RemoveAllGroupPieces ( )

Goes through all the pieces on the board, removing any that have been tagged as being part of a group.

Return:
Value is the number of pieces removed from the board. 0 if no pieces were removed.

void TheForum.GameCode.BaseGameBoard.RemoveAllPieces ( )

Goes through all the pieces on the board, removing all pieces.

abstract void TheForum.GameCode.BaseGameBoard.Render ( GraphicsDevice  device) [pure virtual]
abstract void TheForum.GameCode.BaseGameBoard.Render ( GraphicsDevice  device) [pure virtual]
void TheForum.GameCode.BaseGameBoard.RenderPieces ( GraphicsDevice  device) [protected]

Call render on all pieces in the board.

device - Device to render the piece with.
void TheForum.GameCode.BaseGameBoard.RenderPieces ( GraphicsDevice  device) [protected]

Call render on all pieces in the board.

device - Device to render the piece with.
void TheForum.GameCode.BaseGameBoard.SetAllowPieceItemUpdate ( bool  allow)

Set wether items in pieces are allowed to update.

allow - Value is true if items in pieces are allowed to update, false if not. Value is the position the piece would go at.
void TheForum.GameCode.BaseGameBoard.SetAllowPieceItemUpdate ( bool  allow)

Set wether items in pieces are allowed to update.

allow - Value is true if items in pieces are allowed to update, false if not. Value is the position the piece would go at.
void TheForum.GameCode.BaseGameBoard.SetBoardDims ( int  numC,
int  numR 
)

Sets the board dimensions. Anything on the board gets wiped out. Dimensions should be at least 1,1.

numC, numR - Number of columns and rows the board has.
void TheForum.GameCode.BaseGameBoard.SetBoardDims ( int  numC,
int  numR 
)

Sets the board dimensions. Anything on the board gets wiped out. Dimensions should be at least 1,1.

numC, numR - Number of columns and rows the board has.
void TheForum.GameCode.BaseGameBoard.SetColToRem ( int  col) [private]

Sets the removal flag for all objects stored in the given column to be removed.

col - The column to set.
void TheForum.GameCode.BaseGameBoard.SetPieceOffset ( Vector3  offset)

Set the offset amount used when figuring out where pieces are places. The final position is offset by this amount. Use to fine tune the positioning.

offset - Offset to use.
void TheForum.GameCode.BaseGameBoard.SetPieceOffset ( Vector3  offset)

Set the offset amount used when figuring out where pieces are places. The final position is offset by this amount. Use to fine tune the positioning.

offset - Offset to use.
void TheForum.GameCode.BaseGameBoard.SetPieceWorldPos ( BasePiece  piece,
int  col,
int  row 
)

Sets the given piece with the correct world position based on its row and column position in the board. Sets rotation and scale as well to what they should be for the world at that point. If the piece is null, then nothing happens.

Parameters:
piece- Piece to set.
col,row- Column and row the piece should be at on the board.
void TheForum.GameCode.BaseGameBoard.SetPieceWorldPos ( BasePiece  piece,
int  col,
int  row 
)

Sets the given piece with the correct world position based on its row and column position in the board. Sets rotation and scale as well to what they should be for the world at that point. If the piece is null, then nothing happens.

Parameters:
piece- Piece to set.
col,row- Column and row the piece should be at on the board.
void TheForum.GameCode.BaseGameBoard.SetPieceWorldPosOnly ( BasePiece  piece,
int  col,
int  row 
)

Sets the given piece with the correct world position based on its row and column position in the board. Does not set rotation or scale. If the piece is null, then nothing happens.

Parameters:
piece- Piece to set.
col,row- Column and row the piece should be at on the board.
bool TheForum.GameCode.BaseGameBoard.SettleAllColumns ( )

Go through all the columns on the board and settles them. This means any piece that has empty space under it gets dropped down.



Return:
Value is true if any of the columns had settling, false if not.
bool TheForum.GameCode.BaseGameBoard.SettleAllColumns ( )

Go through all the columns on the board and settles them. This means any piece that has empty space under it gets dropped down.



Return:
Value is true if any of the columns had settling, false if not.
bool TheForum.GameCode.BaseGameBoard.SettleColumn ( int  col,
int  bottomR 
) [protected]

Settles all the pieces in the column. This means that if any pieces are floating in the air, they drop down till they settle against against a lower piece. This removes all holes in the column. No links are checked for, so the caller has to handle that.

col - Column to settle.
bottomR - The row that is considered the bottom where the shift should stop.
Return
Value is true if any settling occured, false if not.
bool TheForum.GameCode.BaseGameBoard.SettleColumn ( int  col,
int  bottomR 
) [protected]

Settles all the pieces in the column. This means that if any pieces are floating in the air, they drop down till they settle against against a lower piece. This removes all holes in the column. No links are checked for, so the caller has to handle that.

col - Column to settle.
bottomR - The row that is considered the bottom where the shift should stop.

Return:
Value is true if any settling occured, false if not.
bool TheForum.GameCode.BaseGameBoard.SettlePiece ( int  col,
int  row 
) [private]

Settles the piece in the given location on the board. This means that if the piece is floating in the air, it drops down till it settles against against a lower piece. This removes all holes in the column. No links are checked for, so the caller has to handle that.

col, row - Location of the piece on the board to settle.
Return
Value is true if any settling occured, false if not.
bool TheForum.GameCode.BaseGameBoard.SettlePiece ( int  col,
int  row 
) [private]

Settles the piece in the given location on the board. This means that if the piece is floating in the air, it drops down till it settles against against a lower piece. This removes all holes in the column. No links are checked for, so the caller has to handle that.

col, row - Location of the piece on the board to settle.

Return
Value is true if any settling occured, false if not.
virtual void TheForum.GameCode.BaseGameBoard.Setup ( Libraries.AssetManager  assetM) [virtual]
virtual void TheForum.GameCode.BaseGameBoard.Setup ( Libraries.AssetManager  assetM,
Libraries.StringType  posterID 
) [virtual]

Create everything the board needs.

assetM - Asset manager to use.
posterID - ID of the poster the board is for.

Reimplemented in TheForum.GameCode.BasicGameBoard.

void TheForum.GameCode.BaseGameBoard.SetUpperLeftPos ( float  startX,
float  startY,
float  startZ 
)

Stores the upper left pixel coord to start drawing board pieces at. The board pieces are assumed to be flat in the z plane.

startX - X coord.
startY - Y coord.
startZ - Z coord.
void TheForum.GameCode.BaseGameBoard.SetUpperLeftPos ( float  startX,
float  startY,
float  startZ 
)

Stores the upper left pixel coord to start drawing board pieces at. The board pieces are assumed to be flat in the z plane. If there are pieces stored, they will have their positions changed based on the new top left position.

startX - X coord.
startY - Y coord.
startZ - Z coord.
virtual void TheForum.GameCode.BaseGameBoard.StorePiece ( BasePiece  piece,
int  col,
int  row,
bool  settle 
) [virtual]

Stores the given piece at the given board index. If the piece is null, then the slot just gets set to null. Sets the piece to have the correct pixel display position, and to be in use. If a piece is already stored in the slot, then that piece gets reinserted into the manager.

piece - Piece to store.
col, row - Column and row the piece gets stored at in the board.
settle - wether you want the piece to drop down until it hits something and can't drop anymore. Pass true if it should drop, false if not.
virtual void TheForum.GameCode.BaseGameBoard.StorePiece ( BasePiece  piece,
int  col,
int  row,
bool  settle 
) [virtual]

Stores the given piece at the given board index. If the piece is null, then the slot just gets set to null. Sets the piece to have the correct pixel display position, and to be in use. If a piece is already stored in the slot, then that piece gets reinserted into the manager.

piece - Piece to store.
col, row - Column and row the piece gets stored at in the board.
settle - wether you want the piece to drop down until it hits something and can't drop anymore. Pass true if it should drop, false if not.
abstract void TheForum.GameCode.BaseGameBoard.Update ( int  framesPassed,
Libraries.AssetManager  assetM 
) [pure virtual]

Update the piece.

framesPassed - How long has passed since the previous update.
assetM - Asset manager to use as needed.

Implemented in TheForum.GameCode.BackgroundBoard, TheForum.GameCode.BasicGameBoard, TheForum.GameCode.PieceDisplayBoard, TheForum.GameCode.BackgroundBoard, TheForum.GameCode.BasicGameBoard, and TheForum.GameCode.PieceDisplayBoard.

abstract void TheForum.GameCode.BaseGameBoard.Update ( int  framesPassed,
Libraries.AssetManager  assetM 
) [pure virtual]

Update the piece.

framesPassed - How long has passed since the previous update.
assetM - Asset manager to use as needed.

Implemented in TheForum.GameCode.BackgroundBoard, TheForum.GameCode.BasicGameBoard, TheForum.GameCode.PieceDisplayBoard, TheForum.GameCode.BackgroundBoard, TheForum.GameCode.BasicGameBoard, and TheForum.GameCode.PieceDisplayBoard.

void TheForum.GameCode.BaseGameBoard.UpdatePieces ( int  timePassed,
Libraries.AssetManager  assetM 
) [protected]

Call update on all pieces in the board.

timePassed - How long has passed since the previous update.
assetM - Asset manager to use.
void TheForum.GameCode.BaseGameBoard.UpdatePieces ( int  timePassed,
Libraries.AssetManager  assetM 
) [protected]

Call update on all pieces in the board.

timePassed - How long has passed since the previous update.
assetM - Asset manager to use.

Member Data Documentation

wether items in pieces are allowed to update. Value is true if they are, false if not.

Stores all the pieces on the board. The array should be of size m_numRows * m_numCols. Index 0 would be row 0 column 0, index 1 would be row 0 column 1, etc. The upper left index is (0), while the lower right (is m_numRows * m_numCols - 1). Each piece entry must be deleted.

Stores the x,y board coordinate of the last piece that was placed on the board. This is used to check the location for groups. After the coordinate has been used, it gets set to -1,-1 to show that no last piece location is still stored.

Set wether the top left corner of the top left piece should be at the board position. Used for easier formatting with other things. Set to true if it should, false if not.

Set wiether the top left corner of the top left piece should be at the board position. Used for easier formatting with other things. Set to true if it should, false if not.

Number of rows and columns in the board.

Texture data used to check for a collision with a piece. Check if a pixel is transparent or not. If not then it would be selected.

Stores a offet to apply to the board pieces. Can be used in combination with m_makeTopLeftPieceMatchBoardPos for more fine tuning.

Holds whatever manages swapping pieces in and out of the board. So user pulling pieces out and putting them in.

Board selection highlighter.

The upper left pixel coord to start drawing the board pieces at.

Flag, means the game should be frozen. Updates shouldn't happen, messages shouldn't be handled. This should not be used for pausing. Use it if you want the game to freeze and still allow the pause menu to be used.

Flag, means the game should be paused. Updates shouldn't happen, messages shouldn't be handled. This should only be used with the pause menu.

Flag, means unforseen expenses items in pieces won't update there triggers, so they won't go off. If they are time based, their timers won't update.

Flag, means items in pieces won't update there triggers, so they won't go off. If they are time based, their timers won't update.

Flag, means pieces can't be posted by the opponent at the current time.

Flag, means the game isn't allowed to be paused.

Flag, means pieces can't be posted on the player board at the current time.

static Libraries StringType TheForum::GameCode.BaseGameBoard::s_preventReceivePieces = new Libraries.StringType("PreventReceivePieces") [static]

Flag, means pieces can't be added to the player board at the current time.

Flag, means the game isn't allowed to run controller rumble.

static Libraries StringType TheForum::GameCode.BaseGameBoard::s_preventSettlePieces = new Libraries.StringType("PreventSettlePieces") [static]

Flag, means pieces should be prevented from settling.

Flag, means pieces can't be swapped on the player board at the current time.

Flag, means the desktop should be displayed if it is turned on in the options.


Property Documentation

BasePiece [] TheForum.GameCode.BaseGameBoard.GamePieces [get, set]

Getter/setter for the array that contains all the game pieces.

Return:
Value is the array the board uses to store pieces.

Getter/setter for the array that contains all the game pieces.

Return:
Value is the array the board uses to store pieces.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Enumerations Properties