refactor(Core/Misc): headers cleanup (#9259)

This commit is contained in:
Kargatum
2021-11-22 17:24:39 +07:00
committed by GitHub
parent 699d4835df
commit f62664c987
775 changed files with 1294 additions and 1165 deletions

View File

@@ -15,6 +15,7 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "KillRewarder.h"
#include "Formulas.h"
#include "Group.h"
#include "Pet.h"
@@ -77,7 +78,7 @@ KillRewarder::KillRewarder(Player* killer, Unit* victim, bool isBattleGround) :
_InitGroupData();
}
inline void KillRewarder::_InitGroupData()
void KillRewarder::_InitGroupData()
{
if (_group)
{
@@ -117,7 +118,7 @@ inline void KillRewarder::_InitGroupData()
_count = 1;
}
inline void KillRewarder::_InitXP(Player* player)
void KillRewarder::_InitXP(Player* player)
{
// Get initial value of XP for kill.
// XP is given:
@@ -134,14 +135,14 @@ inline void KillRewarder::_InitXP(Player* player)
_xp = uint32(_xp * ct->ModHealth);
}
inline void KillRewarder::_RewardHonor(Player* player)
void KillRewarder::_RewardHonor(Player* player)
{
// Rewarded player must be alive.
if (player->IsAlive())
player->RewardHonor(_victim, _count, -1);
}
inline void KillRewarder::_RewardXP(Player* player, float rate)
void KillRewarder::_RewardXP(Player* player, float rate)
{
uint32 xp(_xp);
if (_group)
@@ -172,14 +173,14 @@ inline void KillRewarder::_RewardXP(Player* player, float rate)
}
}
inline void KillRewarder::_RewardReputation(Player* player, float rate)
void KillRewarder::_RewardReputation(Player* player, float rate)
{
// 4.3. Give reputation (player must not be on BG).
// Even dead players and corpses are rewarded.
player->RewardReputation(_victim, rate);
}
inline void KillRewarder::_RewardKillCredit(Player* player)
void KillRewarder::_RewardKillCredit(Player* player)
{
// 4.4. Give kill credit (player must not be in group, or he must be alive or without corpse).
if (!_group || player->IsAlive() || !player->GetCorpse())

View File

@@ -15,7 +15,16 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
class KillRewarder
#ifndef __KILL_REWARDER_H__
#define __KILL_REWARDER_H__
#include "Define.h"
class Group;
class Player;
class Unit;
class AC_GAME_API KillRewarder
{
public:
KillRewarder(Player* killer, Unit* victim, bool isBattleGround);
@@ -47,3 +56,5 @@ private:
bool _isBattleGround;
bool _isPvP;
};
#endif

View File

@@ -16,10 +16,13 @@
*/
#include "BattlegroundMgr.h"
#include "GossipDef.h"
#include "Language.h"
#include "ObjectMgr.h"
#include "OutdoorPvPMgr.h"
#include "Pet.h"
#include "Player.h"
#include "WorldSession.h"
/*********************************************************/
/*** GOSSIP SYSTEM ***/

View File

@@ -15,9 +15,11 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "AccountMgr.h"
#include "MapMgr.h"
#include "Player.h"
#include "ScriptMgr.h"
#include "WorldSession.h"
/*********************************************************/
/*** FLOOD FILTER SYSTEM ***/

View File

@@ -18,14 +18,17 @@
#include "CreatureAI.h"
#include "DisableMgr.h"
#include "GameObjectAI.h"
#include "GitRevision.h"
#include "GossipDef.h"
#include "Group.h"
#include "MapMgr.h"
#include "Player.h"
#include "PoolMgr.h"
#include "ReputationMgr.h"
#include "GitRevision.h"
#include "ScriptMgr.h"
#include "SpellAuraEffects.h"
#include "SpellMgr.h"
#include "WorldSession.h"
#ifdef ELUNA
#include "LuaEngine.h"

View File

@@ -28,9 +28,9 @@
#include "Channel.h"
#include "CharacterDatabaseCleaner.h"
#include "Chat.h"
#include "Config.h"
#include "Common.h"
#include "ConditionMgr.h"
#include "Config.h"
#include "CreatureAI.h"
#include "DatabaseEnv.h"
#include "DisableMgr.h"
@@ -43,8 +43,8 @@
#include "Guild.h"
#include "InstanceSaveMgr.h"
#include "InstanceScript.h"
#include "Language.h"
#include "LFGMgr.h"
#include "Language.h"
#include "Log.h"
#include "LootItemStorage.h"
#include "MapMgr.h"
@@ -55,8 +55,8 @@
#include "OutdoorPvPMgr.h"
#include "Pet.h"
#include "Player.h"
#include "QuestDef.h"
#include "QueryHolder.h"
#include "QuestDef.h"
#include "ReputationMgr.h"
#include "SavingSystem.h"
#include "ScriptMgr.h"
@@ -74,6 +74,7 @@
#include "WeatherMgr.h"
#include "World.h"
#include "WorldPacket.h"
#include "WorldSession.h"
#ifdef ELUNA
#include "LuaEngine.h"

View File

@@ -15,6 +15,7 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "ObjectMgr.h"
#include "Player.h"
PlayerTaxi::PlayerTaxi() : _taxiSegment(0)

View File

@@ -15,11 +15,20 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
class PlayerTaxi
#ifndef __PLAYER_TAXI_H__
#define __PLAYER_TAXI_H__
#include "DBCStructure.h"
#include <vector>
class ByteBuffer;
class AC_GAME_API PlayerTaxi
{
public:
PlayerTaxi();
~PlayerTaxi() = default;
// Nodes
void InitTaxiNodesForLevel(uint32 race, uint32 chrClass, uint8 level);
void LoadTaxiMask(std::string const& data);
@@ -30,6 +39,7 @@ public:
uint32 submask = 1 << ((nodeidx - 1) % 32);
return (m_taximask[field] & submask) == submask;
}
bool SetTaximaskNode(uint32 nodeidx)
{
uint8 field = uint8((nodeidx - 1) / 32);
@@ -42,6 +52,7 @@ public:
else
return false;
}
void AppendTaximaskTo(ByteBuffer& data, bool all);
// Destinations
@@ -72,3 +83,5 @@ private:
std::vector<uint32> m_TaxiDestinations;
uint32 _taxiSegment;
};
#endif

View File

@@ -33,6 +33,7 @@
#include "ScriptMgr.h"
#include "SkillDiscovery.h"
#include "SpellAuraEffects.h"
#include "SpellMgr.h"
#include "UpdateFieldFlags.h"
#include "Vehicle.h"
#include "WeatherMgr.h"
@@ -797,8 +798,7 @@ bool Player::UpdateCraftSkill(uint32 spellid)
{
LOG_DEBUG("entities.player.skills", "UpdateCraftSkill spellid %d", spellid);
SkillLineAbilityMapBounds bounds =
sSpellMgr->GetSkillLineAbilityMapBounds(spellid);
SkillLineAbilityMapBounds bounds = sSpellMgr->GetSkillLineAbilityMapBounds(spellid);
for (SkillLineAbilityMap::const_iterator _spell_idx = bounds.first;
_spell_idx != bounds.second; ++_spell_idx)

View File

@@ -15,11 +15,11 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "SocialMgr.h"
#include "AccountMgr.h"
#include "DatabaseEnv.h"
#include "ObjectMgr.h"
#include "Player.h"
#include "SocialMgr.h"
#include "Util.h"
#include "WorldPacket.h"
#include "WorldSession.h"

View File

@@ -20,6 +20,7 @@
#include "Common.h"
#include "DatabaseEnv.h"
#include "ObjectGuid.h"
#include <map>
class Player;

View File

@@ -16,6 +16,7 @@
*/
#include "Player.h"
#include "WorldSession.h"
TradeData* TradeData::GetTraderData() const
{

View File

@@ -15,6 +15,15 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __TRADE_DATA_H__
#define __TRADE_DATA_H__
#include "Define.h"
class Item;
class ObjectGuid;
class Player;
enum TradeSlots
{
TRADE_SLOT_COUNT = 7,
@@ -23,12 +32,11 @@ enum TradeSlots
TRADE_SLOT_INVALID = -1,
};
class TradeData
class AC_GAME_API TradeData
{
public: // constructors
TradeData(Player* player, Player* trader) : m_player(player), m_trader(trader), m_accepted(false), m_acceptProccess(false), m_money(0), m_spell(0)
{
}
TradeData(Player* player, Player* trader) :
m_player(player), m_trader(trader), m_accepted(false), m_acceptProccess(false), m_money(0), m_spell(0) { }
[[nodiscard]] Player* GetTrader() const { return m_trader; }
[[nodiscard]] TradeData* GetTraderData() const;
@@ -70,3 +78,5 @@ private: // fields
ObjectGuid m_items[TRADE_SLOT_COUNT]; // traded itmes from m_player side including non-traded slot
};
#endif