Skyscraper 2.0
SBS::Indicator Class Reference

#include <indicator.h>

Inheritance diagram for SBS::Indicator:
Collaboration diagram for SBS::Indicator:

Classes

class  Timer
 

Public Member Functions

 Indicator (Object *parent, const std::string &sound, const std::string &texture_prefix, const std::string &blank_texture, const std::string &direction, Real CenterX, Real CenterZ, Real width, Real height, Real voffset, Real timer_duration)
 
 ~Indicator ()
 
void Enabled (bool value)
 
void Update (const std::string &text, bool play_sound=true)
 
bool IsEnabled ()
 
void Off ()
 
bool PlaySound ()
 
void Loop ()
 
- Public Member Functions inherited from SBS::Object
 Object (Object *parent)
 
virtual ~Object ()
 
void SetValues (const std::string &type, const std::string &name, bool is_permanent, bool is_movable=true)
 
bool IsPermanent ()
 
bool IsMovable ()
 
const std::string & GetType ()
 
int GetNumber ()
 
void AddChild (Object *object)
 
ObjectGetChild (int index)
 
int GetChildrenCount ()
 
void RemoveChild (Object *object)
 
SceneNodeGetSceneNode ()
 
void ShowBoundingBox (bool value)
 
virtual void Move (const Vector3 &vector, Real speed=1.0)
 
virtual void Move (Real X, Real Y, Real Z, Real speed=1.0)
 
virtual void SetPosition (const Vector3 &position)
 
void SetPositionRelative (const Vector3 &position)
 
virtual void SetPosition (Real X, Real Y, Real Z)
 
void SetPositionRelative (Real X, Real Y, Real Z)
 
virtual void SetPositionY (Real value)
 
virtual Vector3 GetPosition (bool relative=false)
 
virtual void Rotate (const Vector3 &vector, Real speed=1.0)
 
virtual void Rotate (Real X, Real Y, Real Z, Real speed=1.0)
 
virtual void SetRotation (const Vector3 &rotation)
 
virtual void SetRotation (Real X, Real Y, Real Z)
 
virtual Vector3 GetRotation ()
 
Quaternion GetOrientation (bool relative=false)
 
void SetOrientation (const Quaternion &q, bool relative=false)
 
virtual void OnMove (bool parent)
 
virtual void OnRotate (bool parent)
 
virtual void OnClick (Vector3 &position, bool shift, bool ctrl, bool alt, bool right)
 
virtual void OnUnclick (bool right)
 
virtual void OnHit ()
 
void NotifyMove (bool parent=false)
 
void NotifyRotate (bool parent=false)
 
virtual void ResetState ()
 
void ChangeParent (Object *new_parent)
 
bool IsGlobal ()
 
void Init (bool children=true)
 
virtual void OnInit ()
 
void RegisterLoop (Object *object)
 
void UnregisterLoop (Object *object)
 
std::string GetNameBase ()
 
template<typename T >
bool IsType ()
 
template<typename T >
T * ConvertTo ()
 
- Public Member Functions inherited from SBS::ObjectBase
 ObjectBase (Object *parent)
 
virtual ~ObjectBase ()
 
ObjectGetParent ()
 
SBSGetRoot ()
 
void SetName (const std::string &name)
 
const std::string & GetName ()
 
std::string GetNameBase ()
 
virtual void Report (const std::string &message)
 
virtual bool ReportError (const std::string &message)
 

Public Attributes

std::string Prefix
 
std::string Blank
 
- Public Attributes inherited from SBS::Object
std::string command
 
std::string command_processed
 
std::string context
 
int linenum
 
std::string includefile
 
bool parent_deleting
 

Private Attributes

MeshObjectMesh
 
bool is_enabled
 
Soundsound
 
std::string soundfile
 
std::string active_text
 
Timertimer
 
Real timer_duration
 

Additional Inherited Members

- Protected Member Functions inherited from SBS::Object
void EnableLoop (bool value)
 
void LoopChildren ()
 
bool SelfDestruct ()
 
- Protected Attributes inherited from SBS::ObjectBase
SBSsbs
 

Detailed Description

Definition at line 29 of file indicator.h.

Constructor & Destructor Documentation

◆ Indicator()

SBS::Indicator::Indicator ( Object * parent,
const std::string & sound,
const std::string & texture_prefix,
const std::string & blank_texture,
const std::string & direction,
Real CenterX,
Real CenterZ,
Real width,
Real height,
Real voffset,
Real timer_duration )

◆ ~Indicator()

SBS::Indicator::~Indicator ( )

Definition at line 105 of file indicator.cpp.

References Mesh, SBS::Object::parent_deleting, and sound.

Member Function Documentation

◆ Enabled()

void SBS::Indicator::Enabled ( bool value)
virtual

Reimplemented from SBS::Object.

Definition at line 133 of file indicator.cpp.

References SBS::MeshObject::Enabled(), is_enabled, and Mesh.

Here is the call graph for this function:

◆ IsEnabled()

bool SBS::Indicator::IsEnabled ( )
inline

Definition at line 41 of file indicator.h.

◆ Loop()

void SBS::Indicator::Loop ( )
virtual

Reimplemented from SBS::Object.

Definition at line 220 of file indicator.cpp.

References SBS::SBS::GetPower(), Off(), and SBS::ObjectBase::sbs.

Here is the call graph for this function:

◆ Off()

void SBS::Indicator::Off ( )

Definition at line 171 of file indicator.cpp.

References active_text, Blank, SBS::MeshObject::ChangeTexture(), and Mesh.

Referenced by Loop(), and SBS::Indicator::Timer::Notify().

Here is the call graph for this function:

◆ PlaySound()

bool SBS::Indicator::PlaySound ( )

◆ Update()

void SBS::Indicator::Update ( const std::string & text,
bool play_sound = true )

Member Data Documentation

◆ active_text

std::string SBS::Indicator::active_text
private

Definition at line 54 of file indicator.h.

Referenced by Off(), PlaySound(), and Update().

◆ Blank

std::string SBS::Indicator::Blank

Definition at line 34 of file indicator.h.

Referenced by Indicator(), Off(), and Update().

◆ is_enabled

bool SBS::Indicator::is_enabled
private

Definition at line 48 of file indicator.h.

Referenced by Enabled(), and Indicator().

◆ Mesh

MeshObject* SBS::Indicator::Mesh
private

Definition at line 47 of file indicator.h.

Referenced by Enabled(), Indicator(), Off(), Update(), and ~Indicator().

◆ Prefix

std::string SBS::Indicator::Prefix

Definition at line 33 of file indicator.h.

Referenced by Indicator(), and Update().

◆ sound

Sound* SBS::Indicator::sound
private

Definition at line 52 of file indicator.h.

Referenced by Indicator(), PlaySound(), and ~Indicator().

◆ soundfile

std::string SBS::Indicator::soundfile
private

Definition at line 53 of file indicator.h.

Referenced by Indicator(), and PlaySound().

◆ timer

Timer* SBS::Indicator::timer
private

Definition at line 57 of file indicator.h.

Referenced by Indicator(), and Update().

◆ timer_duration

Real SBS::Indicator::timer_duration
private

Definition at line 58 of file indicator.h.

Referenced by Indicator(), and Update().


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