C#Code
C#Code
Public Member Functions | Public Attributes | Protected Attributes | Properties | Private Member Functions | Private Attributes
TheForum.GameCode.BasePiece Class Reference

List of all members.

Public Member Functions

 BasePiece ()
 BasePiece (Libraries.StringType hexType)
void SetType (Libraries.StringType hexType)
void Reset ()
void Update (int framesPassed, GameCode.BaseGameBoard board, Libraries.AssetManager assetM)
void UpdatePieceSprite (int timePassed, Libraries.AssetManager assetM)
void Render (GraphicsDevice device)
void SetItem (GameCode.Items.BasePieceItem item)
void RemoveItem ()
Items.BasePieceItem GetItem ()
void SetColorChangeAllowed (bool allow)
bool GetColorChangeAllowed ()
bool IsSwapAllowed ()
bool GetIsPiece3D ()
void SetIsPiece3D (bool is3D)
void HandleSwapOccured (int col, int row)
void HandlePosted ()
BaseObj3D GetObj3D ()
Libraries.StringType GetDropSoundID ()
Libraries.StringType GetPickUpSoundID ()
void SetSounds (String pickUpSoundID, String dropSoundID)
 BasePiece ()
 BasePiece (Libraries.StringType hexType)
void SetType (Libraries.StringType hexType)
void Reset ()
void Update (int framesPassed, GameCode.BaseGameBoard board, Libraries.AssetManager assetM)
void UpdatePieceSprite (int framesPassed, Libraries.AssetManager assetM)
void Render (GraphicsDevice device)
void SetItem (GameCode.Items.BasePieceItem item)
void SetColorChangeAllowed (bool allow)
bool GetColorChangeAllowed ()
bool IsSwapAllowed ()
bool GetIsPiece3D ()
void SetIsPiece3D (bool is3D)
void HandleSwapOccured (int col, int row)
void HandlePosted ()
BaseObj3D GetObj3D ()

Public Attributes

Libraries.StringType m_hexType
 Represents what type of piece it is.
byte m_linkData

Protected Attributes

BaseModel m_sprite
 Store the sprite that will display the piece.
GameCode.Items.BasePieceItem m_item
 Item attached to the piece, if any.

Properties

BaseModel Sprite [get, set]
Vector3 Position [get, set]
Vector3 Scale [get, set]
Vector3 Rotation [get, set]

Private Member Functions

 ~BasePiece ()
 ~BasePiece ()

Private Attributes

bool m_colorChangeAllowed
 wether the pieces color type is allowed to be changed. True if it is, false if not.
Vector3 m_pos
 Display coordinate for the piece.
Vector3 m_scale
 Display scale for the piece.
Vector3 m_rot
 Display rotation for the piece.
bool m_allowSwap
bool m_isPiece3D
 wether the piece is a 3D or 2D piece. Value is true if 3D, false if 2D.
Libraries.StringType m_pickupSoundDefault
 Default sound to play if the piece is picked up and the item doesn't have a sound.
Libraries.StringType m_dropSoundDefault
 Default sound to play if the piece is dropped and the item doesn't have a sound.

Detailed Description

Base piece class. Derive all game pieces from this.


Constructor & Destructor Documentation

TheForum.GameCode.BasePiece.BasePiece ( )

Default constructor.

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

Destructor.

TheForum.GameCode.BasePiece.BasePiece ( Libraries.StringType  hexType)

Constructor. Sets the hex type from the get go.

Parameters:
hexType- Type to store for the piece.
TheForum.GameCode.BasePiece.BasePiece ( )

Default constructor.

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

Destructor.

TheForum.GameCode.BasePiece.BasePiece ( Libraries.StringType  hexType)

Constructor. Sets the hex type from the get go.

Parameters:
hexType- Type to store for the piece.

Member Function Documentation

bool TheForum.GameCode.BasePiece.GetColorChangeAllowed ( )

Get wether the piece is allowed to have its color type changed.

Return:
Value is true if it is, false if not.

bool TheForum.GameCode.BasePiece.GetColorChangeAllowed ( )

Get wether the piece is allowed to have its color type changed.

Return:
Value is true if it is, false if not.

Libraries.StringType TheForum.GameCode.BasePiece.GetDropSoundID ( )

Get the ID of the sound to play when dropping the piece. Will be the sound from item if item is stored, otherwise the default piece sound.

bool TheForum.GameCode.BasePiece.GetIsPiece3D ( )

Get wether the piece is 3D piece or 2D.

Return:
Value is true if the piece is 3D, false if 2D.

bool TheForum.GameCode.BasePiece.GetIsPiece3D ( )

Get wether the piece is 3D piece or 2D.

Return:
Value is true if the piece is 3D, false if 2D.

Items.BasePieceItem TheForum.GameCode.BasePiece.GetItem ( )

Retrive the item stored in the piece, if any.

Return:
Value is the item stored in the piece, null if not item is stored.

BaseObj3D TheForum.GameCode.BasePiece.GetObj3D ( )

Get the 3D object stored in the piece.

Return:
Value is the 3D object that displays the piece.

BaseObj3D TheForum.GameCode.BasePiece.GetObj3D ( )

Get the 3D object stored in the piece.

Return:
Value is the 3D object that displays the piece.

Libraries.StringType TheForum.GameCode.BasePiece.GetPickUpSoundID ( )

Get the ID of the sound to play when picking up the piece. Will be the sound from item if item is stored, otherwise the default piece sound.

void TheForum.GameCode.BasePiece.HandlePosted ( )

Handle any special stuff needed for the piece posted. Notify items, etc.

piece - Piece the item is in.
void TheForum.GameCode.BasePiece.HandlePosted ( )

Handle any special stuff needed for the piece posted. Notify items, etc.

piece - Piece the item is in.
void TheForum.GameCode.BasePiece.HandleSwapOccured ( int  col,
int  row 
)

Handle any special stuff needed for the piece being swapped. Notify items, etc.

col, row - Column and row that the piece was at on the board.
void TheForum.GameCode.BasePiece.HandleSwapOccured ( int  col,
int  row 
)

Handle any special stuff needed for the piece being swapped. Notify items, etc.

col, row - Column and row that the piece was at on the board.
bool TheForum.GameCode.BasePiece.IsSwapAllowed ( )

Get wether the piece is allowed to be swapped into/out of the board.

Return:
Value is true if it is allowed to be swapped, false if not.

bool TheForum.GameCode.BasePiece.IsSwapAllowed ( )

Get wether the piece is allowed to be swapped into/out of the board.

Return:
Value is true if it is allowed to be swapped, false if not.

void TheForum.GameCode.BasePiece.RemoveItem ( )

Remove any item attached to the piece.

void TheForum.GameCode.BasePiece.Render ( GraphicsDevice  device)

Render the piece.

device - Device to render the piece with.
void TheForum.GameCode.BasePiece.Render ( GraphicsDevice  device)

Render the piece.

device - Device to render the piece with.
void TheForum.GameCode.BasePiece.Reset ( )

Sets the piece to unused values.

void TheForum.GameCode.BasePiece.Reset ( )

Sets the piece to unused values.

void TheForum.GameCode.BasePiece.SetColorChangeAllowed ( bool  allow)

Set wether the piece is allowed to have its color type changed. Pass true if it is, false if not.

void TheForum.GameCode.BasePiece.SetColorChangeAllowed ( bool  allow)

Set wether the piece is allowed to have its color type changed. Pass true if it is, false if not.

void TheForum.GameCode.BasePiece.SetIsPiece3D ( bool  is3D)

Set wether the piece is 3D piece or 2D.

is3D - Value is true if the piece is 3D, false if 2D.
void TheForum.GameCode.BasePiece.SetIsPiece3D ( bool  is3D)

Set wether the piece is 3D piece or 2D.

is3D - Value is true if the piece is 3D, false if 2D.
void TheForum.GameCode.BasePiece.SetItem ( GameCode.Items.BasePieceItem  item)

Store the given item in the piece.

void TheForum.GameCode.BasePiece.SetItem ( GameCode.Items.BasePieceItem  item)

Store the given item in the piece.

void TheForum.GameCode.BasePiece.SetSounds ( String  pickUpSoundID,
String  dropSoundID 
)

Sets the default sounds to use if no item is set for sounds.

pickUpSoundID - What to play when the piece is picked up from the board.
dropSoundID - What to play when the piece is dropped onto the board.
pieceDims - Dimensions of the piece in world space.

Return:
Value is a clone of the stored string that represents the deffintion type, null if not set.
void TheForum.GameCode.BasePiece.SetType ( Libraries.StringType  hexType)

Sets the piece type to the given type. Resets Link data as well.

void TheForum.GameCode.BasePiece.SetType ( Libraries.StringType  hexType)

Sets the piece type to the given type. Resets Link data as well.

hexType - Type to be.
void TheForum.GameCode.BasePiece.Update ( int  framesPassed,
GameCode.BaseGameBoard  board,
Libraries.AssetManager  assetM 
)

Update the piece.

framesPassed - How long has passed since the previous update.
board - Board the piece is on. Pass null if not needed.
assetM - Asset manager to use as needed.
void TheForum.GameCode.BasePiece.Update ( int  framesPassed,
GameCode.BaseGameBoard  board,
Libraries.AssetManager  assetM 
)

Update the piece.

framesPassed - How long has passed since the previous update.
board - Board the piece is on. Pass null if not needed.
assetM - Asset manager to use as needed.
void TheForum.GameCode.BasePiece.UpdatePieceSprite ( int  timePassed,
Libraries.AssetManager  assetM 
)

Update the piece sprite only, not the item or the piece itself.

timePassed - How long the update is for.
assetM - Asset manager to use.
void TheForum.GameCode.BasePiece.UpdatePieceSprite ( int  framesPassed,
Libraries.AssetManager  assetM 
)

Update the piece sprite only, not the item or the piece itself.

device - Device to render the piece with.

Member Data Documentation

wether the piece itself is allowed to be swapped. Value is true if it is, false if not. This is not the end all be all. A item present in the piece might not allow it to be swapped either.

wether the pieces color type is allowed to be changed. True if it is, false if not.

Default sound to play if the piece is dropped and the item doesn't have a sound.

Represents what type of piece it is.

wether the piece is a 3D or 2D piece. Value is true if 3D, false if 2D.

GameCode Items BasePieceItem TheForum::GameCode.BasePiece::m_item [protected]

Item attached to the piece, if any.

Used to store data for determining if the piece is part of a group that should be removed. The first six bits correspond with the six faces of the piece. If the bit is set, it means the game piece touching that face maches the piece. The last bit represents wether the piecewas checked and should be removed. If the bit is set, then the piece should be removed. The first bit matches up with the upper left side of the hexagon. The second bit is the top, and so on.

Default sound to play if the piece is picked up and the item doesn't have a sound.

Display coordinate for the piece.

Display rotation for the piece.

Display scale for the piece.

Store the sprite that will display the piece.


Property Documentation

Vector3 TheForum::GameCode.BasePiece::Position [get, set]

Getter/Setter for the piece position.

Vector3 TheForum.GameCode.BasePiece.Rotation [get, set]

Getter/Setter for the piece rotation.

Vector3 TheForum::GameCode.BasePiece::Scale [get, set]

Getter/Setter for the piece scale.

BaseModel TheForum::GameCode.BasePiece::Sprite [get, set]

Getter/Setter for the sprite used to display the piece.


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