C#Code
C#Code
Public Member Functions | Public Attributes
TheForum.GameCode.PosterProfiles.PieceSpawnSize Class Reference

List of all members.

Public Member Functions

 PieceSpawnSize ()
 PieceSpawnSize (int startRange, int endRange, int chance)
virtual object Clone ()
bool Setup (int startRange, int endRange, int chance)
int GetChance ()
int GetNumPiecesSpawn (Random rand)
int GetRangeStart ()
int GetRangeEnd ()
 PieceSpawnSize ()
bool Setup (int startRange, int endRange, int chance)
int GetChance ()
int GetNumPiecesSpawn (Random rand)

Public Attributes

int m_startRange
int m_endRange
 End of the range. This is the maximum number of pieces that can be spawned.
int m_chance
 Chance of being picked.

Detailed Description

Used to setup how many pieces can be spawned at a time by posters. You can set a range for the number of pieces to create, and the chance that this spawn size determinator will be used. For example, if you wanted a player to mostly spawn one piece at a time, but sometimes spawn 4 or 5, then you could create two groups. One group would always spawn one, and the the other would have a range from 4 to 5.


Constructor & Destructor Documentation

TheForum.GameCode.PosterProfiles.PieceSpawnSize.PieceSpawnSize ( )

Default constructor.

TheForum.GameCode.PosterProfiles.PieceSpawnSize.PieceSpawnSize ( int  startRange,
int  endRange,
int  chance 
)

Constructor.

startRange - Lowest number of pieces that can be spawned.
endRange - Largest number of pieces that can be spawned.
chance - Chance the spawn has of happening. Will be combined with the other chances.

Member Function Documentation

virtual object TheForum.GameCode.PosterProfiles.PieceSpawnSize.Clone ( ) [virtual]

Clone the object.

Return:
Value is the clone.

int TheForum.GameCode.PosterProfiles.PieceSpawnSize.GetChance ( )

Get the chance the group has of being used.

Return:
Value is the chance.

int TheForum.GameCode.PosterProfiles.PieceSpawnSize.GetNumPiecesSpawn ( Random  rand)

Get the number of pieces to spawn based on the range.

rand - Random number generator to use.

Return:
Value is the number of pieces to create, 0 if something was wrong.
int TheForum.GameCode.PosterProfiles.PieceSpawnSize.GetRangeEnd ( )

Get the end range of the piece spawn. No more then this many pieces can spawn.

Return:
Value is the end spawn range.

int TheForum.GameCode.PosterProfiles.PieceSpawnSize.GetRangeStart ( )

Get the start range of the piece spawn. No fewer then this many pieces can spawn.

Return:
Value is the start spawn range.

bool TheForum.GameCode.PosterProfiles.PieceSpawnSize.Setup ( int  startRange,
int  endRange,
int  chance 
)

Setup the range and chance this spawn size has of being used.

startRange - Starting value of the range of how many pieces can spawn
endRange - Ending value of the range of how many pieces can spawn.
chance - Chance that this spawn has of happening.

Member Data Documentation

Chance of being picked.

End of the range. This is the maximum number of pieces that can be spawned.

Start of the range. This would be the smallest number of pieces that can be spawned. If you want the spawner to always spawn the same number of pieces, make the start and end the same number.


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