From 743a50014a4bae97d9745d336e0d393fa54ff6e4 Mon Sep 17 00:00:00 2001 From: Lukas Pioch Date: Mon, 7 Aug 2017 09:08:27 +0200 Subject: [PATCH] Replaced includes with forward declarations --- src/BlockInServerPluginInterface.h | 3 +-- src/Blocks/BlockBed.h | 2 +- src/Blocks/WorldInterface.h | 10 ++++++---- src/ClientHandle.h | 2 +- src/Entities/SplashPotionEntity.h | 4 +++- src/Items/ItemHandler.h | 2 +- src/MobSpawner.h | 6 ------ src/Mobs/Monster.h | 2 +- src/Mobs/Wolf.h | 2 +- src/Protocol/Packetizer.h | 5 ++++- src/Protocol/Protocol.h | 2 +- src/UI/SlotArea.h | 3 ++- src/WorldStorage/WSSAnvil.h | 3 +-- 13 files changed, 23 insertions(+), 23 deletions(-) diff --git a/src/BlockInServerPluginInterface.h b/src/BlockInServerPluginInterface.h index c6578fe72..b3a71577f 100644 --- a/src/BlockInServerPluginInterface.h +++ b/src/BlockInServerPluginInterface.h @@ -10,11 +10,10 @@ #pragma once #include "Blocks/BlockPluginInterface.h" -#include "World.h" #include "Bindings/PluginManager.h" - +class cWorld; class cBlockInServerPluginInterface : diff --git a/src/Blocks/BlockBed.h b/src/Blocks/BlockBed.h index 634c7dd3a..f2cbfde18 100644 --- a/src/Blocks/BlockBed.h +++ b/src/Blocks/BlockBed.h @@ -6,9 +6,9 @@ #include "BlockEntity.h" #include "MetaRotator.h" #include "ChunkInterface.h" -#include "../Entities/Entity.h" +class cEntity; class cPlayer; class cWorldInterface; diff --git a/src/Blocks/WorldInterface.h b/src/Blocks/WorldInterface.h index d471df6f1..d90a7d3d6 100644 --- a/src/Blocks/WorldInterface.h +++ b/src/Blocks/WorldInterface.h @@ -1,17 +1,19 @@ #pragma once -#include "BroadcastInterface.h" + #include "../Mobs/MonsterTypes.h" -class cItems; typedef cItemCallback cBlockEntityCallback; - - +class cBroadcastInterface; +class cItems; class cPlayer; + + + class cWorldInterface { public: diff --git a/src/ClientHandle.h b/src/ClientHandle.h index 9b7e3dd58..b298751fe 100644 --- a/src/ClientHandle.h +++ b/src/ClientHandle.h @@ -12,7 +12,6 @@ #include "OSSupport/Network.h" #include "Defines.h" #include "Scoreboard.h" -#include "Map.h" #include "UI/SlotArea.h" #include "json/json.h" #include "ChunkSender.h" @@ -34,6 +33,7 @@ class cWindow; class cFallingBlock; class cCompositeChat; class cStatManager; +class cMap; class cClientHandle; typedef std::shared_ptr cClientHandlePtr; diff --git a/src/Entities/SplashPotionEntity.h b/src/Entities/SplashPotionEntity.h index 85aa5046f..baa5da725 100644 --- a/src/Entities/SplashPotionEntity.h +++ b/src/Entities/SplashPotionEntity.h @@ -12,10 +12,12 @@ #include "ProjectileEntity.h" #include "EntityEffect.h" #include "../World.h" -#include "Entity.h" +class cEntity; + + // tolua_begin diff --git a/src/Items/ItemHandler.h b/src/Items/ItemHandler.h index 48cf782d8..faee5d008 100644 --- a/src/Items/ItemHandler.h +++ b/src/Items/ItemHandler.h @@ -3,7 +3,6 @@ #include "../Defines.h" #include "../Item.h" -#include "../Blocks/BlockPluginInterface.h" @@ -12,6 +11,7 @@ // fwd: class cWorld; class cPlayer; +class cBlockPluginInterface; diff --git a/src/MobSpawner.h b/src/MobSpawner.h index 941a04a17..4d38d9657 100644 --- a/src/MobSpawner.h +++ b/src/MobSpawner.h @@ -7,12 +7,6 @@ -// fwd: -class cChunk; - - - - /** This class is used to determine which monster can be spawned in which place it is essentially static (eg. Squids spawn in water, Zombies spawn in dark places) diff --git a/src/Mobs/Monster.h b/src/Mobs/Monster.h index b79399a0f..d1630e4ff 100644 --- a/src/Mobs/Monster.h +++ b/src/Mobs/Monster.h @@ -2,11 +2,11 @@ #pragma once #include "../Entities/Pawn.h" -#include "../Item.h" #include "MonsterTypes.h" #include "PathFinder.h" +class cItem; class cClientHandle; diff --git a/src/Mobs/Wolf.h b/src/Mobs/Wolf.h index 70e761469..e05fedbf8 100644 --- a/src/Mobs/Wolf.h +++ b/src/Mobs/Wolf.h @@ -2,9 +2,9 @@ #pragma once #include "PassiveAggressiveMonster.h" -#include "../Entities/Entity.h" +class cEntity; diff --git a/src/Protocol/Packetizer.h b/src/Protocol/Packetizer.h index efed9c7a9..26b3a7ec7 100644 --- a/src/Protocol/Packetizer.h +++ b/src/Protocol/Packetizer.h @@ -11,7 +11,10 @@ #pragma once #include "Protocol.h" -#include "../ByteBuffer.h" + + + +class cByteBuffer; diff --git a/src/Protocol/Protocol.h b/src/Protocol/Protocol.h index 93f25310b..18ede0640 100644 --- a/src/Protocol/Protocol.h +++ b/src/Protocol/Protocol.h @@ -12,7 +12,6 @@ #include "../Defines.h" #include "../Scoreboard.h" -#include "../Map.h" #include "../ByteBuffer.h" #include "../EffectID.h" @@ -20,6 +19,7 @@ +class cMap; class cExpOrb; class cPlayer; class cEntity; diff --git a/src/UI/SlotArea.h b/src/UI/SlotArea.h index 5a94a26af..be21cdada 100644 --- a/src/UI/SlotArea.h +++ b/src/UI/SlotArea.h @@ -9,7 +9,8 @@ #pragma once #include "../Inventory.h" -#include "Window.h" + + diff --git a/src/WorldStorage/WSSAnvil.h b/src/WorldStorage/WSSAnvil.h index 37ccdda4c..454e6f73d 100755 --- a/src/WorldStorage/WSSAnvil.h +++ b/src/WorldStorage/WSSAnvil.h @@ -10,7 +10,6 @@ #include "WorldStorage.h" #include "FastNBT.h" -#include "../Mobs/Monster.h" @@ -18,7 +17,7 @@ // fwd: ItemGrid.h class cItemGrid; - +class cMonster; class cProjectileEntity; class cHangingEntity;