Pyrogenesis HEAD
Pyrogenesis, a RTS Engine
CObjectManager Class Reference

#include <ObjectManager.h>

Collaboration diagram for CObjectManager:

Classes

struct  Hotloadable
 
struct  ObjectKey
 

Public Types

enum class  VariantDiversity { NONE , LIMITED , FULL }
 Governs how random variants are selected by ObjectBase. More...
 

Public Member Functions

 CObjectManager (CMeshManager &meshManager, CSkeletonAnimManager &skeletonAnimManager, CSimulation2 &simulation)
 
 ~CObjectManager ()
 
CMeshManagerGetMeshManager () const
 
CSkeletonAnimManagerGetSkeletonAnimManager () const
 
void UnloadObjects ()
 
std::pair< bool, CActorDef & > FindActorDef (const CStrW &actorName)
 Get the actor definition for the given path name. More...
 
CObjectEntryFindObjectVariation (const CActorDef *actor, const std::vector< std::set< CStr > > &selections, uint32_t seed)
 Get the object entry for a given actor & the given selections list. More...
 
CObjectEntryFindObjectVariation (const std::shared_ptr< CObjectBase > &base, const std::vector< const std::set< CStr > * > &completeSelections)
 
CObjectEntryFindObjectVariation (const CStrW &objname, const std::vector< const std::set< CStr > * > &completeSelections)
 
CTerrainGetTerrain ()
 Get the terrain object that actors managed by this manager should be linked with (primarily for the purpose of decals) More...
 
VariantDiversity GetVariantDiversity () const
 
Status ReloadChangedFile (const VfsPath &path)
 Reload any scripts that were loaded from the given filename. More...
 
void ActorQualityChanged ()
 Reload actors that have a quality setting. More...
 
void VariantDiversityChanged ()
 Reload actors. More...
 

Public Attributes

CMeshManagerm_MeshManager
 
CSkeletonAnimManagerm_SkeletonAnimManager
 
CSimulation2m_Simulation
 
u8 m_QualityLevel = 100
 
std::unique_ptr< CConfigDBHookm_QualityHook
 
VariantDiversity m_VariantDiversity = VariantDiversity::FULL
 
std::unique_ptr< CConfigDBHookm_VariantDiversityHook
 
std::map< ObjectKey, Hotloadable< CObjectEntry > > m_Objects
 
std::unordered_map< CStrW, Hotloadable< CActorDef > > m_ActorDefs
 

Private Member Functions

 NONCOPYABLE (CObjectManager)
 

Member Enumeration Documentation

◆ VariantDiversity

Governs how random variants are selected by ObjectBase.

Enumerator
NONE 
LIMITED 
FULL 

Constructor & Destructor Documentation

◆ CObjectManager()

CObjectManager::CObjectManager ( CMeshManager meshManager,
CSkeletonAnimManager skeletonAnimManager,
CSimulation2 simulation 
)

◆ ~CObjectManager()

CObjectManager::~CObjectManager ( )

Member Function Documentation

◆ ActorQualityChanged()

void CObjectManager::ActorQualityChanged ( )

Reload actors that have a quality setting.

Used when changing the actor quality.

◆ FindActorDef()

std::pair< bool, CActorDef & > CObjectManager::FindActorDef ( const CStrW &  actorName)

Get the actor definition for the given path name.

If the actor cannot be loaded, this will return a placeholder actor.

Returns
Success/failure boolean and a valid actor definition.

◆ FindObjectVariation() [1/3]

CObjectEntry * CObjectManager::FindObjectVariation ( const CActorDef actor,
const std::vector< std::set< CStr > > &  selections,
uint32_t  seed 
)

Get the object entry for a given actor & the given selections list.

Parameters
selections- a possibly incomplete list of selections.
seed- the randomness seed to use to complete the random selections.

◆ FindObjectVariation() [2/3]

CObjectEntry * CObjectManager::FindObjectVariation ( const CStrW &  objname,
const std::vector< const std::set< CStr > * > &  completeSelections 
)

◆ FindObjectVariation() [3/3]

CObjectEntry * CObjectManager::FindObjectVariation ( const std::shared_ptr< CObjectBase > &  base,
const std::vector< const std::set< CStr > * > &  completeSelections 
)
See also
FindObjectVariation. These take a complete selection. These are pointers to sets that are guaranteed to exist (pointers are used to avoid copying the sets).

◆ GetMeshManager()

CMeshManager & CObjectManager::GetMeshManager ( ) const
inline

◆ GetSkeletonAnimManager()

CSkeletonAnimManager & CObjectManager::GetSkeletonAnimManager ( ) const
inline

◆ GetTerrain()

CTerrain * CObjectManager::GetTerrain ( )

Get the terrain object that actors managed by this manager should be linked with (primarily for the purpose of decals)

◆ GetVariantDiversity()

CObjectManager::VariantDiversity CObjectManager::GetVariantDiversity ( ) const

◆ NONCOPYABLE()

CObjectManager::NONCOPYABLE ( CObjectManager  )
private

◆ ReloadChangedFile()

Status CObjectManager::ReloadChangedFile ( const VfsPath path)

Reload any scripts that were loaded from the given filename.

(This is used to implement hotloading.)

◆ UnloadObjects()

void CObjectManager::UnloadObjects ( )

◆ VariantDiversityChanged()

void CObjectManager::VariantDiversityChanged ( )

Reload actors.

Used when changing the variant diversity.

Member Data Documentation

◆ m_ActorDefs

std::unordered_map<CStrW, Hotloadable<CActorDef> > CObjectManager::m_ActorDefs

◆ m_MeshManager

CMeshManager& CObjectManager::m_MeshManager

◆ m_Objects

std::map<ObjectKey, Hotloadable<CObjectEntry> > CObjectManager::m_Objects

◆ m_QualityHook

std::unique_ptr<CConfigDBHook> CObjectManager::m_QualityHook

◆ m_QualityLevel

u8 CObjectManager::m_QualityLevel = 100

◆ m_Simulation

CSimulation2& CObjectManager::m_Simulation

◆ m_SkeletonAnimManager

CSkeletonAnimManager& CObjectManager::m_SkeletonAnimManager

◆ m_VariantDiversity

VariantDiversity CObjectManager::m_VariantDiversity = VariantDiversity::FULL

◆ m_VariantDiversityHook

std::unique_ptr<CConfigDBHook> CObjectManager::m_VariantDiversityHook

The documentation for this class was generated from the following files: