Core/Misc: Add a few consts to methods

This commit is contained in:
DDuarte
2015-07-22 23:24:56 +01:00
parent 978a57f7b4
commit 7d9843c380
32 changed files with 80 additions and 80 deletions

View File

@@ -64,7 +64,7 @@ namespace Battlenet
std::string ToString() const override;
void CallHandler(Session* session) override;
uint8* GetRemainingData() { return _stream.GetBuffer() + (((_stream.GetReadPos() + 7) & ~7) / 8); }
size_t GetRemainingSize() { return _stream.GetSize() - (((_stream.GetReadPos() + 7) & ~7) / 8); }
size_t GetRemainingSize() const { return _stream.GetSize() - (((_stream.GetReadPos() + 7) & ~7) / 8); }
};
class LogoutRequest final : public ClientPacket

View File

@@ -122,7 +122,7 @@ class CreatureAI : public UnitAI
// Called when the creature is target of hostile action: swing, hostile spell landed, fear/etc)
virtual void AttackedBy(Unit* /*attacker*/) { }
virtual bool IsEscorted() { return false; }
virtual bool IsEscorted() const { return false; }
// Called when creature is spawned or respawned (for reseting variables)
virtual void JustRespawned() { Reset(); }

View File

@@ -94,16 +94,16 @@ struct npc_escortAI : public ScriptedAI
void SetEscortPaused(bool on);
bool HasEscortState(uint32 escortState) { return (m_uiEscortState & escortState) != 0; }
virtual bool IsEscorted() override { return (m_uiEscortState & STATE_ESCORT_ESCORTING); }
virtual bool IsEscorted() const override { return (m_uiEscortState & STATE_ESCORT_ESCORTING); }
void SetMaxPlayerDistance(float newMax) { MaxPlayerDistance = newMax; }
float GetMaxPlayerDistance() { return MaxPlayerDistance; }
float GetMaxPlayerDistance() const { return MaxPlayerDistance; }
void SetDespawnAtEnd(bool despawn) { DespawnAtEnd = despawn; }
void SetDespawnAtFar(bool despawn) { DespawnAtFar = despawn; }
bool GetAttack() { return m_bIsActiveAttacker; }//used in EnterEvadeMode override
bool GetAttack() const { return m_bIsActiveAttacker; }//used in EnterEvadeMode override
void SetCanAttack(bool attack) { m_bIsActiveAttacker = attack; }
ObjectGuid GetEventStarterGUID() { return m_uiPlayerGUID; }
ObjectGuid GetEventStarterGUID() const { return m_uiPlayerGUID; }
protected:
Player* GetPlayerForEscort() { return ObjectAccessor::GetPlayer(*me, m_uiPlayerGUID); }

View File

@@ -214,7 +214,7 @@ class SmartAI : public CreatureAI
uint32 mWPPauseTimer;
WayPoint* mLastWP;
Position mLastOOCPos;//set on enter combat
uint32 GetWPCount() { return mWayPoints ? uint32(mWayPoints->size()) : 0; }
uint32 GetWPCount() const { return mWayPoints ? uint32(mWayPoints->size()) : 0; }
bool mCanRepeatPath;
bool mRun;
bool mCanAutoAttack;

View File

@@ -923,7 +923,7 @@ class RBACData
*/
void CalculateNewPermissions();
int32 GetRealmId() { return _realmId; }
int32 GetRealmId() const { return _realmId; }
// Auxiliar private functions - defined to allow to maintain same code even
// if internal structure changes.

View File

@@ -101,7 +101,7 @@ class BfCapturePoint
GameObject* GetCapturePointGo();
uint32 GetCapturePointEntry() const { return m_capturePointEntry; }
TeamId GetTeamId() { return m_team; }
TeamId GetTeamId() const { return m_team; }
protected:
bool DelCapturePoint();
@@ -222,19 +222,19 @@ class Battlefield : public ZoneScript
/// Called when a Unit is kill in battlefield zone
virtual void HandleKill(Player* /*killer*/, Unit* /*killed*/) { };
uint32 GetTypeId() { return m_TypeId; }
uint32 GetZoneId() { return m_ZoneId; }
ObjectGuid GetGUID() { return m_Guid; }
uint32 GetTypeId() const { return m_TypeId; }
uint32 GetZoneId() const { return m_ZoneId; }
ObjectGuid GetGUID() const { return m_Guid; }
void TeamApplyBuff(TeamId team, uint32 spellId, uint32 spellId2 = 0);
/// Return true if battle is start, false if battle is not started
bool IsWarTime() { return m_isActive; }
bool IsWarTime() const { return m_isActive; }
/// Enable or Disable battlefield
void ToggleBattlefield(bool enable) { m_IsEnabled = enable; }
/// Return if battlefield is enable
bool IsEnabled() { return m_IsEnabled; }
bool IsEnabled() const { return m_IsEnabled; }
/**
* \brief Kick player from battlefield and teleport him to kick-point location
@@ -257,9 +257,9 @@ class Battlefield : public ZoneScript
virtual void UpdateData(uint32 index, int32 pad) { m_Data32[index] += pad; }
// Battlefield - generic methods
TeamId GetDefenderTeam() { return m_DefenderTeam; }
TeamId GetAttackerTeam() { return TeamId(1 - m_DefenderTeam); }
TeamId GetOtherTeam(TeamId team) { return (team == TEAM_HORDE ? TEAM_ALLIANCE : TEAM_HORDE); }
TeamId GetDefenderTeam() const { return m_DefenderTeam; }
TeamId GetAttackerTeam() const { return TeamId(1 - m_DefenderTeam); }
TeamId GetOtherTeam(TeamId team) const { return (team == TEAM_HORDE ? TEAM_ALLIANCE : TEAM_HORDE); }
void SetDefenderTeam(TeamId team) { m_DefenderTeam = team; }
// Group methods
@@ -311,7 +311,7 @@ class Battlefield : public ZoneScript
void PlayerAcceptInviteToQueue(Player* player);
void PlayerAcceptInviteToWar(Player* player);
uint32 GetBattleId() { return m_BattleId; }
uint32 GetBattleId() const { return m_BattleId; }
void AskToLeaveQueue(Player* player);
virtual void DoCompleteOrIncrementAchievement(uint32 /*achievement*/, Player* /*player*/, uint8 /*incrementNumber = 1*/) { }
@@ -331,9 +331,9 @@ class Battlefield : public ZoneScript
void HideNpc(Creature* creature);
void ShowNpc(Creature* creature, bool aggressive);
GraveyardVect GetGraveyardVector() { return m_GraveyardList; }
GraveyardVect GetGraveyardVector() const { return m_GraveyardList; }
uint32 GetTimer() { return m_Timer; }
uint32 GetTimer() const { return m_Timer; }
void SetTimer(uint32 timer) { m_Timer = timer; }
void DoPlaySoundToAll(uint32 SoundID);

View File

@@ -149,7 +149,7 @@ class BfGraveyardWG : public BfGraveyard
BfGraveyardWG(BattlefieldWG* Bf);
void SetTextId(uint32 textId) { m_GossipTextId = textId; }
uint32 GetTextId() { return m_GossipTextId; }
uint32 GetTextId() const { return m_GossipTextId; }
protected:
uint32 m_GossipTextId;

View File

@@ -259,7 +259,7 @@ class Battleground
/* Battleground */
// Get methods:
std::string const& GetName() const { return m_Name; }
uint64 GetQueueId() { return m_queueId; }
uint64 GetQueueId() const { return m_queueId; }
BattlegroundTypeId GetTypeID(bool GetRandom = false) const { return GetRandom ? m_RandomTypeID : m_TypeID; }
BattlegroundBracketId GetBracketId() const { return m_BracketId; }
uint32 GetInstanceID() const { return m_InstanceID; }

View File

@@ -494,7 +494,7 @@ class Creature : public Unit, public GridObject<Creature>, public MapObject
bool CanFly() const override { return (GetCreatureTemplate()->InhabitType & INHABIT_AIR) != 0; }
void SetReactState(ReactStates st) { m_reactState = st; }
ReactStates GetReactState() { return m_reactState; }
ReactStates GetReactState() const { return m_reactState; }
bool HasReactState(ReactStates state) const { return (m_reactState == state); }
void InitializeReactState();
@@ -538,7 +538,7 @@ class Creature : public Unit, public GridObject<Creature>, public MapObject
void SetCanDualWield(bool value) override;
int8 GetOriginalEquipmentId() const { return m_originalEquipmentId; }
uint8 GetCurrentEquipmentId() { return m_equipmentId; }
uint8 GetCurrentEquipmentId() const { return m_equipmentId; }
void SetCurrentEquipmentId(uint8 id) { m_equipmentId = id; }
float GetSpellDamageMod(int32 Rank) const;
@@ -583,7 +583,7 @@ class Creature : public Unit, public GridObject<Creature>, public MapObject
void SetLootRecipient (Unit* unit);
void AllLootRemovedFromCorpse();
uint16 GetLootMode() { return m_LootMode; }
uint16 GetLootMode() const { return m_LootMode; }
bool HasLootMode(uint16 lootMode) { return (m_LootMode & lootMode) != 0; }
void SetLootMode(uint16 lootMode) { m_LootMode = lootMode; }
void AddLootMode(uint16 lootMode) { m_LootMode |= lootMode; }
@@ -611,7 +611,7 @@ class Creature : public Unit, public GridObject<Creature>, public MapObject
void CallAssistance();
void SetNoCallAssistance(bool val) { m_AlreadyCallAssistance = val; }
void SetNoSearchAssistance(bool val) { m_AlreadySearchedAssistance = val; }
bool HasSearchedAssistance() { return m_AlreadySearchedAssistance; }
bool HasSearchedAssistance() const { return m_AlreadySearchedAssistance; }
bool CanAssistTo(const Unit* u, const Unit* enemy, bool checkfaction = true) const;
bool _IsTargetAcceptable(const Unit* target) const;
@@ -675,7 +675,7 @@ class Creature : public Unit, public GridObject<Creature>, public MapObject
Unit* SelectVictim();
void SetDisableReputationGain(bool disable) { DisableReputationGain = disable; }
bool IsReputationGainDisabled() { return DisableReputationGain; }
bool IsReputationGainDisabled() const { return DisableReputationGain; }
bool IsDamageEnoughForLootingAndReward() const { return m_PlayerDamageReq == 0; }
void LowerPlayerDamageReq(uint32 unDamage);
void ResetPlayerDamageReq() { m_PlayerDamageReq = GetHealth() / 2; }

View File

@@ -53,7 +53,7 @@ class TempSummon : public Creature
Creature* GetSummonerCreatureBase() const;
ObjectGuid GetSummonerGUID() const { return m_summonerGUID; }
TempSummonType const& GetSummonType() { return m_type; }
uint32 GetTimer() { return m_timer; }
uint32 GetTimer() const { return m_timer; }
const SummonPropertiesEntry* const m_Properties;
private:

View File

@@ -982,8 +982,8 @@ class GameObject : public WorldObject, public GridObject<GameObject>, public Map
// Note: unit is only used when s = GO_ACTIVATED
void SetLootState(LootState s, Unit* unit = NULL);
uint16 GetLootMode() { return m_LootMode; }
bool HasLootMode(uint16 lootMode) { return (m_LootMode & lootMode) != 0; }
uint16 GetLootMode() const { return m_LootMode; }
bool HasLootMode(uint16 lootMode) const { return (m_LootMode & lootMode) != 0; }
void SetLootMode(uint16 lootMode) { m_LootMode = lootMode; }
void AddLootMode(uint16 lootMode) { m_LootMode |= lootMode; }
void RemoveLootMode(uint16 lootMode) { m_LootMode &= ~lootMode; }

View File

@@ -498,7 +498,7 @@ class WorldObject : public Object, public WorldLocation
std::set<uint32> const& GetPhases() const { return _phases; }
std::set<uint32> const& GetTerrainSwaps() const { return _terrainSwaps; }
std::set<uint32> const& GetWorldMapAreaSwaps() const { return _worldMapAreaSwaps; }
int32 GetDBPhase() { return _dbPhase; }
int32 GetDBPhase() const { return _dbPhase; }
// if negative it is used as PhaseGroupId
void SetDBPhase(int32 p) { _dbPhase = p; }

View File

@@ -1718,7 +1718,7 @@ void Pet::InitTalentForLevel()
*/
}
uint8 Pet::GetMaxTalentPointsForLevel(uint8 level)
uint8 Pet::GetMaxTalentPointsForLevel(uint8 level) const
{
uint8 points = (level >= 20) ? ((level - 16) / 4) : 0;
// Mod points from owner SPELL_AURA_MOD_PET_TALENT_POINTS

View File

@@ -128,8 +128,8 @@ class Pet : public Guardian
static void resetTalentsForAllPetsOf(Player* owner, Pet* online_pet = nullptr);
void InitTalentForLevel();
uint8 GetMaxTalentPointsForLevel(uint8 level);
uint8 GetFreeTalentPoints() { return GetByteValue(UNIT_FIELD_BYTES_1, 1); }
uint8 GetMaxTalentPointsForLevel(uint8 level) const;
uint8 GetFreeTalentPoints() const { return GetByteValue(UNIT_FIELD_BYTES_1, 1); }
void SetFreeTalentPoints(uint8 points) { SetByteValue(UNIT_FIELD_BYTES_1, 1, points); }
uint32 m_usedTalentCount;

View File

@@ -1417,8 +1417,8 @@ class Player : public Unit, public GridObject<Player>
time_t m_logintime;
time_t m_Last_tick;
uint32 m_Played_time[MAX_PLAYED_TIME_INDEX];
uint32 GetTotalPlayedTime() { return m_Played_time[PLAYED_TIME_TOTAL]; }
uint32 GetLevelPlayedTime() { return m_Played_time[PLAYED_TIME_LEVEL]; }
uint32 GetTotalPlayedTime() const { return m_Played_time[PLAYED_TIME_TOTAL]; }
uint32 GetLevelPlayedTime() const { return m_Played_time[PLAYED_TIME_LEVEL]; }
void setDeathState(DeathState s) override; // overwrite Unit::setDeathState
@@ -1834,7 +1834,7 @@ class Player : public Unit, public GridObject<Player>
void RemoveMail(uint32 id);
void AddMail(Mail* mail) { m_mail.push_front(mail);}// for call from WorldSession::SendMailTo
uint32 GetMailSize() { return uint32(m_mail.size()); }
uint32 GetMailSize() const { return uint32(m_mail.size()); }
Mail* GetMail(uint32 id);
PlayerMails const& GetMails() const { return m_mail; }
@@ -1951,7 +1951,7 @@ class Player : public Unit, public GridObject<Player>
void SetSpellModTakingSpell(Spell* spell, bool apply);
void RemoveArenaSpellCooldowns(bool removeActivePetCooldowns = false);
uint32 GetLastPotionId() { return m_lastPotionId; }
uint32 GetLastPotionId() const { return m_lastPotionId; }
void SetLastPotionId(uint32 item_id) { m_lastPotionId = item_id; }
void UpdatePotionCooldown(Spell* spell = NULL);
@@ -2016,14 +2016,14 @@ class Player : public Unit, public GridObject<Player>
void SetRank(uint8 rankId) { SetUInt32Value(PLAYER_GUILDRANK, rankId); }
uint8 GetRank() const { return uint8(GetUInt32Value(PLAYER_GUILDRANK)); }
void SetGuildLevel(uint32 level) { SetUInt32Value(PLAYER_GUILDLEVEL, level); }
uint32 GetGuildLevel() { return GetUInt32Value(PLAYER_GUILDLEVEL); }
uint32 GetGuildLevel() const { return GetUInt32Value(PLAYER_GUILDLEVEL); }
void SetGuildIdInvited(ObjectGuid::LowType GuildId) { m_GuildIdInvited = GuildId; }
ObjectGuid::LowType GetGuildId() const { return GetUInt64Value(OBJECT_FIELD_DATA); /* return only lower part */ }
Guild* GetGuild();
Guild const* GetGuild() const;
static ObjectGuid::LowType GetGuildIdFromDB(ObjectGuid guid);
static uint8 GetRankFromDB(ObjectGuid guid);
ObjectGuid::LowType GetGuildIdInvited() { return m_GuildIdInvited; }
ObjectGuid::LowType GetGuildIdInvited() const { return m_GuildIdInvited; }
static void RemovePetitionsAndSigns(ObjectGuid guid);
// Arena Team
@@ -2034,7 +2034,7 @@ class Player : public Unit, public GridObject<Player>
uint32 GetArenaTeamId(uint8 slot) const { return GetUInt32Value(PLAYER_FIELD_ARENA_TEAM_INFO_1_1 + (slot * ARENA_TEAM_END) + ARENA_TEAM_ID); }
uint32 GetArenaPersonalRating(uint8 slot) const { return GetUInt32Value(PLAYER_FIELD_ARENA_TEAM_INFO_1_1 + (slot * ARENA_TEAM_END) + ARENA_TEAM_PERSONAL_RATING); }
void SetArenaTeamIdInvited(uint32 ArenaTeamId) { m_ArenaTeamIdInvited = ArenaTeamId; }
uint32 GetArenaTeamIdInvited() { return m_ArenaTeamIdInvited; }
uint32 GetArenaTeamIdInvited() const { return m_ArenaTeamIdInvited; }
uint32 GetRBGPersonalRating() const { return 0; }
Difficulty GetDifficultyID(MapEntry const* mapEntry) const;
@@ -2216,7 +2216,7 @@ class Player : public Unit, public GridObject<Player>
bool isHonorOrXPTarget(Unit const* victim) const;
bool GetsRecruitAFriendBonus(bool forXP);
uint8 GetGrantableLevels() { return m_grantableLevels; }
uint8 GetGrantableLevels() const { return m_grantableLevels; }
void SetGrantableLevels(uint8 val) { m_grantableLevels = val; }
ReputationMgr& GetReputationMgr() { return *m_reputationMgr; }
@@ -2357,7 +2357,7 @@ class Player : public Unit, public GridObject<Player>
bool isTotalImmune();
bool CanCaptureTowerPoint();
bool GetRandomWinner() { return m_IsBGRandomWinner; }
bool GetRandomWinner() const { return m_IsBGRandomWinner; }
void SetRandomWinner(bool isWinner);
/*********************************************************/
@@ -2554,7 +2554,7 @@ class Player : public Unit, public GridObject<Player>
uint32 GetRuneBaseCooldown(uint8 index) const { return GetRuneTypeBaseCooldown(GetBaseRune(index)); }
uint32 GetRuneTypeBaseCooldown(RuneType runeType) const;
bool IsBaseRuneSlotsOnCooldown(RuneType runeType) const;
RuneType GetLastUsedRune() { return m_runes->lastUsedRune; }
RuneType GetLastUsedRune() const { return m_runes->lastUsedRune; }
void SetLastUsedRune(RuneType type) { m_runes->lastUsedRune = type; }
void SetBaseRune(uint8 index, RuneType baseRune) { m_runes->runes[index].BaseRune = baseRune; }
void SetCurrentRune(uint8 index, RuneType currentRune) { m_runes->runes[index].CurrentRune = currentRune; }

View File

@@ -385,7 +385,7 @@ private:
void SetTrackedCriteriaIds(std::set<uint32> criteriaIds) { m_trackedCriteriaIds.swap(criteriaIds); }
bool IsTrackingCriteriaId(uint32 criteriaId) const { return m_trackedCriteriaIds.find(criteriaId) != m_trackedCriteriaIds.end(); }
bool IsOnline() { return (m_flags & GUILDMEMBER_STATUS_ONLINE); }
bool IsOnline() const { return (m_flags & GUILDMEMBER_STATUS_ONLINE); }
void ChangeRank(uint8 newRank);
@@ -857,7 +857,7 @@ public:
void DeleteMember(ObjectGuid guid, bool isDisbanding = false, bool isKicked = false, bool canDeleteGuild = false);
bool ChangeMemberRank(ObjectGuid guid, uint8 newRank);
bool IsMember(ObjectGuid guid) const;
uint32 GetMembersCount() { return uint32(m_members.size()); }
uint32 GetMembersCount() const { return uint32(m_members.size()); }
// Bank
void SwapItems(Player* player, uint8 tabId, uint8 slotId, uint8 destTabId, uint8 destSlotId, uint32 splitedAmount);

View File

@@ -666,19 +666,19 @@ void InstanceSaveManager::_ResetOrWarnAll(uint32 mapid, Difficulty difficulty, b
/// @todo delete creature/gameobject respawn times even if the maps are not loaded
}
uint32 InstanceSaveManager::GetNumBoundPlayersTotal()
uint32 InstanceSaveManager::GetNumBoundPlayersTotal() const
{
uint32 ret = 0;
for (InstanceSaveHashMap::iterator itr = m_instanceSaveById.begin(); itr != m_instanceSaveById.end(); ++itr)
for (InstanceSaveHashMap::const_iterator itr = m_instanceSaveById.begin(); itr != m_instanceSaveById.end(); ++itr)
ret += itr->second->GetPlayerCount();
return ret;
}
uint32 InstanceSaveManager::GetNumBoundGroupsTotal()
uint32 InstanceSaveManager::GetNumBoundGroupsTotal() const
{
uint32 ret = 0;
for (InstanceSaveHashMap::iterator itr = m_instanceSaveById.begin(); itr != m_instanceSaveById.end(); ++itr)
for (InstanceSaveHashMap::const_iterator itr = m_instanceSaveById.begin(); itr != m_instanceSaveById.end(); ++itr)
ret += itr->second->GetGroupCount();
return ret;

View File

@@ -222,9 +222,9 @@ class InstanceSaveManager
InstanceSave* GetInstanceSave(uint32 InstanceId);
/* statistics */
uint32 GetNumInstanceSaves() { return uint32(m_instanceSaveById.size()); }
uint32 GetNumBoundPlayersTotal();
uint32 GetNumBoundGroupsTotal();
uint32 GetNumInstanceSaves() const { return uint32(m_instanceSaveById.size()); }
uint32 GetNumBoundPlayersTotal() const;
uint32 GetNumBoundGroupsTotal() const;
protected:
static uint16 ResetTimeDelay[];

View File

@@ -732,7 +732,7 @@ class InstanceMap : public Map
void Update(const uint32) override;
void CreateInstanceData(bool load);
bool Reset(uint8 method);
uint32 GetScriptId() { return i_script_id; }
uint32 GetScriptId() const { return i_script_id; }
InstanceScript* GetInstanceScript() { return i_data; }
void PermBindAllPlayers(Player* source);
void UnloadAll() override;

View File

@@ -39,7 +39,7 @@ class MovementGenerator
virtual bool Update(Unit*, uint32 time_diff) = 0;
virtual MovementGeneratorType GetMovementGeneratorType() = 0;
virtual MovementGeneratorType GetMovementGeneratorType() const = 0;
virtual void unitSpeedChanged() { }

View File

@@ -33,7 +33,7 @@ class ConfusedMovementGenerator : public MovementGeneratorMedium< T, ConfusedMov
void DoReset(T*);
bool DoUpdate(T*, uint32);
MovementGeneratorType GetMovementGeneratorType() { return CONFUSED_MOTION_TYPE; }
MovementGeneratorType GetMovementGeneratorType() const override { return CONFUSED_MOTION_TYPE; }
private:
TimeTracker i_nextMoveTime;
float i_x, i_y, i_z;

View File

@@ -32,7 +32,7 @@ class FleeingMovementGenerator : public MovementGeneratorMedium< T, FleeingMovem
void DoReset(T*);
bool DoUpdate(T*, uint32);
MovementGeneratorType GetMovementGeneratorType() { return FLEEING_MOTION_TYPE; }
MovementGeneratorType GetMovementGeneratorType() const override { return FLEEING_MOTION_TYPE; }
private:
void _setTargetLocation(T*);
@@ -49,7 +49,7 @@ class TimedFleeingMovementGenerator : public FleeingMovementGenerator<Creature>
FleeingMovementGenerator<Creature>(fright),
i_totalFleeTime(time) { }
MovementGeneratorType GetMovementGeneratorType() override { return TIMED_FLEEING_MOTION_TYPE; }
MovementGeneratorType GetMovementGeneratorType() const override { return TIMED_FLEEING_MOTION_TYPE; }
bool Update(Unit*, uint32) override;
void Finalize(Unit*) override;

View File

@@ -38,7 +38,7 @@ class HomeMovementGenerator<Creature> : public MovementGeneratorMedium< Creature
void DoFinalize(Creature*);
void DoReset(Creature*);
bool DoUpdate(Creature*, const uint32);
MovementGeneratorType GetMovementGeneratorType() override { return HOME_MOTION_TYPE; }
MovementGeneratorType GetMovementGeneratorType() const override { return HOME_MOTION_TYPE; }
private:
void _setTargetLocation(Creature*);

View File

@@ -29,7 +29,7 @@ class IdleMovementGenerator : public MovementGenerator
void Finalize(Unit*) override { }
void Reset(Unit*) override;
bool Update(Unit*, uint32) override { return true; }
MovementGeneratorType GetMovementGeneratorType() override { return IDLE_MOTION_TYPE; }
MovementGeneratorType GetMovementGeneratorType() const override { return IDLE_MOTION_TYPE; }
};
extern IdleMovementGenerator si_idleMovement;
@@ -43,7 +43,7 @@ class RotateMovementGenerator : public MovementGenerator
void Finalize(Unit*) override;
void Reset(Unit* owner) override { Initialize(owner); }
bool Update(Unit*, uint32) override;
MovementGeneratorType GetMovementGeneratorType() override { return ROTATE_MOTION_TYPE; }
MovementGeneratorType GetMovementGeneratorType() const override { return ROTATE_MOTION_TYPE; }
private:
uint32 m_duration, m_maxDuration;
@@ -59,7 +59,7 @@ class DistractMovementGenerator : public MovementGenerator
void Finalize(Unit*) override;
void Reset(Unit* owner) override { Initialize(owner); }
bool Update(Unit*, uint32) override;
MovementGeneratorType GetMovementGeneratorType() override { return DISTRACT_MOTION_TYPE; }
MovementGeneratorType GetMovementGeneratorType() const override { return DISTRACT_MOTION_TYPE; }
private:
uint32 m_timer;
@@ -71,7 +71,7 @@ class AssistanceDistractMovementGenerator : public DistractMovementGenerator
AssistanceDistractMovementGenerator(uint32 timer) :
DistractMovementGenerator(timer) { }
MovementGeneratorType GetMovementGeneratorType() override { return ASSISTANCE_DISTRACT_MOTION_TYPE; }
MovementGeneratorType GetMovementGeneratorType() const override { return ASSISTANCE_DISTRACT_MOTION_TYPE; }
void Finalize(Unit*) override;
};

View File

@@ -38,7 +38,7 @@ class PointMovementGenerator : public MovementGeneratorMedium< T, PointMovementG
void unitSpeedChanged() { i_recalculateSpeed = true; }
MovementGeneratorType GetMovementGeneratorType() { return POINT_MOTION_TYPE; }
MovementGeneratorType GetMovementGeneratorType() const override { return POINT_MOTION_TYPE; }
void GetDestination(float& x, float& y, float& z) const { x = i_x; y = i_y; z = i_z; }
private:
@@ -55,7 +55,7 @@ class AssistanceMovementGenerator : public PointMovementGenerator<Creature>
AssistanceMovementGenerator(float _x, float _y, float _z) :
PointMovementGenerator<Creature>(0, _x, _y, _z, true) { }
MovementGeneratorType GetMovementGeneratorType() override { return ASSISTANCE_MOTION_TYPE; }
MovementGeneratorType GetMovementGeneratorType() const override { return ASSISTANCE_MOTION_TYPE; }
void Finalize(Unit*) override;
};
@@ -68,7 +68,7 @@ class EffectMovementGenerator : public MovementGenerator
void Finalize(Unit*) override;
void Reset(Unit*) override { }
bool Update(Unit*, uint32) override;
MovementGeneratorType GetMovementGeneratorType() override { return EFFECT_MOTION_TYPE; }
MovementGeneratorType GetMovementGeneratorType() const override { return EFFECT_MOTION_TYPE; }
private:
uint32 m_Id;
};

View File

@@ -33,7 +33,7 @@ class RandomMovementGenerator : public MovementGeneratorMedium< T, RandomMovemen
void DoReset(T*);
bool DoUpdate(T*, const uint32);
bool GetResetPos(T*, float& x, float& y, float& z);
MovementGeneratorType GetMovementGeneratorType() { return RANDOM_MOTION_TYPE; }
MovementGeneratorType GetMovementGeneratorType() const override { return RANDOM_MOTION_TYPE; }
private:
TimeTrackerSmall i_nextMoveTime;

View File

@@ -73,7 +73,7 @@ class ChaseMovementGenerator : public TargetedMovementGeneratorMedium<T, ChaseMo
: TargetedMovementGeneratorMedium<T, ChaseMovementGenerator<T> >(target, offset, angle) { }
~ChaseMovementGenerator() { }
MovementGeneratorType GetMovementGeneratorType() { return CHASE_MOTION_TYPE; }
MovementGeneratorType GetMovementGeneratorType() const override { return CHASE_MOTION_TYPE; }
void DoInitialize(T*);
void DoFinalize(T*);
@@ -97,7 +97,7 @@ class FollowMovementGenerator : public TargetedMovementGeneratorMedium<T, Follow
: TargetedMovementGeneratorMedium<T, FollowMovementGenerator<T> >(target, offset, angle) { }
~FollowMovementGenerator() { }
MovementGeneratorType GetMovementGeneratorType() { return FOLLOW_MOTION_TYPE; }
MovementGeneratorType GetMovementGeneratorType() const override { return FOLLOW_MOTION_TYPE; }
void DoInitialize(T*);
void DoFinalize(T*);

View File

@@ -72,7 +72,7 @@ class WaypointMovementGenerator<Creature> : public MovementGeneratorMedium< Crea
void MovementInform(Creature*);
MovementGeneratorType GetMovementGeneratorType() override { return WAYPOINT_MOTION_TYPE; }
MovementGeneratorType GetMovementGeneratorType() const override { return WAYPOINT_MOTION_TYPE; }
// now path movement implmementation
void LoadPath(Creature*);
@@ -126,7 +126,7 @@ class FlightPathMovementGenerator : public MovementGeneratorMedium< Player, Flig
void DoReset(Player*);
void DoFinalize(Player*);
bool DoUpdate(Player*, uint32);
MovementGeneratorType GetMovementGeneratorType() override { return FLIGHT_MOTION_TYPE; }
MovementGeneratorType GetMovementGeneratorType() const override { return FLIGHT_MOTION_TYPE; }
TaxiPathNodeList const& GetPath() { return *i_path; }
uint32 GetPathAtMapEnd() const;

View File

@@ -236,7 +236,7 @@ class OutdoorPvP : public ZoneScript
// awards rewards for player kill
virtual void AwardKillBonus(Player* /*player*/) { }
uint32 GetTypeId() {return m_TypeId;}
uint32 GetTypeId() const {return m_TypeId;}
virtual bool HandleDropFlag(Player* player, uint32 spellId);

View File

@@ -782,7 +782,7 @@ class WorldSession
std::string GetPlayerInfo() const;
void SetSecurity(AccountTypes security) { _security = security; }
std::string const& GetRemoteAddress() { return m_Address; }
std::string const& GetRemoteAddress() const { return m_Address; }
void SetPlayer(Player* player);
uint8 GetExpansion() const { return m_expansion; }

View File

@@ -77,7 +77,7 @@ public:
return name;
}
std::string const& GetComment() { return _comment; }
std::string const& GetComment() const { return _comment; }
virtual void SetAssignedTo(ObjectGuid guid, bool /*isAdmin*/ = false) { _assignedTo = guid; }
virtual void SetUnassigned() { _assignedTo.Clear(); }
@@ -225,11 +225,11 @@ public:
void Initialize();
bool GetSupportSystemStatus() { return _supportSystemStatus; }
bool GetTicketSystemStatus() { return _supportSystemStatus && _ticketSystemStatus; }
bool GetBugSystemStatus() { return _supportSystemStatus && _bugSystemStatus; }
bool GetComplaintSystemStatus() { return _supportSystemStatus && _complaintSystemStatus; }
bool GetSuggestionSystemStatus() { return _supportSystemStatus && _suggestionSystemStatus; }
bool GetSupportSystemStatus() const { return _supportSystemStatus; }
bool GetTicketSystemStatus() const { return _supportSystemStatus && _ticketSystemStatus; }
bool GetBugSystemStatus() const { return _supportSystemStatus && _bugSystemStatus; }
bool GetComplaintSystemStatus() const { return _supportSystemStatus && _complaintSystemStatus; }
bool GetSuggestionSystemStatus() const { return _supportSystemStatus && _suggestionSystemStatus; }
uint64 GetLastChange() const { return _lastChange; }
template<typename T>
uint32 GetOpenTicketCount() const;

View File

@@ -32,7 +32,7 @@ class BasicStatementTask : public SQLOperation
~BasicStatementTask();
bool Execute() override;
QueryResultFuture GetFuture() { return m_result->get_future(); }
QueryResultFuture GetFuture() const { return m_result->get_future(); }
private:
const char* m_sql; //- Raw query to be executed