C#Code
C#Code
Classes | Public Member Functions | Static Public Attributes | Private Attributes
TheForum.GameCode.PosterProfiles.PlayerProfile Class Reference

List of all members.

Classes

class  ProfileValues

Public Member Functions

 PlayerProfile ()
virtual object Clone ()
void SetUser (string userName, string avatarPath, bool isMod)
void AddPieceTypeSpawn (string pieceType, int chance)
int GetPieceTypeSpawnRate (string pieceType)
void SetPieceTypeSpawnChance (string pieceType, int chance)
void AddPieceColorSpawn (string colorType, int chance)
void AddSpawnSize (int spawnRangeStart, int spawnRangeEnd, int chance)
void SetPostWaitTime (int timeWait)
int GetPostWaitTime ()
string GetRandomPieceType ()
int GetRandomSpawnSize ()
string GetRandomColorType ()
string GetUserName ()
string GetAvatarFile ()
void SetTotalMoneyEarned (double value)
double GetTotalMoneyEarned ()
void SetTotalTaxesPaid (double value)
double GetTotalTaxesPaid ()
void SetTaxRate (float value)
double GetTaxRate ()
void SetAge (float age)
float GetAge ()
void SetAgeToDieAt (float age)
float GetAgeToDieAt ()
int GetTotalPieceChances ()
int GetTotalColorChances ()
int GetTotalSpawnChances ()
List< PieceUseDataGetPieces ()
PieceUseData GetPieceData (string type)
List< ColorUseDataGetColors ()
ColorUseData GetColorData (string colorID)
List< PieceSpawnSizeGetSpawnSizes ()
void SetJobTitle (string jobTitle)
string GetJobTitle ()
void SetPieceWorth (double pieceWorth)
void SetMinPostSize (int minPostSize)
double GetPieceWorth ()
double GetWaitBetweenPieceSpawns ()
int GetMinPostSize ()
GameCode.Saves.HighScoreSave GetStatsHandler ()
bool SaveProfileProperties (String directory)
void StoreProfileProperties (ProfileValues properties)
 PlayerProfile ()
void SetUser (string userName, string avatarPath, bool isMod)
void AddPieceTypeSpawn (string pieceType, int chance)
void AddPieceColorSpawn (string colorType, int chance)
void AddSpawnSize (int spawnRangeStart, int spawnRangeEnd, int chance)
void SetPostWaitTime (int timeWait)
int GetPostWaitTime ()
string GetRandomPieceType ()
int GetRandomSpawnSize ()
string GetRandomColorType ()
string GetUserName ()
string GetAvatarFile ()

Static Public Attributes

static readonly int s_maxTotalSpawnChancePoints = 100
 Maximum total chance points that should be allowed for the different piece types. So they should all add up and be less than or equal to this.

Private Attributes

Random m_rand
 Random number generator. Used to select the piece to use and the color to use.
ProfileValues m_profileProps
 Profile properties, like age and stuff. Things that define how the profile plays.
bool m_isMod
 Wether the player is a moderator. Value is true if a moderator, false if not.
GameCode.Saves.HighScoreSave m_scores
 Used to keep track of scoring. Can be serialized to save the score.
List< ColorUseDatam_colors
 Colors the player can use for pieces.
List< PieceUseDatam_pieces
 Pieces the player is allowed to spawn.
List< PieceSpawnSizem_spawnSizes
 Stores definitions for how many pieces to create.
string m_userName
 Name to use for the user. Must be unique.
string m_avatarPath
 Path to the avatar the user uses. Null if not avatar is used.
int m_postWaitTime
 How long the player waits before posting again. Used for AI posting speed. Time is in milliseconds.

Detailed Description

Player profile information. Used to load a player, define what kinds of attacks, happen, etc.


Constructor & Destructor Documentation

TheForum.GameCode.PosterProfiles.PlayerProfile.PlayerProfile ( )

Default constructor.

TheForum.GameCode.PosterProfiles.PlayerProfile.PlayerProfile ( )

Default constructor.


Member Function Documentation

void TheForum.GameCode.PosterProfiles.PlayerProfile.AddPieceColorSpawn ( string  colorType,
int  chance 
)

Add a piece color the player can spawn.

colorType - String that represents the piece color.
chance - The chance the piece color has of being spawned.
void TheForum.GameCode.PosterProfiles.PlayerProfile.AddPieceColorSpawn ( string  colorType,
int  chance 
)

Add a piece color the player can spawn.

colorType - String that represents the piece color.
chance - The chance the piece color has of being spawned.
void TheForum.GameCode.PosterProfiles.PlayerProfile.AddPieceTypeSpawn ( string  pieceType,
int  chance 
)

Add a piece type the player can spawn.

pieceType - String that represents the piece type.
chance - The chance the piece has of being spawned.
void TheForum.GameCode.PosterProfiles.PlayerProfile.AddPieceTypeSpawn ( string  pieceType,
int  chance 
)

Add a piece type the player can spawn.

pieceType - String that represents the piece type.
chance - The chance the piece has of being spawned.
void TheForum.GameCode.PosterProfiles.PlayerProfile.AddSpawnSize ( int  spawnRangeStart,
int  spawnRangeEnd,
int  chance 
)

Add a piece color the player can spawn.

spawnSize - Spawn size to store.
void TheForum.GameCode.PosterProfiles.PlayerProfile.AddSpawnSize ( int  spawnRangeStart,
int  spawnRangeEnd,
int  chance 
)

Add a piece color the player can spawn.

spawnSize - Spawn size to store.
virtual object TheForum.GameCode.PosterProfiles.PlayerProfile.Clone ( ) [virtual]

Clone the object.

Return:
Value is the clone.

float TheForum.GameCode.PosterProfiles.PlayerProfile.GetAge ( )

Get the player age

Return:
Value is the player's age.

float TheForum.GameCode.PosterProfiles.PlayerProfile.GetAgeToDieAt ( )

Get the age the player will die at.

Return:
Value is the player's age.

string TheForum.GameCode.PosterProfiles.PlayerProfile.GetAvatarFile ( )

Get the user avatar image path, if any.

Return:
Value is the path to the avatar the user uses, null if not avatar.

string TheForum.GameCode.PosterProfiles.PlayerProfile.GetAvatarFile ( )

Get the user avatar image path, if any.

Return:
Value is the path to the avatar the user uses, null if not avatar.

ColorUseData TheForum.GameCode.PosterProfiles.PlayerProfile.GetColorData ( string  colorID)

Get the piece color data for the given color, if possible.

color - Color to get.

Return:
Value is the color data with the given color name, null if not found.
List<ColorUseData> TheForum.GameCode.PosterProfiles.PlayerProfile.GetColors ( )

Get the piece colors that are allowed to be used.

Return:
Value is the list of colors allowed.

string TheForum.GameCode.PosterProfiles.PlayerProfile.GetJobTitle ( )

Get the job title for the profile.

Return:
Value is the job title

int TheForum.GameCode.PosterProfiles.PlayerProfile.GetMinPostSize ( )

Get the minimum post size needed to avoid undereporting to the IRS.

Return:
Value is the minimum number of pieces that must be posted to count as a valid form.

PieceUseData TheForum.GameCode.PosterProfiles.PlayerProfile.GetPieceData ( string  type)

Get the piece data with the given name.

type - Piece data to get.

Return:
Value is the piece data associated with the type, null if no match is found.
List<PieceUseData> TheForum.GameCode.PosterProfiles.PlayerProfile.GetPieces ( )

Get the piece spawns that are allowed to happen.

Return:
Value is the list of piece allowed.

int TheForum.GameCode.PosterProfiles.PlayerProfile.GetPieceTypeSpawnRate ( string  pieceType)

Get the chance value for the given piece spawn type.

pieceType - Type to get the value for.

Value is the chance value used for determining if the given type is allowed to spawn. Will be 0 if the type doesn't even exist, or it is set to 0 chance.
double TheForum.GameCode.PosterProfiles.PlayerProfile.GetPieceWorth ( )

Get how much a piece is worth.

Return:
Value is how much a money piece is worth.

int TheForum.GameCode.PosterProfiles.PlayerProfile.GetPostWaitTime ( )

Get how long the AI poster waits between posts.

Return:
Value is how long the AI waits before posting.

int TheForum.GameCode.PosterProfiles.PlayerProfile.GetPostWaitTime ( )

Get how long the AI poster waits between posts.

Return:
Value is how long, in milliseconds, the AI waits before posting.

string TheForum.GameCode.PosterProfiles.PlayerProfile.GetRandomColorType ( )

Pick a random color type. Add up all the chances and pick a number in the range at random. Use the color whose chance range corresponds with that number.

Return:
Value was the piece type selected, null if none were available.

string TheForum.GameCode.PosterProfiles.PlayerProfile.GetRandomColorType ( )

Pick a random color type. Add up all the chances and pick a number in the range at random. Use the color whose chance range corresponds with that number.

Return:
Value was the piece type selected, null if none were available.

string TheForum.GameCode.PosterProfiles.PlayerProfile.GetRandomPieceType ( )

Pick a random piece type. Add up all the chances and pick a number in the range at random. Use the piece whose chance range corresponds with that number.

Return:
Value was the piece type selected, null if none were available.

string TheForum.GameCode.PosterProfiles.PlayerProfile.GetRandomPieceType ( )

Pick a random piece type. Add up all the chances and pick a number in the range at random. Use the piece whose chance range corresponds with that number.

Return:
Value was the piece type selected, null if none were available.

int TheForum.GameCode.PosterProfiles.PlayerProfile.GetRandomSpawnSize ( )

Pick a random piece type. Add up all the chances and pick a number in the range at random. Use the piece whose chance range corresponds with that number.

Return:
Value was the piece type selected, null if none were available.

int TheForum.GameCode.PosterProfiles.PlayerProfile.GetRandomSpawnSize ( )

Pick a random piece type. Add up all the chances and pick a number in the range at random. Use the piece whose chance range corresponds with that number.

Return:
Value was the piece type selected, null if none were available.

List<PieceSpawnSize> TheForum.GameCode.PosterProfiles.PlayerProfile.GetSpawnSizes ( )

Get the piece spawn sizes that are allowed to be used.

Return:
Value is the list of spawn sizes allowed.

GameCode.Saves.HighScoreSave TheForum.GameCode.PosterProfiles.PlayerProfile.GetStatsHandler ( )

Retrive the stats handler.

Return:
Value is the score handler

double TheForum.GameCode.PosterProfiles.PlayerProfile.GetTaxRate ( )

Get the default tax rate

Return:
Value is the tax rate.

int TheForum.GameCode.PosterProfiles.PlayerProfile.GetTotalColorChances ( )

Get the combined spawn chances for the different piece colors.

Return:
Value is the chance component from each color added up.

double TheForum.GameCode.PosterProfiles.PlayerProfile.GetTotalMoneyEarned ( )

Get the total money earned after taxes.

Return:
Value is the total money earned.

int TheForum.GameCode.PosterProfiles.PlayerProfile.GetTotalPieceChances ( )

Get the combined spawn chances for the different pieces.

Return:
Value is the chance component from each piece added up.

int TheForum.GameCode.PosterProfiles.PlayerProfile.GetTotalSpawnChances ( )

Get the combined spawn chances for the different spawn sizes colors.

Return:
Value is the chance component from each spawn size added up.

double TheForum.GameCode.PosterProfiles.PlayerProfile.GetTotalTaxesPaid ( )

Get the total money paid for taxes.

Return:
Value is the total money earned.

string TheForum.GameCode.PosterProfiles.PlayerProfile.GetUserName ( )

Get the user name for the profile.

Return:
Value is the name associated with the profile.

string TheForum.GameCode.PosterProfiles.PlayerProfile.GetUserName ( )

Get the user name for the profile.

Return:
Value is the name associated with the profile.

double TheForum.GameCode.PosterProfiles.PlayerProfile.GetWaitBetweenPieceSpawns ( )

Get how long to wait between piece spawns.

Return:
Value is how long to wait between piece spawns.

bool TheForum.GameCode.PosterProfiles.PlayerProfile.SaveProfileProperties ( String  directory)

Save the profile properties part of the profile (possible colors, spawn chances, max death age, etc). Any old file will get over written. The file will be saved as the profile name. If you think you need to use this, you probably don't.

directory - Where to store the file. Sound be something like Content//Profiles//.

Return:
Value is true if the profile could be saved, false if not.
void TheForum.GameCode.PosterProfiles.PlayerProfile.SetAge ( float  age)

Set player age.

age - The age to store.
void TheForum.GameCode.PosterProfiles.PlayerProfile.SetAgeToDieAt ( float  age)

Set the age the player will die at.

void TheForum.GameCode.PosterProfiles.PlayerProfile.SetJobTitle ( string  jobTitle)

Set the job title for the profile.

jobTitle - Job title to use.
void TheForum.GameCode.PosterProfiles.PlayerProfile.SetMinPostSize ( int  minPostSize)

Set the minimum post size needed to avoid undereporting to the IRS.

minPostSize - Number of pieces needed.
void TheForum.GameCode.PosterProfiles.PlayerProfile.SetPieceTypeSpawnChance ( string  pieceType,
int  chance 
)

Set the chance value for the given piece spawn type.

pieceType - Type to set the value for.
chance - Value to use. The stored value will get capped at some max, depending on how many total chance points there are for other pieces.

Value is the chance value used for determining if the given type is allowed to spawn. Will be 0 if the type doesn't even exist, or it is set to 0 chance.
void TheForum.GameCode.PosterProfiles.PlayerProfile.SetPieceWorth ( double  pieceWorth)

Set how much a game piece is worth.

pieceWorth - Value to store.
void TheForum.GameCode.PosterProfiles.PlayerProfile.SetPostWaitTime ( int  timeWait)

How long the poster waits between posts (AI only).

spawnSize - Spawn size to store.
void TheForum.GameCode.PosterProfiles.PlayerProfile.SetPostWaitTime ( int  timeWait)

How long the poster waits between posts (AI only).

spawnSize - Spawn size to store.
void TheForum.GameCode.PosterProfiles.PlayerProfile.SetTaxRate ( float  value)

Set the default tax rate.

value - Value to store
void TheForum.GameCode.PosterProfiles.PlayerProfile.SetTotalMoneyEarned ( double  value)

Set the total money earned after taxes.

value - Value to display.
void TheForum.GameCode.PosterProfiles.PlayerProfile.SetTotalTaxesPaid ( double  value)

Set the total money paid for taxes.

value - Value to display.
void TheForum.GameCode.PosterProfiles.PlayerProfile.SetUser ( string  userName,
string  avatarPath,
bool  isMod 
)

Set user properties for the profile.

userName - Name to use for the user.
avatarPath - Path to the avatar to use. If no avatar is needed, then set as null. isMod - True if the player is a moderator, false if not.
void TheForum.GameCode.PosterProfiles.PlayerProfile.SetUser ( string  userName,
string  avatarPath,
bool  isMod 
)

Set user properties for the profile.

userName - Name to use for the user.
avatarPath - Path to the avatar to use. If no avatar is needed, then set as null. isMod - True if the player is a moderator, false if not.
void TheForum.GameCode.PosterProfiles.PlayerProfile.StoreProfileProperties ( ProfileValues  properties)

Store the given properties object and use it as the profile properties.

properties - What to store.

Member Data Documentation

Path to the avatar the user uses. Null if not avatar is used.

Colors the player can use for pieces.

Wether the player is a moderator. Value is true if a moderator, false if not.

Pieces the player is allowed to spawn.

How long the player waits before posting again. Used for AI posting speed. Time is in milliseconds.

Profile properties, like age and stuff. Things that define how the profile plays.

Random number generator. Used to select the piece to use and the color to use.

Used to keep track of scoring. Can be serialized to save the score.

Stores definitions for how many pieces to create.

Name to use for the user. Must be unique.

Maximum total chance points that should be allowed for the different piece types. So they should all add up and be less than or equal to this.


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