Source: lycad_chargen/race.h
|
|
|
|
/***************************************************************************
race.h - description
-------------------
begin : Wed Oct 31 2001
copyright : (C) 2001 by Sheldon Lee Wen
email : tormak@home.com
***************************************************************************/
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#ifndef RACE_H
#define RACE_H
#include
#include "dataloader.h"
#include
/**This class represents race data. There is quite a bit of data needed to
represent the race and set the appropriate data, but once the data is set
much of the data contained in this class will not be needed by a character.
*@author Sheldon Lee Wen
*/
class Race
{
public:
Race(const int iRace, const int iGender=MALE);
Race(const Race &iRace);
~Race();
/** Set the race. This is called by the constructor */
void setRace(const int nRace, const int nGender);
/** Set the HP value of a body area */
inline void setHealthPoint(int bodyArea, int value) { workingHP[bodyArea] = value; }
/** Set the defense rating */
inline void setDefenseRating(int newDR) { defense_rating = newDR; }
/** Get the name of the race as a string */
inline string getRaceName() const { return raceName; }
/** Get the integer value of the race */
inline int getRaceType() const { return race; }
/** Get the string name of the gender */
inline string getGenderName() const { return genderName; }
/** Get the integer value of the gender */
inline int getGenderType() const { return gender; }
/** Get the Health Point value of a body area */
inline int getHealthPoint(int bodyArea) const { return workingHP[bodyArea]; }
/** Get the initial HP for a body area as determined by race */
inline int getRacialHealthPointMaximum(int bodyArea) const { return hp[bodyArea]; }
/** Get the bonus to an attribute from the racial attribute table */
inline int getAttributeBonus(int attribute) const { return attributeBonus[attribute]; }
/** Get the base defense rating from the characters race */
inline int getBaseDefenseRating() const { return base_defense_rating; }
/** Get the current defense rating of a character */
inline int getDefenseRating() const { return defense_rating; }
private:
/** Initializes all of the data to 0 */
void init(); //Clear all of our data.
/** Return the string identified of the race. Used to set raceName */
string parseRace(const int iRace);
/** Return the string form of the gender. Userd to set genderName */
string parseGender(const int iGender);
/** Base HP as determined by race */
const int hp[NUM_BODY];
/** Attribute bonus table for the race */
int attributeBonus[NUM_ATTRIBUTES];
/** Current HP of the character */
int workingHP[NUM_BODY];
/** Base Defense Rating as determined by race */
const int base_defense_rating;
/** Current defense rating */
int defense_rating;
/** Integer race identifier */
int race;
/** Integer gender identifier */
int gender;
/** String form of the race */
string raceName;
/** String form of the gender */
string genderName;
/** Pointer to the data loader */
dLoader *table;
};
#endif
Generated by: sheldonl on cr595811-a on Fri Nov 30 10:24:34 2001, using kdoc 2.0a53. |