C#Code
C#Code
Classes | Public Member Functions | Static Public Attributes | Protected Attributes | Private Member Functions | Private Attributes
TheForum.GameCode.PieceDefinition Class Reference
Inheritance diagram for TheForum.GameCode.PieceDefinition:
TheForum.GameCode.BasicPieceDeff TheForum.GameCode.BasicPieceDeff TheForum.GameCode.Items.AccountantItemDeff TheForum.GameCode.Items.BandwagonItemDeff TheForum.GameCode.Items.BandwagonItemDeff TheForum.GameCode.Items.ExpensesItemDeff TheForum.GameCode.Items.FrogItemDeff TheForum.GameCode.Items.FrogItemDeff TheForum.GameCode.Items.MoneyItemDeff TheForum.GameCode.Items.ProbationItemDeff TheForum.GameCode.Items.ProbationItemDeff TheForum.GameCode.Items.TaxFraudItemDeff TheForum.GameCode.Items.UnknownItemDeff TheForum.GameCode.Items.WordsItemDeff TheForum.GameCode.Items.WordsItemDeff

List of all members.

Classes

class  PieceColorDeff

Public Member Functions

 PieceDefinition ()
void SetType (string type)
bool CheckType (StringType check)
bool CheckType (PieceDefinition check)
StringType GetTypeString ()
void SetSounds (String pickUpSoundID, String dropSoundID)
StringType GetDropSoundID ()
StringType GetPickUpSoundID ()
BasePiece CreateBasicPiece3D (Libraries.StringType type, string textureName, AssetManager assetM, Vector3 pieceDims, StringType shaderID)
Libraries._3D.BaseModel Create3DPieceModel (Libraries.StringType type, string textureName, AssetManager assetM, Vector3 pieceDims, StringType shaderID)
StringType GetTexPathForID (Libraries.StringType ID)
virtual BasePiece Generate (AssetManager assetM, Vector3 pieceDims)
virtual BasePiece Generate (AssetManager assetM, string color, Vector3 pieceDims)
virtual BasePiece Generate (AssetManager assetM, string color, Vector3 pieceDims, StringType shaderUse)
void ChangeToType (BasePiece piece, AssetManager assetM)
 PieceDefinition ()
void SetType (string type)
bool CheckType (StringType check)
bool CheckType (PieceDefinition check)
StringType GetTypeString ()
virtual BasePiece Generate (AssetManager assetM, Vector3 pieceDims)
virtual BasePiece Generate (AssetManager assetM, string color, Vector3 pieceDims)
void ChangeToType (BasePiece piece, AssetManager assetM)

Static Public Attributes

static readonly PieceColorDeff s_redPiece = new PieceColorDeff("RED_PIECE", "Art/PieceAssets/red_border_hex")
 Represents the different types of colors.
static readonly PieceColorDeff s_whitePiece = new PieceColorDeff("WHITE_PIECE", "Art/PieceAssets/white_border_hex")
static readonly PieceColorDeff s_blackPiece = new PieceColorDeff("BLACK_PIECE", "Art/PieceAssets/black_border_hex")
static readonly PieceColorDeff s_lightBluePiece = new PieceColorDeff("LIGHT_BLUE_PIECE", "Art/PieceAssets/light_blue_border_hex")
static readonly PieceColorDeff s_darkBluePiece = new PieceColorDeff("DARK_BLUE_PIECE", "Art/PieceAssets/dark_blue_border_hex")
static readonly PieceColorDeff s_greenPiece = new PieceColorDeff("GREEN_PIECE", "Art/PieceAssets/green_border_hex")
static readonly PieceColorDeff s_orangePiece = new PieceColorDeff("ORANGE_PIECE", "Art/PieceAssets/orange_border_hex")
static readonly PieceColorDeff s_yellowPiece = new PieceColorDeff("YELLOW_PIECE", "Art/PieceAssets/yellow_border_hex")

Protected Attributes

Libraries.StringType m_defaultShaderID
 The default shader to use when creating the piece.

Private Member Functions

VertexPositionNormalTexture[] CreateVertexQuad (Vector2 textureTL, Vector2 textureBR, Vector3 pieceDims)
VertexPositionNormalTexture[] CreateVertexQuad (Vector2 textureTL, Vector2 textureBR, Vector3 pieceDims)
BasePiece CreateBasicPiece (Libraries.StringType type, string textureName, AssetManager assetM, Vector3 pieceDims)
BasePiece CreateBasicPiece3D (Libraries.StringType type, string textureName, AssetManager assetM, Vector3 pieceDims)

Private Attributes

StringType m_type
 String that repesents the definition.
StringType m_pickUpSoundID
 ID of the sound to play when a piece is picked up on the the board.
StringType m_dropSoundID
 ID of the sound to play when a piece is dropped on the board.
List< PieceColorDeffm_colors
 Valid colors. Add colors you want to represent by type to this.

Detailed Description

Handle creating a specific piece type. It gets set with properties that the piece would use and creates it. THIS IS PROBALY SOMETHING I WOULD WANT TO HAVE RUN A SCRIPT AND SET PROPERTIES.

Handle createing a specific piece type. It gets set with properties that the piece would use and creates it. THIS IS PROBALY SOMETHING I WOULD WANT TO HAVE RUN A SCRIPT AND SET PROPERTIES.


Constructor & Destructor Documentation

TheForum.GameCode.PieceDefinition.PieceDefinition ( )

Default constructor.

TheForum.GameCode.PieceDefinition.PieceDefinition ( )

Default constructor.


Member Function Documentation

void TheForum.GameCode.PieceDefinition.ChangeToType ( BasePiece  piece,
AssetManager  assetM 
)

Change the given piece type to the type in the definition. Changes the texture and the type.

piece - Piece to change.
assetM - Asset manager to use.
void TheForum.GameCode.PieceDefinition.ChangeToType ( BasePiece  piece,
AssetManager  assetM 
)

Change the given piece type to the type in the definition. Changes the texture and the type.

piece - Piece to change.
assetM - Asset manager to use.
bool TheForum.GameCode.PieceDefinition.CheckType ( StringType  check)

Check if the given string matches the type stored in the definition. Returns true if it does, false if not.

check - String to check againt.
bool TheForum.GameCode.PieceDefinition.CheckType ( PieceDefinition  check)

Check if the piece deffinition has the same type.

check - Piece deffinition to check againt.
bool TheForum.GameCode.PieceDefinition.CheckType ( StringType  check)

Check if the given string matches the type stored in the definition. Returns true if it does, false if not.

check - String to check againt.
bool TheForum.GameCode.PieceDefinition.CheckType ( PieceDefinition  check)

Check if the piece deffinition has the same type.

check - Piece deffinition to check againt.
Libraries._3D.BaseModel TheForum.GameCode.PieceDefinition.Create3DPieceModel ( Libraries.StringType  type,
string  textureName,
AssetManager  assetM,
Vector3  pieceDims,
StringType  shaderID 
)

Creates one of the basic 3D piece types. This will be replaced when I get in the scripting definitions for pieces.

type - Type of piece to create.
textureName - Texture to load/use.
assetM - Asset manager to use for the texture.
pieceDims - Dimensions of the piece in world space.
shaderID - ID of the shader to use for the piece.

Return:
Value is the generated piece. It is null if the piece could not be created.
BasePiece TheForum.GameCode.PieceDefinition.CreateBasicPiece ( Libraries.StringType  type,
string  textureName,
AssetManager  assetM,
Vector3  pieceDims 
) [private]

Temp function. Creates one of the basic piece types. This will be replaces when I get in the scripting definitions for pieces.

type - Type of piece to create.
textureName - Texture to load/use.
assetM - Asset manager to use for the texture.
pieceDims - Dimensions of the piece in world space.

Return:
Value is the generated piece. It is null if the piece could not be created.
BasePiece TheForum.GameCode.PieceDefinition.CreateBasicPiece3D ( Libraries.StringType  type,
string  textureName,
AssetManager  assetM,
Vector3  pieceDims,
StringType  shaderID 
)

Temp function. Creates one of the basic 3D piece types. This will be replaced when I get in the scripting definitions for pieces.

type - Type of piece to create.
textureName - Texture to load/use.
assetM - Asset manager to use for the texture.
pieceDims - Dimensions of the piece in world space.
shaderID of the shader to use for the piece.

Return:
Value is the generated piece. It is null if the piece could not be created.
BasePiece TheForum.GameCode.PieceDefinition.CreateBasicPiece3D ( Libraries.StringType  type,
string  textureName,
AssetManager  assetM,
Vector3  pieceDims 
) [private]

Temp function. Creates one of the basic 3D piece types. This will be replaced when I get in the scripting definitions for pieces.

type - Type of piece to create.
textureName - Texture to load/use.
assetM - Asset manager to use for the texture.
pieceDims - Dimensions of the piece in world space.

Return:
Value is the generated piece. It is null if the piece could not be created.
VertexPositionNormalTexture [] TheForum.GameCode.PieceDefinition.CreateVertexQuad ( Vector2  textureTL,
Vector2  textureBR,
Vector3  pieceDims 
) [private]

Creates a sets of verticies that form a textured quad. Quad points are in the x, y plane, from 1 to -1. Normal faces in the negative z direction.

textureTL - Top left texture coordinate.
textureBR - Bottom right texture coordinate.
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.
VertexPositionNormalTexture [] TheForum.GameCode.PieceDefinition.CreateVertexQuad ( Vector2  textureTL,
Vector2  textureBR,
Vector3  pieceDims 
) [private]

Creates a sets of verticies that form a textured quad. Quad points are in the x, y plane, from 1 to -1. Normal faces in the negative z direction.

textureTL - Top left texture coordinate.
textureBR - Bottom right texture coordinate.
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.
virtual BasePiece TheForum.GameCode.PieceDefinition.Generate ( AssetManager  assetM,
Vector3  pieceDims 
) [virtual]

Generates a piece with the appropriate values based on the definition.

assetM - Asset manager to use for the textures.
pieceDimensions - Dimensions of the piece in world space.

Return:
Value is the generated piece. It is null if the piece could not be created.
virtual BasePiece TheForum.GameCode.PieceDefinition.Generate ( AssetManager  assetM,
string  color,
Vector3  pieceDims 
) [virtual]

Generates a piece with the appropriate values based on the definition. Uses the default shader coded into the function for each piece. A hack really, for convenience.

assetM - Asset manager to use for the textures.
color - Piece color to use.
pieceDims - Dimensions of the piece in world space.

Return:
Value is the generated piece. It is null if the piece could not be created.
virtual BasePiece TheForum.GameCode.PieceDefinition.Generate ( AssetManager  assetM,
string  color,
Vector3  pieceDims 
) [virtual]

Generates a piece with the appropriate values based on the definition.

assetM - Asset manager to use for the textures.
color - Piece color to use.
pieceDimensions - Dimensions of the piece in world space.

Return:
Value is the generated piece. It is null if the piece could not be created.
virtual BasePiece TheForum.GameCode.PieceDefinition.Generate ( AssetManager  assetM,
Vector3  pieceDims 
) [virtual]

Generates a piece with the appropriate values based on the definition.

assetM - Asset manager to use for the textures.
pieceDims - Dimensions of the piece in world space.

Return:
Value is the generated piece. It is null if the piece could not be created.
virtual BasePiece TheForum.GameCode.PieceDefinition.Generate ( AssetManager  assetM,
string  color,
Vector3  pieceDims,
StringType  shaderUse 
) [virtual]

Generates a piece with the appropriate values based on the definition.

assetM - Asset manager to use for the textures.
color - Piece color to use.
pieceDims - Dimensions of the piece in world space.
shaderUse - ID of the shader to use for the piece.

Return:
Value is the generated piece. It is null if the piece could not be created.
StringType TheForum.GameCode.PieceDefinition.GetDropSoundID ( )

Get the ID of the sound to play when dropping the piece.

StringType TheForum.GameCode.PieceDefinition.GetPickUpSoundID ( )

Get the ID of the sound to play when picking up the piece.

StringType TheForum.GameCode.PieceDefinition.GetTexPathForID ( Libraries.StringType  ID)

Gets the texture path for a given color ID

ID - Color ID to get the texture for.

Return:
Value is the texture path associated with the given color, null if no match is found.
StringType TheForum.GameCode.PieceDefinition.GetTypeString ( )

Get a clone of the string type that represents the deffinition.

Return:
Value is a clone of the stored string that represents the deffintion type, null if not set.

StringType TheForum.GameCode.PieceDefinition.GetTypeString ( )

Get a clone of the string type that represents the deffinition.

Return:
Value is a clone of the stored string that represents the deffintion type, null if not set.

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

Sets the sounds to use for the piece.

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.PieceDefinition.SetType ( string  type)

Set the string type that represents the piece that gets generated.

type - Type that represents the piece definition.
void TheForum.GameCode.PieceDefinition.SetType ( string  type)

Set the string type that represents the piece that gets generated.

type - Type that represents the piece definition.

Member Data Documentation

Valid colors. Add colors you want to represent by type to this.

The default shader to use when creating the piece.

ID of the sound to play when a piece is dropped on the board.

ID of the sound to play when a piece is picked up on the the board.

String that repesents the definition.

readonly PieceColorDeff TheForum.GameCode.PieceDefinition.s_blackPiece = new PieceColorDeff("BLACK_PIECE", "Art/PieceAssets/black_border_hex") [static]
readonly PieceColorDeff TheForum.GameCode.PieceDefinition.s_darkBluePiece = new PieceColorDeff("DARK_BLUE_PIECE", "Art/PieceAssets/dark_blue_border_hex") [static]
readonly PieceColorDeff TheForum.GameCode.PieceDefinition.s_greenPiece = new PieceColorDeff("GREEN_PIECE", "Art/PieceAssets/green_border_hex") [static]
readonly PieceColorDeff TheForum.GameCode.PieceDefinition.s_lightBluePiece = new PieceColorDeff("LIGHT_BLUE_PIECE", "Art/PieceAssets/light_blue_border_hex") [static]
readonly PieceColorDeff TheForum.GameCode.PieceDefinition.s_orangePiece = new PieceColorDeff("ORANGE_PIECE", "Art/PieceAssets/orange_border_hex") [static]
readonly PieceColorDeff TheForum.GameCode.PieceDefinition.s_redPiece = new PieceColorDeff("RED_PIECE", "Art/PieceAssets/red_border_hex") [static]

Represents the different types of colors.

readonly PieceColorDeff TheForum.GameCode.PieceDefinition.s_whitePiece = new PieceColorDeff("WHITE_PIECE", "Art/PieceAssets/white_border_hex") [static]
readonly PieceColorDeff TheForum.GameCode.PieceDefinition.s_yellowPiece = new PieceColorDeff("YELLOW_PIECE", "Art/PieceAssets/yellow_border_hex") [static]

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