Skyscraper 2.0
SBS::Escalator Class Reference

#include <escalator.h>

Inheritance diagram for SBS::Escalator:
Collaboration diagram for SBS::Escalator:

Classes

class  Timer
 

Public Member Functions

 Escalator (Object *parent, const std::string &name, int run, Real speed, const std::string &sound_file, const std::string &riser_texture, const std::string &tread_texture, const std::string &direction, Real CenterX, Real CenterZ, Real width, Real risersize, Real treadsize, int num_steps, Real voffset, Real tw, Real th)
 
 ~Escalator ()
 
void Enabled (bool value)
 
void Report (const std::string &message)
 
bool ReportError (const std::string &message)
 
void Loop ()
 
bool IsEnabled ()
 
void OnClick (Vector3 &position, bool shift, bool ctrl, bool alt, bool right)
 
void ResetState ()
 
void SetRun (int value)
 
int GetRun ()
 
void EnableMalfunctions (bool value)
 
void Malfunction ()
 
- 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 OnUnclick (bool right)
 
virtual void OnHit ()
 
void NotifyMove (bool parent=false)
 
void NotifyRotate (bool parent=false)
 
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 ()
 

Public Attributes

Real Speed
 
- 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 Member Functions

void CreateSteps (const std::string &riser_texture, const std::string &tread_texture, const std::string &direction, Real width, Real risersize, Real treadsize, Real tw, Real th)
 
void MoveSteps ()
 

Private Attributes

Soundsound
 
int Run
 
bool is_enabled
 
Vector3 start
 
Vector3 end
 
std::string Direction
 
Real treadsize
 
Real risersize
 
int buffer_zone_steps
 
std::vector< Step * > Steps
 
Timermalfunction_timer
 
int RandomProbability
 
Real RandomFrequency
 
RandomGenrnd_time
 
RandomGenrnd_type
 

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 escalator.h.

Constructor & Destructor Documentation

◆ Escalator()

SBS::Escalator::Escalator ( Object * parent,
const std::string & name,
int run,
Real speed,
const std::string & sound_file,
const std::string & riser_texture,
const std::string & tread_texture,
const std::string & direction,
Real CenterX,
Real CenterZ,
Real width,
Real risersize,
Real treadsize,
int num_steps,
Real voffset,
Real tw,
Real th )

◆ ~Escalator()

SBS::Escalator::~Escalator ( )

Member Function Documentation

◆ CreateSteps()

void SBS::Escalator::CreateSteps ( const std::string & riser_texture,
const std::string & tread_texture,
const std::string & direction,
Real width,
Real risersize,
Real treadsize,
Real tw,
Real th )
private

◆ Enabled()

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

Reimplemented from SBS::Object.

Definition at line 160 of file escalator.cpp.

References Enabled(), SBS::Object::EnableLoop(), is_enabled, SBS::Sound::IsPlaying(), sound, Steps, and SBS::Sound::Stop().

Referenced by Enabled().

Here is the call graph for this function:

◆ EnableMalfunctions()

void SBS::Escalator::EnableMalfunctions ( bool value)

Definition at line 514 of file escalator.cpp.

References SBS::SBS::GetPower(), malfunction_timer, RandomFrequency, Report(), SBS::ObjectBase::sbs, SBS::TimerObject::Start(), and SBS::TimerObject::Stop().

Referenced by SBS::SBS::EnableMalfunctions().

Here is the call graph for this function:

◆ GetRun()

int SBS::Escalator::GetRun ( )
inline

◆ IsEnabled()

bool SBS::Escalator::IsEnabled ( )
inline

Definition at line 40 of file escalator.h.

Referenced by Loop().

◆ Loop()

void SBS::Escalator::Loop ( )
virtual

Reimplemented from SBS::Object.

Definition at line 204 of file escalator.cpp.

References SBS::SBS::GetPower(), IsEnabled(), SBS::Sound::IsPlaying(), MoveSteps(), SBS::Sound::Play(), Run, SBS::ObjectBase::sbs, SBS_PROFILE, SBS::Sound::SetLoopState(), sound, and SBS::Sound::Stop().

Here is the call graph for this function:

◆ Malfunction()

void SBS::Escalator::Malfunction ( )

Definition at line 537 of file escalator.cpp.

References SBS::RandomGen::Get(), SBS::SBS::GetPower(), GetRun(), Report(), rnd_type, SBS::ObjectBase::sbs, and SetRun().

Referenced by SBS::Escalator::Timer::Notify().

Here is the call graph for this function:

◆ MoveSteps()

void SBS::Escalator::MoveSteps ( )
private

Definition at line 365 of file escalator.cpp.

References SBS::SBS::camera, SBS::SBS::delta, Direction, end, SBS::Camera::GetPosition(), SBS::Object::GetPosition(), risersize, Run, SBS::ObjectBase::sbs, Speed, start, Steps, and treadsize.

Referenced by Loop().

Here is the call graph for this function:

◆ OnClick()

void SBS::Escalator::OnClick ( Vector3 & position,
bool shift,
bool ctrl,
bool alt,
bool right )
virtual

Reimplemented from SBS::Object.

Definition at line 461 of file escalator.cpp.

References SBS::SBS::GetPower(), Run, SBS::ObjectBase::sbs, and Steps.

Here is the call graph for this function:

◆ Report()

void SBS::Escalator::Report ( const std::string & message)
virtual

Reimplemented from SBS::ObjectBase.

Definition at line 192 of file escalator.cpp.

References SBS::ObjectBase::GetName(), and SBS::ObjectBase::Report().

Referenced by EnableMalfunctions(), and Malfunction().

Here is the call graph for this function:

◆ ReportError()

bool SBS::Escalator::ReportError ( const std::string & message)
virtual

Reimplemented from SBS::ObjectBase.

Definition at line 198 of file escalator.cpp.

References SBS::ObjectBase::GetName(), and SBS::ObjectBase::ReportError().

Here is the call graph for this function:

◆ ResetState()

void SBS::Escalator::ResetState ( )
virtual

Reimplemented from SBS::Object.

Definition at line 487 of file escalator.cpp.

References Run, start, and Steps.

◆ SetRun()

void SBS::Escalator::SetRun ( int value)

Member Data Documentation

◆ buffer_zone_steps

int SBS::Escalator::buffer_zone_steps
private

Definition at line 56 of file escalator.h.

Referenced by CreateSteps(), and Escalator().

◆ Direction

std::string SBS::Escalator::Direction
private

Definition at line 53 of file escalator.h.

Referenced by CreateSteps(), and MoveSteps().

◆ end

Vector3 SBS::Escalator::end
private

Definition at line 52 of file escalator.h.

Referenced by CreateSteps(), Escalator(), and MoveSteps().

◆ is_enabled

bool SBS::Escalator::is_enabled
private

Definition at line 51 of file escalator.h.

Referenced by Enabled(), and Escalator().

◆ malfunction_timer

Timer* SBS::Escalator::malfunction_timer
private

Definition at line 62 of file escalator.h.

Referenced by EnableMalfunctions(), Escalator(), and ~Escalator().

◆ RandomFrequency

Real SBS::Escalator::RandomFrequency
private

Definition at line 64 of file escalator.h.

Referenced by EnableMalfunctions(), and Escalator().

◆ RandomProbability

int SBS::Escalator::RandomProbability
private

Definition at line 63 of file escalator.h.

Referenced by Escalator(), and SBS::Escalator::Timer::Notify().

◆ risersize

Real SBS::Escalator::risersize
private

Definition at line 55 of file escalator.h.

Referenced by CreateSteps(), Escalator(), and MoveSteps().

◆ rnd_time

RandomGen* SBS::Escalator::rnd_time
private

Definition at line 65 of file escalator.h.

Referenced by Escalator(), SBS::Escalator::Timer::Notify(), and ~Escalator().

◆ rnd_type

RandomGen * SBS::Escalator::rnd_type
private

Definition at line 65 of file escalator.h.

Referenced by Escalator(), Malfunction(), and ~Escalator().

◆ Run

int SBS::Escalator::Run
private

Definition at line 50 of file escalator.h.

Referenced by Loop(), MoveSteps(), OnClick(), ResetState(), and SetRun().

◆ sound

Sound* SBS::Escalator::sound
private

Definition at line 49 of file escalator.h.

Referenced by Enabled(), Escalator(), Loop(), and ~Escalator().

◆ Speed

Real SBS::Escalator::Speed

Definition at line 32 of file escalator.h.

Referenced by Escalator(), and MoveSteps().

◆ start

Vector3 SBS::Escalator::start
private

Definition at line 52 of file escalator.h.

Referenced by CreateSteps(), Escalator(), MoveSteps(), and ResetState().

◆ Steps

std::vector<Step*> SBS::Escalator::Steps
private

◆ treadsize

Real SBS::Escalator::treadsize
private

Definition at line 54 of file escalator.h.

Referenced by CreateSteps(), Escalator(), and MoveSteps().


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