C#Code
C#Code
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes
TheForum.GameCode.OpponentPost Class Reference
Inheritance diagram for TheForum.GameCode.OpponentPost:
TheForum.GameCode.Poster.BasePost TheForum.GameCode.Poster.BasePost

List of all members.

Public Member Functions

 OpponentPost (string ID, string posterName)
void Create (Vector3 startLoc, BaseGameBoard gameBoard, Libraries.AssetManager assetM, GraphicsDevice device)
override void Update (int timePassed, Libraries.AssetManager assetM)
override void Render (GraphicsDevice device)
void HandleGameMessageDelegate (object message)
UInt64 GetPostSpeed ()
void ChangePostSpeed (UInt64 newTimeWait)
 OpponentPost (string ID, string posterName)
void Create (Vector3 startLoc, BaseGameBoard gameBoard, Libraries.AssetManager assetM, GraphicsDevice device)
override void Update (int timePassed, Libraries.AssetManager assetM)
override void Render (GraphicsDevice device)
void HandleGameMessageDelegate (object message)

Protected Member Functions

override void ProcessGameMessage (object message, bool storeIfNotUsed)
override void ProcessGameMessage (object message, bool storeIfNotUsed)

Private Member Functions

void CreateSpawnPieces (Libraries.AssetManager assetM)
void PostPieces ()
void CreateSpawnPieces (Libraries.AssetManager assetM)
void PostPieces ()

Private Attributes

PostBackground m_oppPostBG
 The background elements that comprise the post area. This is the rects, user image, whatever.
PieceDisplayBoard m_storePieces
 Holds the spawn pieces and displays them until they go on the board.
BackgroundBoard m_spawnAreaBG
 The background for the spawn area. This is a blank board large enough to show the pieces that will spawn.
Libraries.Timers.BaseTimer m_spawnTimer
 Timer to signal when a spawn should occur. This is just a hack right now.
Random m_pieceLocationRand
 Used to determine where a new piece spawns. It is a member object so I can set the seed and keep it the same for games if I want.
Random m_pieceRand
 Random generator to use for deciding what type of piece should be spawned.
Libraries.AssetManager m_assetM
 Asset manager to use.

Detailed Description

Display and handle the opponent posts in game. Shows graphics, pieces that make up a opponent post.


Constructor & Destructor Documentation

TheForum.GameCode.OpponentPost.OpponentPost ( string  ID,
string  posterName 
)

Constructor.

ID - ID to use for the poster.
posterName - Name to use for the poster. Should have a corresponding profile.
TheForum.GameCode.OpponentPost.OpponentPost ( string  ID,
string  posterName 
)

Constructor.

ID - ID to use for the poster.
posterName - Name to use for the poster. Should have a corresponding profile.

Member Function Documentation

void TheForum.GameCode.OpponentPost.ChangePostSpeed ( UInt64  newTimeWait)

Changes how fast the opponent posts.

newTimeWait - How long the opponent waits.
void TheForum.GameCode.OpponentPost.Create ( Vector3  startLoc,
BaseGameBoard  gameBoard,
Libraries.AssetManager  assetM,
GraphicsDevice  device 
)

Create the basic display components. Set the spawn area to be 1 row and base it off the given game board.

startLoc - Starting location of the post.
gameBoard - Board to use with.
assetM - Asset manager to use.
device - Device to use.
void TheForum.GameCode.OpponentPost.Create ( Vector3  startLoc,
BaseGameBoard  gameBoard,
Libraries.AssetManager  assetM,
GraphicsDevice  device 
)

Create the basic display components. Set the spawn area to be 1 row and base it off the given game board.

void TheForum.GameCode.OpponentPost.CreateSpawnPieces ( Libraries.AssetManager  assetM) [private]

Create the group pieces that will be sent to the opponent.

assetM - Asset manager to use.
void TheForum.GameCode.OpponentPost.CreateSpawnPieces ( Libraries.AssetManager  assetM) [private]

Create the group pieces that will be sent to the opponent.

assetM - Asset manager to use.
UInt64 TheForum.GameCode.OpponentPost.GetPostSpeed ( )

Get the current speed the opponent posts at.

Return:
Value is how long the opponent waits between posting.

void TheForum.GameCode.OpponentPost.HandleGameMessageDelegate ( object  message)

Used for a delegate to handle game messages.

message - Message to handle.
void TheForum.GameCode.OpponentPost.HandleGameMessageDelegate ( object  message)

Used for a delegate to handle game messages.

message - Message to handle.
void TheForum.GameCode.OpponentPost.PostPieces ( ) [private]

Post the currently held pieces, sending the attack.

void TheForum.GameCode.OpponentPost.PostPieces ( ) [private]

Post the currently held pieces, sending the attack.

override void TheForum.GameCode.OpponentPost.ProcessGameMessage ( object  message,
bool  storeIfNotUsed 
) [protected, virtual]

Handles the given game message. Passes it along to where it needs to go.

message - Message to handle.
storeIfNotUsed - Wether the message should be stored if it can't be handled. This way if the message is already stored, you don't have to store it again.

Implements TheForum.GameCode.Poster.BasePost.

override void TheForum.GameCode.OpponentPost.ProcessGameMessage ( object  message,
bool  storeIfNotUsed 
) [protected, virtual]

Handles the given game message. Passes it along to where it needs to go.

message - Message to handle.
storeIfNotUsed - Wether the message should be stored if it can't be handled. This way if the message is already stored, you don't have to store it again.

Implements TheForum.GameCode.Poster.BasePost.

override void TheForum.GameCode.OpponentPost.Render ( GraphicsDevice  device) [virtual]

Render everything.

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

Reimplemented from TheForum.GameCode.Poster.BasePost.

override void TheForum.GameCode.OpponentPost.Render ( GraphicsDevice  device) [virtual]

Render everything.

device - Device to use.

Reimplemented from TheForum.GameCode.Poster.BasePost.

override void TheForum.GameCode.OpponentPost.Update ( int  timePassed,
Libraries.AssetManager  assetM 
) [virtual]

Update everything. Handle notifing the board is a piece spawn is needed, etc.

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

Reimplemented from TheForum.GameCode.Poster.BasePost.

override void TheForum.GameCode.OpponentPost.Update ( int  timePassed,
Libraries.AssetManager  assetM 
) [virtual]

Update everything. Handle notifing the board is a piece spawn is needed, etc.

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

Reimplemented from TheForum.GameCode.Poster.BasePost.


Member Data Documentation

Libraries AssetManager TheForum::GameCode.OpponentPost::m_assetM [private]

Asset manager to use.

The background elements that comprise the post area. This is the rects, user image, whatever.

Used to determine where a new piece spawns. It is a member object so I can set the seed and keep it the same for games if I want.

Random generator to use for deciding what type of piece should be spawned.

The background for the spawn area. This is a blank board large enough to show the pieces that will spawn.

Libraries Timers BaseTimer TheForum::GameCode.OpponentPost::m_spawnTimer [private]

Timer to signal when a spawn should occur. This is just a hack right now.

Holds the spawn pieces and displays them until they go on the board.


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