Instances: public list of a map's boss states
GetBossState(id) needs the caller to already know every boss id. Code outside the instance script (bot modules planning a run) wants all of them at once, in boss id order. Read only copy of existing data, no behaviour change.
This commit is contained in:
@@ -989,6 +989,15 @@ void InstanceScript::UpdatePhasing()
|
||||
});
|
||||
}
|
||||
|
||||
std::vector<EncounterState> InstanceScript::GetBossStates() const
|
||||
{
|
||||
std::vector<EncounterState> states;
|
||||
states.reserve(bosses.size());
|
||||
for (BossInfo const& boss : bosses)
|
||||
states.push_back(boss.state);
|
||||
return states;
|
||||
}
|
||||
|
||||
char const* InstanceScript::GetBossStateName(uint8 state)
|
||||
{
|
||||
return EnumUtils::ToConstant(EncounterState(state));
|
||||
|
||||
@@ -285,6 +285,10 @@ class TC_GAME_API InstanceScript : public ZoneScript
|
||||
|
||||
uint32 GetEncounterCount() const { return uint32(bosses.size()); }
|
||||
|
||||
// Every boss state in boss id order (index = boss id). Read only copy for code outside
|
||||
// the instance script, such as bot modules that plan a raid or dungeon run.
|
||||
std::vector<EncounterState> GetBossStates() const;
|
||||
|
||||
// Sets the entrance location (WorldSafeLoc) id
|
||||
void SetEntranceLocation(uint32 worldSafeLocationId);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user