Pyrogenesis HEAD
Pyrogenesis, a RTS Engine
ICmpVisibility Class Referenceabstract

The Visibility component is a scripted component that allows any part of the simulation to influence the visibility of an entity. More...

#include <ICmpVisibility.h>

Inheritance diagram for ICmpVisibility:
Collaboration diagram for ICmpVisibility:

Public Member Functions

virtual bool IsActivated ()=0
 This function is a fallback for some entities whose visibility status cannot be cached by the range manager (especially local entities like previews). More...
 
virtual LosVisibility GetVisibility (player_id_t player, bool isVisible, bool isExplored)=0
 
virtual bool GetRetainInFog ()=0
 
virtual bool GetAlwaysVisible ()=0
 
- Public Member Functions inherited from IComponent
virtual ~IComponent ()
 
virtual void Init (const CParamNode &paramNode)=0
 
virtual void Deinit ()=0
 
virtual void HandleMessage (const CMessage &msg, bool global)
 
CEntityHandle GetEntityHandle () const
 
void SetEntityHandle (CEntityHandle ent)
 
entity_id_t GetEntityId () const
 
CEntityHandle GetSystemEntity () const
 
const CSimContextGetSimContext () const
 
void SetSimContext (const CSimContext &context)
 
virtual void Serialize (ISerializer &serialize)=0
 
virtual void Deserialize (const CParamNode &paramNode, IDeserializer &deserialize)=0
 
virtual bool NewJSObject (const ScriptInterface &scriptInterface, JS::MutableHandleObject out) const
 Returns false by default, indicating that a scripted wrapper of this IComponent is not supported. More...
 
virtual JS::Value GetJSInstance () const
 
virtual int GetComponentTypeId () const =0
 

Additional Inherited Members

- Public Types inherited from IComponent
using AllocFunc = IComponent *(*)(const ScriptInterface &scriptInterface, JS::HandleValue ctor)
 
using DeallocFunc = void(*)(IComponent *)
 
- Static Public Member Functions inherited from IComponent
static std::string GetSchema ()
 
static void RegisterComponentType (CComponentManager &mgr, EInterfaceId iid, EComponentTypeId cid, AllocFunc alloc, DeallocFunc dealloc, const char *name, const std::string &schema)
 
static void RegisterComponentTypeScriptWrapper (CComponentManager &mgr, EInterfaceId iid, EComponentTypeId cid, AllocFunc alloc, DeallocFunc dealloc, const char *name, const std::string &schema)
 
static u8 GetSerializationVersion ()
 

Detailed Description

The Visibility component is a scripted component that allows any part of the simulation to influence the visibility of an entity.

This component:

  • Holds the template values RetainInFog and AlwaysVisible, used by the range manager to compute the visibility of the entity;
  • Can supersede the range manager if it is "activated". This is to avoid useless calls to the scripts.

Member Function Documentation

◆ GetAlwaysVisible()

virtual bool ICmpVisibility::GetAlwaysVisible ( )
pure virtual

Implemented in CCmpVisibilityScripted.

◆ GetRetainInFog()

virtual bool ICmpVisibility::GetRetainInFog ( )
pure virtual

Implemented in CCmpVisibilityScripted.

◆ GetVisibility()

virtual LosVisibility ICmpVisibility::GetVisibility ( player_id_t  player,
bool  isVisible,
bool  isExplored 
)
pure virtual

Implemented in CCmpVisibilityScripted.

◆ IsActivated()

virtual bool ICmpVisibility::IsActivated ( )
pure virtual

This function is a fallback for some entities whose visibility status cannot be cached by the range manager (especially local entities like previews).

Calling the scripts is expensive, so only call it if really needed.

Implemented in CCmpVisibilityScripted.


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