diff --git a/src/game/server/ddracechat.cpp b/src/game/server/ddracechat.cpp index 96a95b07c..f8a1f14c9 100644 --- a/src/game/server/ddracechat.cpp +++ b/src/game/server/ddracechat.cpp @@ -8,6 +8,7 @@ #include "entities/character.h" #include "player.h" +#include "score.h" bool CheckClientID(int ClientID); diff --git a/src/game/server/ddracecommands.cpp b/src/game/server/ddracecommands.cpp index 55027c4a2..d383c9a2d 100644 --- a/src/game/server/ddracecommands.cpp +++ b/src/game/server/ddracecommands.cpp @@ -1,5 +1,8 @@ /* (c) Shereef Marzouk. See "licence DDRace.txt" and the readme.txt in the root of the distribution for more information. */ #include "gamecontext.h" + +#include + #include #include #include diff --git a/src/game/server/entities/character.cpp b/src/game/server/entities/character.cpp index 5a3e6a3a5..84691aeaf 100644 --- a/src/game/server/entities/character.cpp +++ b/src/game/server/entities/character.cpp @@ -1,10 +1,14 @@ /* (c) Magnus Auvinen. See licence.txt in the root of the distribution for more information. */ /* If you are missing that file, acquire a complete release at teeworlds.com. */ #include + +#include + #include #include #include #include +#include #include #include "character.h" diff --git a/src/game/server/entities/character.h b/src/game/server/entities/character.h index 7ea9e1c62..df76eb35f 100644 --- a/src/game/server/entities/character.h +++ b/src/game/server/entities/character.h @@ -3,12 +3,12 @@ #ifndef GAME_SERVER_ENTITIES_CHARACTER_H #define GAME_SERVER_ENTITIES_CHARACTER_H -#include #include #include -class CAntibot; class CGameTeams; +class CGameWorld; +class IAntibot; struct CAntibotCharacterData; enum diff --git a/src/game/server/entities/door.h b/src/game/server/entities/door.h index 944df09a8..cf06f7b73 100644 --- a/src/game/server/entities/door.h +++ b/src/game/server/entities/door.h @@ -4,7 +4,7 @@ #include -class CTrigger; +class CGameWorld; class CDoor : public CEntity { diff --git a/src/game/server/entities/dragger_beam.h b/src/game/server/entities/dragger_beam.h index 3766e7ab0..ffce1f2b1 100644 --- a/src/game/server/entities/dragger_beam.h +++ b/src/game/server/entities/dragger_beam.h @@ -2,9 +2,11 @@ #ifndef GAME_SERVER_ENTITIES_DRAGGER_BEAM_H #define GAME_SERVER_ENTITIES_DRAGGER_BEAM_H -#include "dragger.h" #include +class CDragger; +class CGameWorld; + /** * Dragger beams pull a selected player towards their center * diff --git a/src/game/server/entity.h b/src/game/server/entity.h index 71418bbc6..589d4547a 100644 --- a/src/game/server/entity.h +++ b/src/game/server/entity.h @@ -6,10 +6,10 @@ #include #include "alloc.h" -#include "gamecontext.h" #include "gameworld.h" class CCollision; +class CGameContext; /* Class: Entity @@ -20,12 +20,12 @@ class CEntity MACRO_ALLOC_HEAP() private: - friend class CGameWorld; // entity list handling + friend CGameWorld; // entity list handling CEntity *m_pPrevTypeEntity; CEntity *m_pNextTypeEntity; /* Identity */ - class CGameWorld *m_pGameWorld; + CGameWorld *m_pGameWorld; CCollision *m_pCCollision; int m_ID; @@ -59,7 +59,7 @@ public: // TODO: Maybe make protected /* Objects */ std::vector &Switchers() { return m_pGameWorld->m_Core.m_vSwitchers; } - class CGameWorld *GameWorld() { return m_pGameWorld; } + CGameWorld *GameWorld() { return m_pGameWorld; } class CConfig *Config() { return m_pGameWorld->Config(); } class CGameContext *GameServer() { return m_pGameWorld->GameServer(); } class IServer *Server() { return m_pGameWorld->Server(); } diff --git a/src/game/server/gamecontext.h b/src/game/server/gamecontext.h index 4e4610018..7f765f3e9 100644 --- a/src/game/server/gamecontext.h +++ b/src/game/server/gamecontext.h @@ -3,7 +3,6 @@ #ifndef GAME_SERVER_GAMECONTEXT_H #define GAME_SERVER_GAMECONTEXT_H -#include #include #include @@ -47,15 +46,17 @@ enum NUM_TUNEZONES = 256 }; +class CCharacter; class CConfig; class CHeap; class CPlayer; class CScore; -class IConsole; +class CUnpacker; +class IAntibot; class IGameController; class IEngine; class IStorage; -struct CAntibotData; +struct CAntibotRoundData; struct CScoreRandomMapResult; class CGameContext : public IGameServer @@ -305,7 +306,7 @@ private: // starting 1 to make 0 the special value "no client id" uint32_t NextUniqueClientID = 1; bool m_VoteWillPass; - class CScore *m_pScore; + CScore *m_pScore; //DDRace Console Commands @@ -446,7 +447,7 @@ private: public: CLayers *Layers() { return &m_Layers; } - class CScore *Score() { return m_pScore; } + CScore *Score() { return m_pScore; } enum { diff --git a/src/game/server/gamemodes/DDRace.cpp b/src/game/server/gamemodes/DDRace.cpp index 2cc972c8c..4f6f2889b 100644 --- a/src/game/server/gamemodes/DDRace.cpp +++ b/src/game/server/gamemodes/DDRace.cpp @@ -8,6 +8,7 @@ #include #include #include +#include #include #define GAME_TYPE_NAME "DDraceNetwork" diff --git a/src/game/server/gameworld.cpp b/src/game/server/gameworld.cpp index d6a4f6f6c..06e8abc88 100644 --- a/src/game/server/gameworld.cpp +++ b/src/game/server/gameworld.cpp @@ -5,9 +5,12 @@ #include "entities/character.h" #include "entity.h" #include "gamecontext.h" +#include "gamecontroller.h" #include "player.h" -#include + #include + +#include #include ////////////////////////////////////////////////// diff --git a/src/game/server/gameworld.h b/src/game/server/gameworld.h index 982fb2edd..61d166b4f 100644 --- a/src/game/server/gameworld.h +++ b/src/game/server/gameworld.h @@ -88,8 +88,8 @@ public: Returns: Returns a pointer to the closest hit or NULL of there is no intersection. */ - //class CCharacter *IntersectCharacter(vec2 Pos0, vec2 Pos1, float Radius, vec2 &NewPos, class CEntity *pNotThis = 0); - class CCharacter *IntersectCharacter(vec2 Pos0, vec2 Pos1, float Radius, vec2 &NewPos, class CCharacter *pNotThis = 0, int CollideWith = -1, class CCharacter *pThisOnly = 0); + //CCharacter *IntersectCharacter(vec2 Pos0, vec2 Pos1, float Radius, vec2 &NewPos, class CEntity *pNotThis = 0); + CCharacter *IntersectCharacter(vec2 Pos0, vec2 Pos1, float Radius, vec2 &NewPos, CCharacter *pNotThis = 0, int CollideWith = -1, CCharacter *pThisOnly = 0); /* Function: ClosestCharacter Finds the closest CCharacter to a specific point. @@ -102,7 +102,7 @@ public: Returns: Returns a pointer to the closest CCharacter or NULL if no CCharacter is close enough. */ - class CCharacter *ClosestCharacter(vec2 Pos, float Radius, CEntity *ppNotThis); + CCharacter *ClosestCharacter(vec2 Pos, float Radius, CEntity *ppNotThis); /* Function: InsertEntity @@ -163,7 +163,7 @@ public: Returns: Returns list with all Characters on line. */ - std::list IntersectedCharacters(vec2 Pos0, vec2 Pos1, float Radius, class CEntity *pNotThis = 0); + std::list IntersectedCharacters(vec2 Pos0, vec2 Pos1, float Radius, class CEntity *pNotThis = 0); }; #endif diff --git a/src/game/server/player.cpp b/src/game/server/player.cpp index c6b8520af..58d49765a 100644 --- a/src/game/server/player.cpp +++ b/src/game/server/player.cpp @@ -3,10 +3,14 @@ #include "player.h" #include +#include +#include + #include "base/system.h" #include "entities/character.h" #include "gamecontext.h" -#include +#include "gamecontroller.h" +#include "score.h" #include #include diff --git a/src/game/server/player.h b/src/game/server/player.h index 593281b6d..939d10bcd 100644 --- a/src/game/server/player.h +++ b/src/game/server/player.h @@ -3,12 +3,21 @@ #ifndef GAME_SERVER_PLAYER_H #define GAME_SERVER_PLAYER_H -#include "alloc.h" +#include -// this include should perhaps be removed -#include "score.h" +#include + +#include "alloc.h" #include "teeinfo.h" +#include + +class CCharacter; +class CGameContext; +class IServer; +struct CNetObj_PlayerInput; +struct CScorePlayerResult; + enum { WEAPON_GAME = -3, // team switching etc diff --git a/src/game/server/save.h b/src/game/server/save.h index 365f92012..a0dbc0c05 100644 --- a/src/game/server/save.h +++ b/src/game/server/save.h @@ -1,9 +1,10 @@ #ifndef GAME_SERVER_SAVE_H #define GAME_SERVER_SAVE_H +#include + #include #include -#include class IGameController; class CGameContext; diff --git a/src/game/server/score.cpp b/src/game/server/score.cpp index 9ca4fa356..6c9b788e7 100644 --- a/src/game/server/score.cpp +++ b/src/game/server/score.cpp @@ -5,7 +5,6 @@ #include "scoreworker.h" #include -#include #include #include #include @@ -13,9 +12,10 @@ #include #include -#include #include +class IDbConnection; + std::shared_ptr CScore::NewSqlPlayerResult(int ClientID) { CPlayer *pCurPlayer = GameServer()->m_apPlayers[ClientID]; diff --git a/src/game/server/score.h b/src/game/server/score.h index 6ab15d968..1c4928bdd 100644 --- a/src/game/server/score.h +++ b/src/game/server/score.h @@ -1,13 +1,15 @@ #ifndef GAME_SERVER_SCORE_H #define GAME_SERVER_SCORE_H -#include #include -#include "save.h" #include "scoreworker.h" +class CDbConnectionPool; class CGameContext; +class IDbConnection; +class IServer; +struct ISqlData; class CScore { diff --git a/src/game/server/scoreworker.h b/src/game/server/scoreworker.h index 652ba0e45..98256da16 100644 --- a/src/game/server/scoreworker.h +++ b/src/game/server/scoreworker.h @@ -14,7 +14,7 @@ #include class IDbConnection; -class IServer; +class IGameController; enum { diff --git a/src/game/server/teams.cpp b/src/game/server/teams.cpp index ac758e198..d098d2a35 100644 --- a/src/game/server/teams.cpp +++ b/src/game/server/teams.cpp @@ -1,6 +1,7 @@ /* (c) Shereef Marzouk. See "licence DDRace.txt" and the readme.txt in the root of the distribution for more information. */ #include "teams.h" #include "entities/character.h" +#include "gamecontroller.h" #include "player.h" #include "score.h" #include "teehistorian.h" diff --git a/src/game/server/teams.h b/src/game/server/teams.h index 581b838e7..86470a667 100644 --- a/src/game/server/teams.h +++ b/src/game/server/teams.h @@ -4,9 +4,12 @@ #include #include -#include #include +class CCharacter; +class CPlayer; +struct CScoreSaveResult; + class CGameTeams { // `m_TeeStarted` is used to keep track whether a given tee has hit the diff --git a/src/game/server/teehistorian.h b/src/game/server/teehistorian.h index 5009437a8..d6e078ff2 100644 --- a/src/game/server/teehistorian.h +++ b/src/game/server/teehistorian.h @@ -11,7 +11,6 @@ class CConfig; class CTuningParams; class CUuidManager; -class CPlayer; class CTeeHistorian {