#include <character.h>
Public Types | |
enum | Gender { GENDER_MALE = 0, GENDER_FEMALE, GENDER_UNKNOWN } |
The character's gender. | |
Public Member Functions | |
Character (const ustring &internal="", const ustring &name="", const ustring &caption="", const ustring &description="") | |
Constructor. | |
void | addTalkOption (const ustring &viewStr, const ustring &block) |
Add a talk option. | |
void | removeTalkOption (const ustring &id) |
Remove a talk option. | |
void | clearTalkOptions () |
Clear all talk options. | |
std::vector< StringPair > | getTalkOptions () const |
Get a vector of all talk options. | |
void | addPresentable (const ustring &id, const ustring &targetBlock) |
Add a presentable piece of evidence/profile. | |
void | removePresentable (const ustring &id) |
Remove a presentable evidence/profile. | |
void | clearPresentableItems () |
Clear all accepted evidence/profiles. | |
void | setBadPresentableBlock (const ustring &id) |
Set the block ID to use when a bad item is presented. | |
ustring | getBadPresentableBlock () const |
Get the block to use when a bad item is presented. | |
std::vector< StringPair > | getPresentableItems () const |
Get all the evidence and profiles that can be presented. | |
void | setInternalName (const ustring &name) |
Set the internal character name. | |
ustring | getInternalName () const |
Get the internal character name. | |
void | setName (const ustring &name) |
Set the display name. | |
ustring | getName () const |
Get the display name. | |
void | setGender (const Gender &g) |
Set gender of this character. | |
Gender | getGender () const |
Get the gender of this character. | |
void | setCaption (const ustring &caption) |
Set the caption for this character. | |
ustring | getCaption () const |
Get the caption for this character. | |
void | setDescription (const ustring &desc) |
Set the description for this character. | |
ustring | getDescription () const |
Get the description for this character. | |
void | setSprite (const Sprite &spr) |
Set the sprite for this character. | |
Sprite * | getSprite () |
Get the sprite for this character. | |
void | setSpriteName (const ustring &name) |
Set the name of the sprite file to associate with this character. | |
ustring | getSpriteName () const |
Get sprite file name associated with this character. | |
void | setRootAnimation (const ustring &anim) |
Set the root sprite animation (normal, smirk, etc). | |
ustring | getRootAnimation () const |
Get the root sprite animation. | |
void | setHasTextBoxTag (bool b) |
Set if this character has a textbox tag. | |
bool | hasTextBoxTag () const |
Check if this character has a textbox tag. | |
void | setTextBoxTag (SDL_Surface *surface) |
Set the textbox tag image. | |
SDL_Surface * | getTextBoxTag () |
Get the textbox tag image. | |
void | setHasHeadshot (bool b) |
Set if this character has a headshot image. | |
bool | hasHeadshot () const |
Check if this character has a headshot image. | |
void | setHeadshot (SDL_Surface *full, SDL_Surface *thumb) |
Set the headshot (profile) image. | |
SDL_Surface * | getHeadshot () |
Get the headshot (profile) image. | |
SDL_Surface * | getHeadshotThumb () |
Get the scaled headshot image. | |
Private Attributes | |
ustring | m_InternalName |
The internal name. | |
ustring | m_Name |
The displayed name. | |
ustring | m_Caption |
The caption. | |
ustring | m_Description |
The description. | |
ustring | m_SpriteName |
The sprite name. | |
ustring | m_RootAnim |
The ID of the root animation. | |
bool | m_HasTextBoxTag |
Flag whether or not this character has a textbox tag. | |
SDL_Surface * | m_TextBoxTag |
The textbox tag image. | |
Sprite | m_Sprite |
Sprite associated with this character. | |
Gender | m_Gender |
Character's gender. | |
std::vector< StringPair > | m_TalkOptions |
Vector of talk options. | |
std::vector< StringPair > | m_AcceptedItems |
Vector of presentable evidence/profile IDs and target blocks. | |
ustring | m_BadPresentableBlock |
Block to execute if a useless item is presented. | |
bool | m_HasHeadshot |
Flag whether or not this character has a headshot (profile) image. | |
SDL_Surface * | m_Headshot |
The headshot image. | |
SDL_Surface * | m_HeadshotThumb |
The scaled headshot image. |
Each character in the case has his or her own set of attributes, and an associated sprite. All of this data is condensed in this class.
Character::Character | ( | const ustring & | internal = "" , |
|
const ustring & | name = "" , |
|||
const ustring & | caption = "" , |
|||
const ustring & | description = "" | |||
) |
Constructor.
internal | The internal name | |
name | The display name | |
caption | The text displayed in the green box in the Court Record | |
description | Text displayed below the caption in the Court Record |
void Character::addTalkOption | ( | const ustring & | viewStr, | |
const ustring & | block | |||
) |
Add a talk option.
viewStr | The display string for this option | |
block | The block to execute if selected |
void Character::removeTalkOption | ( | const ustring & | id | ) |
Remove a talk option.
id | The name of the talk option to remove |
std::vector<StringPair> Character::getTalkOptions | ( | ) | const [inline] |
Get a vector of all talk options.
void Character::addPresentable | ( | const ustring & | id, | |
const ustring & | targetBlock | |||
) |
Add a presentable piece of evidence/profile.
id | The ID of the item | |
targetBlock | Block to execute if selected |
void Character::removePresentable | ( | const ustring & | id | ) |
Remove a presentable evidence/profile.
id | The ID of the item to remove |
void Character::setBadPresentableBlock | ( | const ustring & | id | ) | [inline] |
Set the block ID to use when a bad item is presented.
id | The ID of the block |
ustring Character::getBadPresentableBlock | ( | ) | const [inline] |
Get the block to use when a bad item is presented.
std::vector<StringPair> Character::getPresentableItems | ( | ) | const [inline] |
Get all the evidence and profiles that can be presented.
void Character::setInternalName | ( | const ustring & | name | ) | [inline] |
Set the internal character name.
name | The new internal name |
ustring Character::getInternalName | ( | ) | const [inline] |
Get the internal character name.
void Character::setName | ( | const ustring & | name | ) | [inline] |
Set the display name.
name | The character's new display name |
ustring Character::getName | ( | ) | const [inline] |
Get the display name.
void Character::setGender | ( | const Gender & | g | ) | [inline] |
Set gender of this character.
g | The new gender type |
Gender Character::getGender | ( | ) | const [inline] |
Get the gender of this character.
void Character::setCaption | ( | const ustring & | caption | ) | [inline] |
Set the caption for this character.
cap | The caption |
ustring Character::getCaption | ( | ) | const [inline] |
Get the caption for this character.
void Character::setDescription | ( | const ustring & | desc | ) | [inline] |
Set the description for this character.
desc | The description |
ustring Character::getDescription | ( | ) | const [inline] |
Get the description for this character.
void Character::setSprite | ( | const Sprite & | spr | ) | [inline] |
Set the sprite for this character.
spr | The sprite to set |
Sprite* Character::getSprite | ( | ) | [inline] |
Get the sprite for this character.
void Character::setSpriteName | ( | const ustring & | name | ) | [inline] |
Set the name of the sprite file to associate with this character.
spr | Path relative to case file for the sprite |
ustring Character::getSpriteName | ( | ) | const [inline] |
Get sprite file name associated with this character.
void Character::setRootAnimation | ( | const ustring & | anim | ) | [inline] |
Set the root sprite animation (normal, smirk, etc).
anim | The ID of the root animation |
ustring Character::getRootAnimation | ( | ) | const [inline] |
Get the root sprite animation.
void Character::setHasTextBoxTag | ( | bool | b | ) | [inline] |
Set if this character has a textbox tag.
b | true if this character has a tag, false otherwise |
bool Character::hasTextBoxTag | ( | ) | const [inline] |
Check if this character has a textbox tag.
void Character::setTextBoxTag | ( | SDL_Surface * | surface | ) | [inline] |
Set the textbox tag image.
surface | The textbox tag image |
SDL_Surface* Character::getTextBoxTag | ( | ) | [inline] |
Get the textbox tag image.
void Character::setHasHeadshot | ( | bool | b | ) | [inline] |
Set if this character has a headshot image.
b | true if yes, false otherwise |
bool Character::hasHeadshot | ( | ) | const [inline] |
Check if this character has a headshot image.
void Character::setHeadshot | ( | SDL_Surface * | full, | |
SDL_Surface * | thumb | |||
) | [inline] |
Set the headshot (profile) image.
pixbuf | The image for the profile headshot |
SDL_Surface* Character::getHeadshot | ( | ) | [inline] |
Get the headshot (profile) image.
SDL_Surface* Character::getHeadshotThumb | ( | ) | [inline] |
Get the scaled headshot image.
The scaled image is used in certain animations, and it automatically generated when ever the headshot image gets updated or changed