Skip to content

Commit

Permalink
Core/Game: Converted the game library to a shared library.
Browse files Browse the repository at this point in the history
* There is still the possibility to static link against game.

(cherry picked from commit bf33159)
  • Loading branch information
Naios committed Mar 24, 2016
1 parent 522f769 commit 9f61b72
Show file tree
Hide file tree
Showing 147 changed files with 757 additions and 703 deletions.
12 changes: 6 additions & 6 deletions src/server/game/AI/CoreAI/CombatAI.h
Expand Up @@ -25,7 +25,7 @@

class Creature;

class AggressorAI : public CreatureAI
class TC_GAME_API AggressorAI : public CreatureAI
{
public:
explicit AggressorAI(Creature* c) : CreatureAI(c) { }
Expand All @@ -36,7 +36,7 @@ class AggressorAI : public CreatureAI

typedef std::vector<uint32> SpellVct;

class CombatAI : public CreatureAI
class TC_GAME_API CombatAI : public CreatureAI
{
public:
explicit CombatAI(Creature* c) : CreatureAI(c) { }
Expand All @@ -55,7 +55,7 @@ class CombatAI : public CreatureAI
SpellVct spells;
};

class CasterAI : public CombatAI
class TC_GAME_API CasterAI : public CombatAI
{
public:
explicit CasterAI(Creature* c) : CombatAI(c) { m_attackDist = MELEE_RANGE; }
Expand All @@ -67,7 +67,7 @@ class CasterAI : public CombatAI
float m_attackDist;
};

struct ArcherAI : public CreatureAI
struct TC_GAME_API ArcherAI : public CreatureAI
{
public:
explicit ArcherAI(Creature* c);
Expand All @@ -80,7 +80,7 @@ struct ArcherAI : public CreatureAI
float m_minRange;
};

struct TurretAI : public CreatureAI
struct TC_GAME_API TurretAI : public CreatureAI
{
public:
explicit TurretAI(Creature* c);
Expand All @@ -97,7 +97,7 @@ struct TurretAI : public CreatureAI
#define VEHICLE_CONDITION_CHECK_TIME 1000
#define VEHICLE_DISMISS_TIME 5000

struct VehicleAI : public CreatureAI
struct TC_GAME_API VehicleAI : public CreatureAI
{
public:
explicit VehicleAI(Creature* creature);
Expand Down
4 changes: 2 additions & 2 deletions src/server/game/AI/CoreAI/GameObjectAI.h
Expand Up @@ -26,7 +26,7 @@
#include "GameObject.h"
#include "CreatureAI.h"

class GameObjectAI
class TC_GAME_API GameObjectAI
{
protected:
GameObject* const go;
Expand Down Expand Up @@ -63,7 +63,7 @@ class GameObjectAI
virtual void EventInform(uint32 /*eventId*/) { }
};

class NullGameObjectAI : public GameObjectAI
class TC_GAME_API NullGameObjectAI : public GameObjectAI
{
public:
explicit NullGameObjectAI(GameObject* g);
Expand Down
2 changes: 1 addition & 1 deletion src/server/game/AI/CoreAI/GuardAI.h
Expand Up @@ -23,7 +23,7 @@

class Creature;

class GuardAI : public ScriptedAI
class TC_GAME_API GuardAI : public ScriptedAI
{
public:
explicit GuardAI(Creature* creature);
Expand Down
10 changes: 5 additions & 5 deletions src/server/game/AI/CoreAI/PassiveAI.h
Expand Up @@ -21,7 +21,7 @@

#include "CreatureAI.h"

class PassiveAI : public CreatureAI
class TC_GAME_API PassiveAI : public CreatureAI
{
public:
explicit PassiveAI(Creature* c);
Expand All @@ -33,7 +33,7 @@ class PassiveAI : public CreatureAI
static int Permissible(const Creature*) { return PERMIT_BASE_IDLE; }
};

class PossessedAI : public CreatureAI
class TC_GAME_API PossessedAI : public CreatureAI
{
public:
explicit PossessedAI(Creature* c);
Expand All @@ -49,7 +49,7 @@ class PossessedAI : public CreatureAI
static int Permissible(const Creature*) { return PERMIT_BASE_IDLE; }
};

class NullCreatureAI : public CreatureAI
class TC_GAME_API NullCreatureAI : public CreatureAI
{
public:
explicit NullCreatureAI(Creature* c);
Expand All @@ -63,7 +63,7 @@ class NullCreatureAI : public CreatureAI
static int Permissible(const Creature*) { return PERMIT_BASE_IDLE; }
};

class CritterAI : public PassiveAI
class TC_GAME_API CritterAI : public PassiveAI
{
public:
explicit CritterAI(Creature* c) : PassiveAI(c) { }
Expand All @@ -72,7 +72,7 @@ class CritterAI : public PassiveAI
void EnterEvadeMode(EvadeReason why) override;
};

class TriggerAI : public NullCreatureAI
class TC_GAME_API TriggerAI : public NullCreatureAI
{
public:
explicit TriggerAI(Creature* c) : NullCreatureAI(c) { }
Expand Down
2 changes: 1 addition & 1 deletion src/server/game/AI/CoreAI/PetAI.h
Expand Up @@ -25,7 +25,7 @@
class Creature;
class Spell;

class PetAI : public CreatureAI
class TC_GAME_API PetAI : public CreatureAI
{
public:

Expand Down
2 changes: 1 addition & 1 deletion src/server/game/AI/CoreAI/ReactorAI.h
Expand Up @@ -23,7 +23,7 @@

class Unit;

class ReactorAI : public CreatureAI
class TC_GAME_API ReactorAI : public CreatureAI
{
public:

Expand Down
2 changes: 1 addition & 1 deletion src/server/game/AI/CoreAI/TotemAI.h
Expand Up @@ -25,7 +25,7 @@
class Creature;
class Totem;

class TotemAI : public CreatureAI
class TC_GAME_API TotemAI : public CreatureAI
{
public:

Expand Down
8 changes: 4 additions & 4 deletions src/server/game/AI/CoreAI/UnitAI.h
Expand Up @@ -40,7 +40,7 @@ enum SelectAggroTarget
};

// default predicate function to select target based on distance, player and/or aura criteria
struct DefaultTargetSelector : public std::unary_function<Unit*, bool>
struct TC_GAME_API DefaultTargetSelector : public std::unary_function<Unit*, bool>
{
const Unit* me;
float m_dist;
Expand Down Expand Up @@ -90,7 +90,7 @@ struct DefaultTargetSelector : public std::unary_function<Unit*, bool>

// Target selector for spell casts checking range, auras and attributes
/// @todo Add more checks from Spell::CheckCast
struct SpellTargetSelector : public std::unary_function<Unit*, bool>
struct TC_GAME_API SpellTargetSelector : public std::unary_function<Unit*, bool>
{
public:
SpellTargetSelector(Unit* caster, uint32 spellId);
Expand All @@ -104,7 +104,7 @@ struct SpellTargetSelector : public std::unary_function<Unit*, bool>
// Very simple target selector, will just skip main target
// NOTE: When passing to UnitAI::SelectTarget remember to use 0 as position for random selection
// because tank will not be in the temporary list
struct NonTankTargetSelector : public std::unary_function<Unit*, bool>
struct TC_GAME_API NonTankTargetSelector : public std::unary_function<Unit*, bool>
{
public:
NonTankTargetSelector(Unit* source, bool playerOnly = true) : _source(source), _playerOnly(playerOnly) { }
Expand All @@ -115,7 +115,7 @@ struct NonTankTargetSelector : public std::unary_function<Unit*, bool>
bool _playerOnly;
};

class UnitAI
class TC_GAME_API UnitAI
{
protected:
Unit* const me;
Expand Down
2 changes: 1 addition & 1 deletion src/server/game/AI/CreatureAI.h
Expand Up @@ -66,7 +66,7 @@ enum SCEquip
};

typedef std::set<AreaBoundary const*> CreatureBoundary;
class CreatureAI : public UnitAI
class TC_GAME_API CreatureAI : public UnitAI
{
protected:
Creature* const me;
Expand Down
6 changes: 3 additions & 3 deletions src/server/game/AI/CreatureAISelector.h
Expand Up @@ -27,9 +27,9 @@ class GameObject;

namespace FactorySelector
{
CreatureAI* selectAI(Creature*);
MovementGenerator* selectMovementGenerator(Creature*);
GameObjectAI* SelectGameObjectAI(GameObject*);
TC_GAME_API CreatureAI* selectAI(Creature*);
TC_GAME_API MovementGenerator* selectMovementGenerator(Creature*);
TC_GAME_API GameObjectAI* SelectGameObjectAI(GameObject*);
}
#endif

2 changes: 1 addition & 1 deletion src/server/game/AI/PlayerAI/PlayerAI.h
Expand Up @@ -22,7 +22,7 @@
#include "Player.h"
#include "Creature.h"

class PlayerAI : public UnitAI
class TC_GAME_API PlayerAI : public UnitAI
{
public:
explicit PlayerAI(Player* player) : UnitAI(static_cast<Unit*>(player)), me(player), _isSelfHealer(PlayerAI::IsPlayerHealer(player)), _isSelfRangedAttacker(PlayerAI::IsPlayerRangedAttacker(player)) { }
Expand Down
10 changes: 5 additions & 5 deletions src/server/game/AI/ScriptedAI/ScriptedCreature.cpp
Expand Up @@ -628,27 +628,27 @@ void WorldBossAI::UpdateAI(uint32 diff)
}

// SD2 grid searchers.
Creature* GetClosestCreatureWithEntry(WorldObject* source, uint32 entry, float maxSearchRange, bool alive /*= true*/)
TC_GAME_API Creature* GetClosestCreatureWithEntry(WorldObject* source, uint32 entry, float maxSearchRange, bool alive /*= true*/)
{
return source->FindNearestCreature(entry, maxSearchRange, alive);
}

GameObject* GetClosestGameObjectWithEntry(WorldObject* source, uint32 entry, float maxSearchRange)
TC_GAME_API GameObject* GetClosestGameObjectWithEntry(WorldObject* source, uint32 entry, float maxSearchRange)
{
return source->FindNearestGameObject(entry, maxSearchRange);
}

void GetCreatureListWithEntryInGrid(std::list<Creature*>& list, WorldObject* source, uint32 entry, float maxSearchRange)
TC_GAME_API void GetCreatureListWithEntryInGrid(std::list<Creature*>& list, WorldObject* source, uint32 entry, float maxSearchRange)
{
source->GetCreatureListWithEntryInGrid(list, entry, maxSearchRange);
}

void GetGameObjectListWithEntryInGrid(std::list<GameObject*>& list, WorldObject* source, uint32 entry, float maxSearchRange)
TC_GAME_API void GetGameObjectListWithEntryInGrid(std::list<GameObject*>& list, WorldObject* source, uint32 entry, float maxSearchRange)
{
source->GetGameObjectListWithEntryInGrid(list, entry, maxSearchRange);
}

void GetPlayerListInGrid(std::list<Player*>& list, WorldObject* source, float maxSearchRange)
TC_GAME_API void GetPlayerListInGrid(std::list<Player*>& list, WorldObject* source, float maxSearchRange)
{
source->GetPlayerListInGrid(list, maxSearchRange);
}
22 changes: 11 additions & 11 deletions src/server/game/AI/ScriptedAI/ScriptedCreature.h
Expand Up @@ -38,7 +38,7 @@ T* EnsureAI(U* ai)

class InstanceScript;

class SummonList
class TC_GAME_API SummonList
{
public:
typedef GuidList StorageType;
Expand Down Expand Up @@ -123,7 +123,7 @@ class SummonList
StorageType storage_;
};

class EntryCheckPredicate
class TC_GAME_API EntryCheckPredicate
{
public:
EntryCheckPredicate(uint32 entry) : _entry(entry) { }
Expand All @@ -133,13 +133,13 @@ class EntryCheckPredicate
uint32 _entry;
};

class DummyEntryCheckPredicate
class TC_GAME_API DummyEntryCheckPredicate
{
public:
bool operator()(ObjectGuid) { return true; }
};

struct ScriptedAI : public CreatureAI
struct TC_GAME_API ScriptedAI : public CreatureAI
{
explicit ScriptedAI(Creature* creature);
virtual ~ScriptedAI() { }
Expand Down Expand Up @@ -334,7 +334,7 @@ struct ScriptedAI : public CreatureAI
bool _isHeroic;
};

class BossAI : public ScriptedAI
class TC_GAME_API BossAI : public ScriptedAI
{
public:
BossAI(Creature* creature, uint32 bossId);
Expand Down Expand Up @@ -379,7 +379,7 @@ class BossAI : public ScriptedAI
uint32 const _bossId;
};

class WorldBossAI : public ScriptedAI
class TC_GAME_API WorldBossAI : public ScriptedAI
{
public:
WorldBossAI(Creature* creature);
Expand Down Expand Up @@ -410,10 +410,10 @@ class WorldBossAI : public ScriptedAI
};

// SD2 grid searchers.
Creature* GetClosestCreatureWithEntry(WorldObject* source, uint32 entry, float maxSearchRange, bool alive = true);
GameObject* GetClosestGameObjectWithEntry(WorldObject* source, uint32 entry, float maxSearchRange);
void GetCreatureListWithEntryInGrid(std::list<Creature*>& list, WorldObject* source, uint32 entry, float maxSearchRange);
void GetGameObjectListWithEntryInGrid(std::list<GameObject*>& list, WorldObject* source, uint32 entry, float maxSearchRange);
void GetPlayerListInGrid(std::list<Player*>& list, WorldObject* source, float maxSearchRange);
TC_GAME_API Creature* GetClosestCreatureWithEntry(WorldObject* source, uint32 entry, float maxSearchRange, bool alive = true);
TC_GAME_API GameObject* GetClosestGameObjectWithEntry(WorldObject* source, uint32 entry, float maxSearchRange);
TC_GAME_API void GetCreatureListWithEntryInGrid(std::list<Creature*>& list, WorldObject* source, uint32 entry, float maxSearchRange);
TC_GAME_API void GetGameObjectListWithEntryInGrid(std::list<GameObject*>& list, WorldObject* source, uint32 entry, float maxSearchRange);
TC_GAME_API void GetPlayerListInGrid(std::list<Player*>& list, WorldObject* source, float maxSearchRange);

#endif // SCRIPTEDCREATURE_H_
2 changes: 1 addition & 1 deletion src/server/game/AI/ScriptedAI/ScriptedEscortAI.h
Expand Up @@ -49,7 +49,7 @@ enum eEscortState
STATE_ESCORT_PAUSED = 0x004 //will not proceed with waypoints before state is removed
};

struct npc_escortAI : public ScriptedAI
struct TC_GAME_API npc_escortAI : public ScriptedAI
{
public:
explicit npc_escortAI(Creature* creature);
Expand Down
2 changes: 1 addition & 1 deletion src/server/game/AI/ScriptedAI/ScriptedFollowerAI.h
Expand Up @@ -32,7 +32,7 @@ enum eFollowState
STATE_FOLLOW_POSTEVENT = 0x020 //can be set at complete and allow post event to run
};

class FollowerAI : public ScriptedAI
class TC_GAME_API FollowerAI : public ScriptedAI
{
public:
explicit FollowerAI(Creature* creature);
Expand Down
4 changes: 2 additions & 2 deletions src/server/game/AI/SmartScripts/SmartAI.h
Expand Up @@ -42,7 +42,7 @@ enum SmartEscortVars
SMART_MAX_AID_DIST = SMART_ESCORT_MAX_PLAYER_DIST / 2
};

class SmartAI : public CreatureAI
class TC_GAME_API SmartAI : public CreatureAI
{
public:
~SmartAI(){ }
Expand Down Expand Up @@ -230,7 +230,7 @@ class SmartAI : public CreatureAI
bool mJustReset;
};

class SmartGameObjectAI : public GameObjectAI
class TC_GAME_API SmartGameObjectAI : public GameObjectAI
{
public:
SmartGameObjectAI(GameObject* g) : GameObjectAI(g) { }
Expand Down
2 changes: 1 addition & 1 deletion src/server/game/AI/SmartScripts/SmartScript.h
Expand Up @@ -28,7 +28,7 @@
#include "SmartScriptMgr.h"
//#include "SmartAI.h"

class SmartScript
class TC_GAME_API SmartScript
{
public:
SmartScript();
Expand Down
4 changes: 2 additions & 2 deletions src/server/game/AI/SmartScripts/SmartScriptMgr.h
Expand Up @@ -1440,7 +1440,7 @@ class ObjectGuidList
};
typedef std::unordered_map<uint32, ObjectGuidList*> ObjectListMap;

class SmartWaypointMgr
class TC_GAME_API SmartWaypointMgr
{
private:
SmartWaypointMgr() { }
Expand Down Expand Up @@ -1472,7 +1472,7 @@ typedef std::unordered_map<int32, SmartAIEventList> SmartAIEventMap;
typedef std::map<uint32 /*entry*/, std::pair<uint32 /*spellId*/, SpellEffIndex /*effIndex*/> > CacheSpellContainer;
typedef std::pair<CacheSpellContainer::const_iterator, CacheSpellContainer::const_iterator> CacheSpellContainerBounds;

class SmartAIMgr
class TC_GAME_API SmartAIMgr
{
private:
SmartAIMgr() { }
Expand Down
2 changes: 1 addition & 1 deletion src/server/game/Accounts/AccountMgr.h
Expand Up @@ -49,7 +49,7 @@ typedef std::map<uint32, rbac::RBACPermission*> RBACPermissionsContainer;
typedef std::map<uint8, rbac::RBACPermissionContainer> RBACDefaultPermissionsContainer;
}

class AccountMgr
class TC_GAME_API AccountMgr
{
private:
AccountMgr();
Expand Down

0 comments on commit 9f61b72

Please sign in to comment.