Pyrogenesis HEAD
Pyrogenesis, a RTS Engine
CMessageProgressiveLoad Class Referencefinal

Handle progressive loading of resources. More...

#include <MessageTypes.h>

Inheritance diagram for CMessageProgressiveLoad:
Collaboration diagram for CMessageProgressiveLoad:

Public Member Functions

virtual int GetType () const
 
virtual const char * GetScriptHandlerName () const
 
virtual const char * GetScriptGlobalHandlerName () const
 
virtual JS::Value ToJSVal (const ScriptRequest &rq) const
 
 CMessageProgressiveLoad (bool *progressed, int *total, int *progress)
 
- Public Member Functions inherited from CMessage
virtual ~CMessage ()
 
virtual int GetType () const =0
 
virtual const char * GetScriptHandlerName () const =0
 
virtual const char * GetScriptGlobalHandlerName () const =0
 
virtual JS::Value ToJSVal (const ScriptRequest &) const =0
 
JS::Value ToJSValCached (const ScriptRequest &) const
 

Static Public Member Functions

static CMessageFromJSVal (const ScriptRequest &, JS::HandleValue val)
 

Public Attributes

bool * progressed
 
int * total
 
int * progress
 

Additional Inherited Members

- Protected Member Functions inherited from CMessage
 CMessage ()
 

Detailed Description

Handle progressive loading of resources.

A component that listens to this message must do the following:

  • Increase *msg.total by the non-zero number of loading tasks this component can perform.
  • If *msg.progressed == true, return and do nothing.
  • If you've loaded everything, increase *msg.progress by the value you added to .total
  • Otherwise do some loading, set *msg.progressed = true, and increase *msg.progress by a value indicating how much progress you've made in total (0 <= p <= what you added to .total) In some situations these messages will never be sent - components must ensure they load all their data themselves before using it in that case.

Constructor & Destructor Documentation

◆ CMessageProgressiveLoad()

CMessageProgressiveLoad::CMessageProgressiveLoad ( bool *  progressed,
int *  total,
int *  progress 
)
inline

Member Function Documentation

◆ FromJSVal()

CMessage * CMessageProgressiveLoad::FromJSVal ( const ScriptRequest rq,
JS::HandleValue  val 
)
static

◆ GetScriptGlobalHandlerName()

virtual const char * CMessageProgressiveLoad::GetScriptGlobalHandlerName ( ) const
inlinevirtual

Implements CMessage.

◆ GetScriptHandlerName()

virtual const char * CMessageProgressiveLoad::GetScriptHandlerName ( ) const
inlinevirtual

Implements CMessage.

◆ GetType()

virtual int CMessageProgressiveLoad::GetType ( ) const
inlinevirtual

Implements CMessage.

◆ ToJSVal()

JS::Value CMessageProgressiveLoad::ToJSVal ( const ScriptRequest rq) const
virtual

Implements CMessage.

Member Data Documentation

◆ progress

int* CMessageProgressiveLoad::progress

◆ progressed

bool* CMessageProgressiveLoad::progressed

◆ total

int* CMessageProgressiveLoad::total

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