Pyrogenesis  trunk
Classes | Public Member Functions | Public Attributes | Private Types | Private Member Functions | Private Attributes | List of all members
CObjectBase Class Reference

Maintains the tree of possible objects from a specific actor definition at a given quality level. More...

#include <ObjectBase.h>

Collaboration diagram for CObjectBase:
Collaboration graph
[legend]

Classes

struct  Anim
 
struct  Decal
 
struct  Prop
 
struct  Samp
 
struct  Variant
 
struct  Variation
 

Public Member Functions

 CObjectBase (CObjectManager &objectManager, CActorDef &actorDef, u8 QualityLevel)
 
std::set< CStr > CalculateRandomRemainingSelections (uint32_t seed, const std::vector< std::set< CStr >> &initialSelections) const
 
std::vector< u8CalculateVariationKey (const std::vector< const std::set< CStr > *> &selections) const
 
const Variation BuildVariation (const std::vector< u8 > &variationKey) const
 
std::vector< std::vector< CStr > > GetVariantGroups () const
 
const CStr & GetIdentifier () const
 
bool UsesFile (const VfsPath &pathname) const
 Returns whether this object (including any possible props) uses the given file. More...
 

Public Attributes

struct {
   bool   m_CastShadows
 
   bool   m_FloatOnWater
 
m_Properties
 
VfsPath m_Material
 
u8 m_QualityLevel
 

Private Types

using rng_t = boost::mt19937
 

Private Member Functions

 NONCOPYABLE (CObjectBase)
 
std::unique_ptr< CObjectBaseCopyWithQuality (u8 newQualityLevel) const
 Acts as an explicit copy constructor, for a new quality level. More...
 
std::set< CStr > CalculateRandomRemainingSelections (rng_t &rng, const std::vector< std::set< CStr >> &initialSelections) const
 
void GetQualitySplits (std::vector< u8 > &splits) const
 Get all quality levels at which this object changes (includes props). More...
 
bool Load (const CXeromyces &XeroFile, const XMBElement &base)
 
bool LoadVariant (const CXeromyces &XeroFile, const XMBElement &variant, Variant &currentVariant)
 

Private Attributes

friend CActorDef
 
CActorDefm_ActorDef
 
CStr m_Identifier
 
std::vector< std::vector< Variant > > m_VariantGroups
 
CObjectManagerm_ObjectManager
 

Detailed Description

Maintains the tree of possible objects from a specific actor definition at a given quality level.

An Object Base is made of:

Member Typedef Documentation

◆ rng_t

using CObjectBase::rng_t = boost::mt19937
private

Constructor & Destructor Documentation

◆ CObjectBase()

CObjectBase::CObjectBase ( CObjectManager objectManager,
CActorDef actorDef,
u8  QualityLevel 
)

Member Function Documentation

◆ BuildVariation()

const CObjectBase::Variation CObjectBase::BuildVariation ( const std::vector< u8 > &  variationKey) const

◆ CalculateRandomRemainingSelections() [1/2]

std::set< CStr > CObjectBase::CalculateRandomRemainingSelections ( uint32_t  seed,
const std::vector< std::set< CStr >> &  initialSelections 
) const

◆ CalculateRandomRemainingSelections() [2/2]

std::set< CStr > CObjectBase::CalculateRandomRemainingSelections ( rng_t rng,
const std::vector< std::set< CStr >> &  initialSelections 
) const
private

◆ CalculateVariationKey()

std::vector< u8 > CObjectBase::CalculateVariationKey ( const std::vector< const std::set< CStr > *> &  selections) const

◆ CopyWithQuality()

std::unique_ptr< CObjectBase > CObjectBase::CopyWithQuality ( u8  newQualityLevel) const
private

Acts as an explicit copy constructor, for a new quality level.

Note that this does not reload the actor, so this setting will only change props.

◆ GetIdentifier()

const CStr & CObjectBase::GetIdentifier ( ) const

◆ GetQualitySplits()

void CObjectBase::GetQualitySplits ( std::vector< u8 > &  splits) const
private

Get all quality levels at which this object changes (includes props).

Intended to be called by CActorFef.

Parameters
splits- a sorted vector of unique quality splits.

◆ GetVariantGroups()

std::vector< std::vector< CStr > > CObjectBase::GetVariantGroups ( ) const

◆ Load()

bool CObjectBase::Load ( const CXeromyces XeroFile,
const XMBElement base 
)
private

◆ LoadVariant()

bool CObjectBase::LoadVariant ( const CXeromyces XeroFile,
const XMBElement variant,
Variant currentVariant 
)
private

◆ NONCOPYABLE()

CObjectBase::NONCOPYABLE ( CObjectBase  )
private

◆ UsesFile()

bool CObjectBase::UsesFile ( const VfsPath pathname) const

Returns whether this object (including any possible props) uses the given file.

(This is used for hotloading.)

Member Data Documentation

◆ CActorDef

friend CObjectBase::CActorDef
private

◆ m_ActorDef

CActorDef& CObjectBase::m_ActorDef
private

◆ m_CastShadows

bool CObjectBase::m_CastShadows

◆ m_FloatOnWater

bool CObjectBase::m_FloatOnWater

◆ m_Identifier

CStr CObjectBase::m_Identifier
private

◆ m_Material

VfsPath CObjectBase::m_Material

◆ m_ObjectManager

CObjectManager& CObjectBase::m_ObjectManager
private

◆ m_Properties

struct { ... } CObjectBase::m_Properties

◆ m_QualityLevel

u8 CObjectBase::m_QualityLevel

◆ m_VariantGroups

std::vector< std::vector<Variant> > CObjectBase::m_VariantGroups
private

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