mirror of https://github.com/OpenRCT2/OpenRCT2.git
Reduce inclusion of EntityList.h
This commit is contained in:
parent
6baff43f52
commit
67b61478cf
|
@ -26,6 +26,7 @@
|
|||
#include <openrct2/localisation/Localisation.h>
|
||||
#include <openrct2/ride/RideData.h>
|
||||
#include <openrct2/ride/Track.h>
|
||||
#include <openrct2/world/EntityList.h>
|
||||
#include <openrct2/world/Entrance.h>
|
||||
#include <openrct2/world/Footpath.h>
|
||||
#include <openrct2/world/Scenery.h>
|
||||
|
|
|
@ -52,6 +52,7 @@
|
|||
#include <openrct2/ride/TrackDesignRepository.h>
|
||||
#include <openrct2/sprites.h>
|
||||
#include <openrct2/windows/Intent.h>
|
||||
#include <openrct2/world/EntityList.h>
|
||||
#include <openrct2/world/Park.h>
|
||||
#include <openrct2/world/Sprite.h>
|
||||
#include <vector>
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
#include <openrct2/sprites.h>
|
||||
#include <openrct2/util/Util.h>
|
||||
#include <openrct2/windows/Intent.h>
|
||||
#include <openrct2/world/EntityList.h>
|
||||
#include <openrct2/world/Footpath.h>
|
||||
#include <openrct2/world/Park.h>
|
||||
#include <openrct2/world/Sprite.h>
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
|
||||
#include "core/CircularBuffer.h"
|
||||
#include "peep/Peep.h"
|
||||
#include "world/EntityList.h"
|
||||
#include "world/Sprite.h"
|
||||
|
||||
static constexpr size_t MaximumGameStateSnapshots = 32;
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
#include "../ui/UiContext.h"
|
||||
#include "../ui/WindowManager.h"
|
||||
#include "../world/Banner.h"
|
||||
#include "../world/EntityList.h"
|
||||
#include "../world/Park.h"
|
||||
#include "../world/Sprite.h"
|
||||
#include "MazeSetTrackAction.h"
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
#include "../ui/UiContext.h"
|
||||
#include "../ui/WindowManager.h"
|
||||
#include "../windows/Intent.h"
|
||||
#include "../world/EntityList.h"
|
||||
#include "../world/Sprite.h"
|
||||
|
||||
StaffSetColourAction::StaffSetColourAction(StaffType staffType, uint8_t colour)
|
||||
|
|
|
@ -46,6 +46,7 @@
|
|||
#include "../util/Util.h"
|
||||
#include "../windows/Intent.h"
|
||||
#include "../world/Climate.h"
|
||||
#include "../world/EntityList.h"
|
||||
#include "../world/Park.h"
|
||||
#include "../world/Scenery.h"
|
||||
#include "../world/Sprite.h"
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
#include "../ui/UiContext.h"
|
||||
#include "../ui/WindowManager.h"
|
||||
#include "../world/Climate.h"
|
||||
#include "../world/EntityList.h"
|
||||
#include "../world/Map.h"
|
||||
#include "../world/Sprite.h"
|
||||
#include "Colour.h"
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
#include "Window_internal.h"
|
||||
|
||||
#include "../world/EntityList.h"
|
||||
#include "../world/Sprite.h"
|
||||
|
||||
void rct_window::SetLocation(const CoordsXYZ& coords)
|
||||
|
|
|
@ -24,6 +24,7 @@
|
|||
#include "../ui/UiContext.h"
|
||||
#include "../ui/WindowManager.h"
|
||||
#include "../util/SawyerCoding.h"
|
||||
#include "../world/EntityList.h"
|
||||
#include "../world/Location.hpp"
|
||||
#include "../world/Sprite.h"
|
||||
#include "network.h"
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
#include "../../ride/RideData.h"
|
||||
#include "../../ride/TrackDesign.h"
|
||||
#include "../../ride/VehiclePaint.h"
|
||||
#include "../../world/EntityList.h"
|
||||
#include "../../world/Sprite.h"
|
||||
#include "../Paint.h"
|
||||
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
#include "../audio/audio.h"
|
||||
#include "../rct12/RCT12.h"
|
||||
#include "../util/Util.h"
|
||||
#include "../world/EntityList.h"
|
||||
#include "../world/Sprite.h"
|
||||
#include "Ride.h"
|
||||
#include "RideData.h"
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
# include "../peep/Peep.h"
|
||||
# include "../peep/Staff.h"
|
||||
# include "../util/Util.h"
|
||||
# include "../world/EntityList.h"
|
||||
# include "../world/Sprite.h"
|
||||
# include "Duktape.hpp"
|
||||
# include "ScRide.hpp"
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
|
||||
# include "../common.h"
|
||||
# include "../ride/Ride.h"
|
||||
# include "../world/EntityList.h"
|
||||
# include "../world/Map.h"
|
||||
# include "Duktape.hpp"
|
||||
# include "ScEntity.hpp"
|
||||
|
|
|
@ -0,0 +1,27 @@
|
|||
/*****************************************************************************
|
||||
* Copyright (c) 2014-2021 OpenRCT2 developers
|
||||
*
|
||||
* For a complete list of all authors, please refer to contributors.md
|
||||
* Interested in contributing? Visit https://github.com/OpenRCT2/OpenRCT2
|
||||
*
|
||||
* OpenRCT2 is licensed under the GNU General Public License version 3.
|
||||
*****************************************************************************/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "SpriteBase.h"
|
||||
|
||||
SpriteBase* try_get_sprite(size_t spriteIndex);
|
||||
SpriteBase* get_sprite(size_t sprite_idx);
|
||||
|
||||
template<typename T = SpriteBase> T* GetEntity(size_t sprite_idx)
|
||||
{
|
||||
auto spr = get_sprite(sprite_idx);
|
||||
return spr != nullptr ? spr->As<T>() : nullptr;
|
||||
}
|
||||
|
||||
template<typename T = SpriteBase> T* TryGetEntity(size_t sprite_idx)
|
||||
{
|
||||
auto spr = try_get_sprite(sprite_idx);
|
||||
return spr != nullptr ? spr->As<T>() : nullptr;
|
||||
}
|
|
@ -11,6 +11,7 @@
|
|||
|
||||
#include "../common.h"
|
||||
#include "../rct12/RCT12.h"
|
||||
#include "Entity.h"
|
||||
#include "Location.hpp"
|
||||
#include "SpriteBase.h"
|
||||
|
||||
|
@ -34,7 +35,6 @@ uint16_t GetEntityListCount(EntityListId list);
|
|||
uint16_t GetNumFreeEntities();
|
||||
void RebuildEntityLists();
|
||||
const std::vector<uint16_t>& GetEntityTileList(const CoordsXY& spritePos);
|
||||
template<typename T = SpriteBase> T* GetEntity(size_t sprite_idx);
|
||||
|
||||
template<typename T, uint16_t SpriteBase::*NextList> class EntityIterator
|
||||
{
|
||||
|
|
|
@ -28,6 +28,7 @@
|
|||
#include "../ride/Track.h"
|
||||
#include "../ride/TrackData.h"
|
||||
#include "../util/Util.h"
|
||||
#include "EntityList.h"
|
||||
#include "Map.h"
|
||||
#include "MapAnimation.h"
|
||||
#include "Park.h"
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
#include "../ride/Track.h"
|
||||
#include "../world/Wall.h"
|
||||
#include "Banner.h"
|
||||
#include "EntityList.h"
|
||||
#include "Footpath.h"
|
||||
#include "LargeScenery.h"
|
||||
#include "Map.h"
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
#include "../common.h"
|
||||
#include "../peep/Peep.h"
|
||||
#include "../ride/Vehicle.h"
|
||||
#include "EntityList.h"
|
||||
#include "Entity.h"
|
||||
#include "Fountain.h"
|
||||
#include "SpriteBase.h"
|
||||
|
||||
|
@ -198,20 +198,6 @@ enum LitterType : uint8_t
|
|||
LITTER_TYPE_EMPTY_BOWL_BLUE,
|
||||
};
|
||||
|
||||
SpriteBase* try_get_sprite(size_t spriteIndex);
|
||||
SpriteBase* get_sprite(size_t sprite_idx);
|
||||
template<typename T> T* GetEntity(size_t sprite_idx)
|
||||
{
|
||||
auto spr = get_sprite(sprite_idx);
|
||||
return spr != nullptr ? spr->As<T>() : nullptr;
|
||||
}
|
||||
|
||||
template<typename T = SpriteBase> T* TryGetEntity(size_t sprite_idx)
|
||||
{
|
||||
auto spr = try_get_sprite(sprite_idx);
|
||||
return spr != nullptr ? spr->As<T>() : nullptr;
|
||||
}
|
||||
|
||||
constexpr const uint32_t SPATIAL_INDEX_SIZE = (MAXIMUM_MAP_SIZE_TECHNICAL * MAXIMUM_MAP_SIZE_TECHNICAL) + 1;
|
||||
constexpr const uint32_t SPATIAL_INDEX_LOCATION_NULL = SPATIAL_INDEX_SIZE - 1;
|
||||
|
||||
|
|
Loading…
Reference in New Issue