#include <global_actors.h>
Inheritance diagram for hoa_global::GlobalParty:


Public Member Functions | |
| void | AddActor (GlobalActor *actor, int32 index=-1) |
| Adds an actor to the party. | |
| float | AverageExperienceLevel () const |
| Computes the average experience level of all actors in the party. | |
| GlobalActor * | GetActorAtIndex (uint32 index) const |
| Retrieves a poitner to the actor in the party at a specified index. | |
| GlobalActor * | GetActorByID (uint32 id) const |
| Retrieves a poitner to the actor in the party with the spefified id. | |
| std::vector< GlobalActor * > * | GetAllActors () |
| uint32 | GetPartySize () const |
| GLOBAL_TARGET | GetTargetType () |
| A pure virtual function that returns the type of target. | |
| GlobalParty (bool allow_duplicates=false) | |
| bool | IsAllowDuplicates () const |
| bool | IsPartyEmpty () const |
| GlobalActor * | RemoveActorAtIndex (uint32 index) |
| Removes an actor from the party. | |
| GlobalActor * | RemoveActorByID (uint32 id) |
| Removes an actor from the party. | |
| void | RemoveAllActors () |
| Clears the internally stored actor pointers. | |
| GlobalActor * | ReplaceActorByID (uint32 id, GlobalActor *new_actor) |
| Replaces an actor in the party with the specified id with a new actor. | |
| GlobalActor * | ReplaceActorByIndex (uint32 index, GlobalActor *new_actor) |
| Replaces an actor in the party at a specified index with a new actor. | |
| void | SwapActorsByID (uint32 first_id, uint32 second_id) |
| Swaps the location of two actors in the party by looking up their IDs. | |
| void | SwapActorsByIndex (uint32 first_index, uint32 second_index) |
| Swaps the location of two actors in the party by their indeces. | |
| ~GlobalParty () | |
Private Attributes | |
| std::vector< GlobalActor * > | _actors |
| The vector of actors that are in this party The class will not create nor destroy GlobalActor pointers stored in this data structure. | |
| bool | _allow_duplicates |
| If true, actors are allowed to be inserted into the party multiple times. | |
****************************************************************************
This class is a container for a group or "party" of actors. A party is a type of target for items and skills. The GameGlobal class also organizes characters into parties for convienence. Note that an actor may be either an enemy or a character, but you should avoid creating parties that contain both characters and enemies, as it can lead to conflicts (for example, a character and enemy which have the same ID value).
Parties may or may not allow duplicate actors (a duplicate actor is defined as an actor that has the same _id member as another actor in the party). This property is determined in the GlobalParty constructor
All methods which perform an operation by using an actor ID are only valid to use if the party does not allow duplicates.
Definition at line 1094 of file global_actors.h.
| hoa_global::GlobalParty::GlobalParty | ( | bool | allow_duplicates = false |
) | [inline] |
| allow_duplicates | Determines whether or not the party allows duplicate actors to be added (default value == false) |
Definition at line 1099 of file global_actors.h.
| hoa_global::GlobalParty::~GlobalParty | ( | ) | [inline] |
Definition at line 1102 of file global_actors.h.
| void hoa_global::GlobalParty::AddActor | ( | GlobalActor * | actor, | |
| int32 | index = -1 | |||
| ) |
Adds an actor to the party.
| actor | A pointer to the actor to add to the party | |
| index | The index where the actor should be inserted. If negative, actor is added to the end |
Definition at line 1074 of file global_actors.cpp.
References _actors, _allow_duplicates, hoa_global::GlobalActor::GetID(), and hoa_global::GLOBAL_DEBUG.
Referenced by hoa_global::GameGlobal::AddCharacter(), and hoa_global::GameGlobal::RemoveCharacter().
Here is the call graph for this function:

| float hoa_global::GlobalParty::AverageExperienceLevel | ( | ) | const |
Computes the average experience level of all actors in the party.
Definition at line 1287 of file global_actors.cpp.
References _actors.
Referenced by hoa_global::GameGlobal::AverageActivePartyExperienceLevel().
| GlobalActor* hoa_global::GlobalParty::GetActorAtIndex | ( | uint32 | index | ) | const [inline] |
Retrieves a poitner to the actor in the party at a specified index.
| index | The index where the actor may be found in the party |
Definition at line 1166 of file global_actors.h.
References _actors.
Referenced by hoa_menu::MenuMode::_DrawBottomMenu(), hoa_battle::BattleMode::_Initialize(), hoa_menu::private_menu::EquipWindow::_UpdateEquipList(), hoa_menu::private_menu::SkillsWindow::_UpdateSkillList(), hoa_menu::private_menu::SkillsWindow::Draw(), hoa_menu::private_menu::EquipWindow::EquipWindow(), hoa_menu::private_menu::StatusWindow::StatusWindow(), hoa_menu::private_menu::SkillsWindow::Update(), hoa_menu::private_menu::StatusWindow::Update(), and hoa_menu::private_menu::InventoryWindow::Update().
| GlobalActor * hoa_global::GlobalParty::GetActorByID | ( | uint32 | id | ) | const |
Retrieves a poitner to the actor in the party with the spefified id.
| id | The id of the actor to return |
Definition at line 1299 of file global_actors.cpp.
References _actors, _allow_duplicates, and hoa_global::GLOBAL_DEBUG.
| std::vector<GlobalActor*>* hoa_global::GlobalParty::GetAllActors | ( | ) | [inline] |
| uint32 hoa_global::GlobalParty::GetPartySize | ( | ) | const [inline] |
Definition at line 1184 of file global_actors.h.
References _actors.
Referenced by hoa_menu::private_menu::EquipWindow::_InitCharSelect(), hoa_menu::private_menu::SkillsWindow::_InitCharSelect(), hoa_menu::private_menu::StatusWindow::_InitCharSelect(), hoa_menu::private_menu::InventoryWindow::_InitCharSelect(), hoa_battle::BattleMode::_Initialize(), hoa_battle::BattleMode::_UpdateTargetSelection(), hoa_menu::private_menu::StatusWindow::StatusWindow(), and hoa_menu::private_menu::StatusWindow::~StatusWindow().
| GLOBAL_TARGET hoa_global::GlobalParty::GetTargetType | ( | ) | [inline, virtual] |
A pure virtual function that returns the type of target.
Implements hoa_global::GlobalTarget.
Definition at line 1175 of file global_actors.h.
References hoa_global::GLOBAL_TARGET_PARTY.
| bool hoa_global::GlobalParty::IsAllowDuplicates | ( | ) | const [inline] |
| bool hoa_global::GlobalParty::IsPartyEmpty | ( | ) | const [inline] |
| GlobalActor * hoa_global::GlobalParty::RemoveActorAtIndex | ( | uint32 | index | ) |
Removes an actor from the party.
| index | The index of the actor in the party to remove |
Definition at line 1111 of file global_actors.cpp.
References _actors, and hoa_global::GLOBAL_DEBUG.
| GlobalActor * hoa_global::GlobalParty::RemoveActorByID | ( | uint32 | id | ) |
Removes an actor from the party.
| id | The id value of the actor to remove |
Definition at line 1129 of file global_actors.cpp.
References _actors, _allow_duplicates, and hoa_global::GLOBAL_DEBUG.
| void hoa_global::GlobalParty::RemoveAllActors | ( | ) | [inline] |
Clears the internally stored actor pointers.
Definition at line 1128 of file global_actors.h.
References _actors.
Referenced by hoa_global::GameGlobal::ClearAllData(), and hoa_global::GameGlobal::RemoveCharacter().
| GlobalActor * hoa_global::GlobalParty::ReplaceActorByID | ( | uint32 | id, | |
| GlobalActor * | new_actor | |||
| ) |
Replaces an actor in the party with the specified id with a new actor.
| id | The id of the actor to be replaced | |
| new_actor | A pointer to the actor that will replace the existing actor |
Definition at line 1253 of file global_actors.cpp.
References _actors, _allow_duplicates, and hoa_global::GLOBAL_DEBUG.
| GlobalActor * hoa_global::GlobalParty::ReplaceActorByIndex | ( | uint32 | index, | |
| GlobalActor * | new_actor | |||
| ) |
Replaces an actor in the party at a specified index with a new actor.
| index | The index of the actor to be replaced | |
| new_actor | A pointer to the actor that will replace the existing actor |
Definition at line 1232 of file global_actors.cpp.
References _actors, and hoa_global::GLOBAL_DEBUG.
Swaps the location of two actors in the party by looking up their IDs.
| first_id | The id of the first actor to swap | |
| second_id | The id of the second actor to swap |
Definition at line 1186 of file global_actors.cpp.
References _actors, _allow_duplicates, and hoa_global::GLOBAL_DEBUG.
Swaps the location of two actors in the party by their indeces.
| first_index | The index of the first actor to swap | |
| second_index | The index of the second actor to swap |
Definition at line 1157 of file global_actors.cpp.
References _actors, and hoa_global::GLOBAL_DEBUG.
std::vector<GlobalActor*> hoa_global::GlobalParty::_actors [private] |
The vector of actors that are in this party The class will not create nor destroy GlobalActor pointers stored in this data structure.
Definition at line 1194 of file global_actors.h.
Referenced by AddActor(), AverageExperienceLevel(), GetActorAtIndex(), GetActorByID(), GetAllActors(), GetPartySize(), IsPartyEmpty(), RemoveActorAtIndex(), RemoveActorByID(), RemoveAllActors(), ReplaceActorByID(), ReplaceActorByIndex(), SwapActorsByID(), and SwapActorsByIndex().
bool hoa_global::GlobalParty::_allow_duplicates [private] |
If true, actors are allowed to be inserted into the party multiple times.
Definition at line 1197 of file global_actors.h.
Referenced by AddActor(), GetActorByID(), IsAllowDuplicates(), RemoveActorByID(), ReplaceActorByID(), and SwapActorsByID().
1.5.1