Skyscraper 2.0
SBS::CallStation Class Reference

#include <callstation.h>

Inheritance diagram for SBS::CallStation:
Collaboration diagram for SBS::CallStation:

Classes

class  Timer
 

Public Member Functions

 CallStation (Object *parent, int floornum, int number)
 
 ~CallStation ()
 
ButtonPanel * CreateButtonPanel (const std::string &texture, int rows, int columns, const std::string &direction, Real width, Real height, Real spacingX, Real spacingY, Real tw, Real th)
 
void Enabled (bool value)
 
bool IsEnabled ()
 
void Report (const std::string &message)
 
bool ReportError (const std::string &message)
 
int GetFloor ()
 
ButtonPanel * GetPanel ()
 
void RemovePanel ()
 
bool SelectFloor (int floor)
 
void SetController (int number)
 
DispatchController * GetController ()
 
void SetPosition (Vector3 &position)
 
bool ServicesElevator (int elevator)
 
int GetElevatorArrived (int starting_floor, int destination_floor)
 
bool FireService (int value)
 
Indicator * AddIndicator (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)
 
void UpdateIndicator (const std::string &text, bool play_sound=true)
 
bool Input (const std::string &text)
 
void ProcessCache ()
 
void Error (bool type=0)
 
int GetRecallFloor ()
 
void ReportElevator (Elevator *elevator)
 
bool Call (bool direction)
 
bool GetFloorFromID (const std::string &floor, int &result)
 
void SetLightsGroup (int up, int down)
 
void UpLight (bool value)
 
void DownLight (bool value)
 
void SetLights (int up, int down)
 
bool GetUpStatus ()
 
bool GetDownStatus ()
 
Control * GetUpControl ()
 
Control * GetDownControl ()
 
bool Press (bool up)
 
bool CreateCallButtons (const std::string &sound_file_up, const std::string &sound_file_down, std::string BackTexture, const std::string &UpButtonTexture, const std::string &UpButtonTexture_Lit, const std::string &DownButtonTexture, const std::string &DownButtonTexture_Lit, const std::string &direction, Real BackWidth, Real BackHeight, bool ShowBack, Real tw, Real th)
 
int GetElevatorArrivedStandard (int floor, bool direction)
 
- 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)
 
Object * GetChild (int index)
 
int GetChildrenCount ()
 
void RemoveChild (Object *object)
 
SceneNode * GetSceneNode ()
 
void ShowBoundingBox (bool value)
 
virtual void Move (const Vector3 &vector, Real speed=1.0, bool force=false)
 
virtual void Move (Real X, Real Y, Real Z, Real speed=1.0, bool force=false)
 
virtual void SetPosition (const Vector3 &position, bool relative=false, bool force=false)
 
virtual void SetPosition (Real X, Real Y, Real Z, bool relative=false, bool force=false)
 
virtual void SetPositionY (Real value, bool force=false)
 
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 ()
 
virtual void Loop ()
 
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 ()
 
Object * GetParent ()
 
SBS * GetRoot ()
 
void SetName (const std::string &name)
 
const std::string & GetName ()
 
std::string GetNameBase ()
 
- Public Member Functions inherited from SBS::Lock
 Lock (Object *parent)
 
virtual ~Lock ()
 
void SetLocked (bool value, int keyid)
 
bool IsLocked ()
 
bool ToggleLock (bool force=false)
 
int GetKeyID ()
 

Public Attributes

std::string Name
 
int Number
 
std::vector< std::string > InvalidInput
 
Real TimerDelay
 
bool ShowDirection
 
- 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

ButtonPanel * panel
 
int controller
 
bool is_enabled
 
Floor * floor
 
Indicator * indicator
 
std::string InputCache
 
bool Locked
 
int KeyID
 
Timer * timer
 

Additional Inherited Members

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

Detailed Description

Definition at line 31 of file callstation.h.

Constructor & Destructor Documentation

◆ CallStation()

SBS::CallStation::CallStation ( Object * parent,
int floornum,
int number )

◆ ~CallStation()

SBS::CallStation::~CallStation ( )

Member Function Documentation

◆ AddIndicator()

Indicator * SBS::CallStation::AddIndicator ( 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 )

Definition at line 259 of file callstation.cpp.

References indicator.

Referenced by Skyscraper::ScriptProcessor::CallStationSection::Run().

◆ Call()

bool SBS::CallStation::Call ( bool direction)

Definition at line 461 of file callstation.cpp.

References SBS::DispatchController::CallElevator(), DownLight(), GetController(), SBS::Lock::IsLocked(), ReportError(), SBS_PROFILE, and UpLight().

Referenced by SBS::Action::Run().

Here is the call graph for this function:

◆ CreateButtonPanel()

ButtonPanel * SBS::CallStation::CreateButtonPanel ( const std::string & texture,
int rows,
int columns,
const std::string & direction,
Real width,
Real height,
Real spacingX,
Real spacingY,
Real tw,
Real th )

Definition at line 109 of file callstation.cpp.

References panel, Report(), SBS::ObjectBase::sbs, and SBS::SBS::Verbose.

Referenced by Skyscraper::ScriptProcessor::CallStationSection::Run().

Here is the call graph for this function:

◆ CreateCallButtons()

bool SBS::CallStation::CreateCallButtons ( const std::string & sound_file_up,
const std::string & sound_file_down,
std::string BackTexture,
const std::string & UpButtonTexture,
const std::string & UpButtonTexture_Lit,
const std::string & DownButtonTexture,
const std::string & DownButtonTexture_Lit,
const std::string & direction,
Real BackWidth,
Real BackHeight,
bool ShowBack,
Real tw,
Real th )

◆ DownLight()

void SBS::CallStation::DownLight ( bool value)

Definition at line 518 of file callstation.cpp.

References SetLightsGroup().

Referenced by Call().

Here is the call graph for this function:

◆ Enabled()

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

Reimplemented from SBS::Object.

Definition at line 123 of file callstation.cpp.

References SBS::ButtonPanel::Enabled(), is_enabled, panel, Report(), SBS::ObjectBase::sbs, and SBS::SBS::Verbose.

Here is the call graph for this function:

◆ Error()

void SBS::CallStation::Error ( bool type = 0)

Definition at line 394 of file callstation.cpp.

References UpdateIndicator().

Referenced by SBS::DispatchController::CallElevator(), Input(), ProcessCache(), and SBS::DispatchController::RequestRoute().

Here is the call graph for this function:

◆ FireService()

bool SBS::CallStation::FireService ( int value)

◆ GetController()

◆ GetDownControl()

Control * SBS::CallStation::GetDownControl ( )

Definition at line 617 of file callstation.cpp.

References SBS::ButtonPanel::GetControl(), and panel.

Referenced by GetDownStatus(), Press(), and SetLights().

Here is the call graph for this function:

◆ GetDownStatus()

bool SBS::CallStation::GetDownStatus ( )

Definition at line 605 of file callstation.cpp.

References GetDownControl().

Referenced by SBS::Person::ProcessRoute(), and SetLights().

Here is the call graph for this function:

◆ GetElevatorArrived()

int SBS::CallStation::GetElevatorArrived ( int starting_floor,
int destination_floor )

Definition at line 228 of file callstation.cpp.

References GetController(), and SBS::DispatchController::GetElevatorArrived().

Referenced by SBS::Person::ProcessRoute().

Here is the call graph for this function:

◆ GetElevatorArrivedStandard()

int SBS::CallStation::GetElevatorArrivedStandard ( int floor,
bool direction )

Definition at line 239 of file callstation.cpp.

References floor, GetController(), and SBS::DispatchController::GetElevatorArrivedStandard().

Referenced by SBS::Person::ProcessRoute().

Here is the call graph for this function:

◆ GetFloor()

int SBS::CallStation::GetFloor ( )

◆ GetFloorFromID()

bool SBS::CallStation::GetFloorFromID ( const std::string & floor,
int & result )

◆ GetPanel()

ButtonPanel * SBS::CallStation::GetPanel ( )

Definition at line 170 of file callstation.cpp.

References panel.

Referenced by ReportElevator(), and Skyscraper::ScriptProcessor::CallStationSection::Run().

◆ GetRecallFloor()

int SBS::CallStation::GetRecallFloor ( )

Definition at line 406 of file callstation.cpp.

References GetController(), and SBS::DispatchController::GetRecallFloor().

Referenced by ProcessCache().

Here is the call graph for this function:

◆ GetUpControl()

Control * SBS::CallStation::GetUpControl ( )

Definition at line 612 of file callstation.cpp.

References SBS::ButtonPanel::GetControl(), and panel.

Referenced by GetUpStatus(), Press(), and SetLights().

Here is the call graph for this function:

◆ GetUpStatus()

bool SBS::CallStation::GetUpStatus ( )

Definition at line 598 of file callstation.cpp.

References GetUpControl().

Referenced by SBS::Person::ProcessRoute(), and SetLights().

Here is the call graph for this function:

◆ Input()

bool SBS::CallStation::Input ( const std::string & text)

Definition at line 275 of file callstation.cpp.

References Error(), GetFloorFromID(), InputCache, SBS::Lock::IsLocked(), ReportError(), SBS::TimerObject::Start(), SBS::TimerObject::Stop(), timer, TimerDelay, and UpdateIndicator().

Referenced by SBS::Action::Run().

Here is the call graph for this function:

◆ IsEnabled()

bool SBS::CallStation::IsEnabled ( )
virtual

Reimplemented from SBS::Object.

Definition at line 144 of file callstation.cpp.

References is_enabled.

◆ Press()

bool SBS::CallStation::Press ( bool up)

Definition at line 622 of file callstation.cpp.

References GetDownControl(), GetUpControl(), and SBS::Control::Press().

Referenced by SBS::Person::ProcessRoute(), and SBS::Action::Run().

Here is the call graph for this function:

◆ ProcessCache()

void SBS::CallStation::ProcessCache ( )

Definition at line 324 of file callstation.cpp.

References Error(), floor, GetFloorFromID(), GetRecallFloor(), InputCache, InvalidInput, SBS::IsNumeric(), and SelectFloor().

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

Here is the call graph for this function:

◆ RemovePanel()

void SBS::CallStation::RemovePanel ( )

Definition at line 175 of file callstation.cpp.

References panel, and SBS::Object::parent_deleting.

Referenced by ~CallStation().

◆ Report()

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

Reimplemented from SBS::ObjectBase.

Definition at line 149 of file callstation.cpp.

References GetFloor(), Number, SBS::ObjectBase::Report(), and SBS::ToString().

Referenced by CallStation(), CreateButtonPanel(), CreateCallButtons(), Enabled(), SelectFloor(), SetLights(), and SetLightsGroup().

Here is the call graph for this function:

◆ ReportElevator()

void SBS::CallStation::ReportElevator ( Elevator * elevator)

Definition at line 415 of file callstation.cpp.

References SBS::ButtonPanel::Direction, GetPanel(), SBS::Object::GetPosition(), SBS::Elevator::ID, ShowDirection, and UpdateIndicator().

Here is the call graph for this function:

◆ ReportError()

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

Reimplemented from SBS::ObjectBase.

Definition at line 156 of file callstation.cpp.

References GetFloor(), Number, SBS::ObjectBase::ReportError(), and SBS::ToString().

Referenced by Call(), FireService(), Input(), and SelectFloor().

Here is the call graph for this function:

◆ SelectFloor()

bool SBS::CallStation::SelectFloor ( int floor)

◆ ServicesElevator()

bool SBS::CallStation::ServicesElevator ( int elevator)

Definition at line 221 of file callstation.cpp.

References GetController(), and SBS::DispatchController::ServicesElevator().

Here is the call graph for this function:

◆ SetController()

void SBS::CallStation::SetController ( int number)

Definition at line 200 of file callstation.cpp.

References controller, GetController(), and SBS::DispatchController::RegisterCallStation().

Referenced by SBS::Floor::AddCallButtons(), and Skyscraper::ScriptProcessor::CallStationSection::Run().

Here is the call graph for this function:

◆ SetLights()

void SBS::CallStation::SetLights ( int up,
int down )

Definition at line 529 of file callstation.cpp.

References GetDownControl(), GetDownStatus(), GetUpControl(), GetUpStatus(), Report(), SBS::ObjectBase::sbs, SBS::Control::SetSelectPosition(), and SBS::SBS::Verbose.

Here is the call graph for this function:

◆ SetLightsGroup()

void SBS::CallStation::SetLightsGroup ( int up,
int down )

Definition at line 486 of file callstation.cpp.

References floor, SBS::DispatchController::GetCallStations(), GetController(), SBS::Floor::Number, Report(), SBS::ObjectBase::sbs, and SBS::SBS::Verbose.

Referenced by DownLight(), and UpLight().

Here is the call graph for this function:

◆ SetPosition()

void SBS::CallStation::SetPosition ( Vector3 & position)

Definition at line 215 of file callstation.cpp.

References SBS::Floor::GetBase(), GetFloor(), SBS::SBS::GetFloor(), SBS::ObjectBase::sbs, and SBS::Object::SetPosition().

Referenced by Skyscraper::ScriptProcessor::CallStationSection::Run().

Here is the call graph for this function:

◆ UpdateIndicator()

void SBS::CallStation::UpdateIndicator ( const std::string & text,
bool play_sound = true )

Definition at line 269 of file callstation.cpp.

References indicator, and SBS::Indicator::Update().

Referenced by Error(), Input(), and ReportElevator().

Here is the call graph for this function:

◆ UpLight()

void SBS::CallStation::UpLight ( bool value)

Definition at line 507 of file callstation.cpp.

References SetLightsGroup().

Referenced by Call().

Here is the call graph for this function:

Member Data Documentation

◆ controller

int SBS::CallStation::controller
private

Definition at line 82 of file callstation.h.

Referenced by CallStation(), GetController(), and SetController().

◆ floor

◆ indicator

Indicator* SBS::CallStation::indicator
private

Definition at line 88 of file callstation.h.

Referenced by AddIndicator(), CallStation(), UpdateIndicator(), and ~CallStation().

◆ InputCache

std::string SBS::CallStation::InputCache
private

Definition at line 91 of file callstation.h.

Referenced by Input(), and ProcessCache().

◆ InvalidInput

std::vector<std::string> SBS::CallStation::InvalidInput

◆ is_enabled

bool SBS::CallStation::is_enabled
private

Definition at line 84 of file callstation.h.

Referenced by CallStation(), Enabled(), and IsEnabled().

◆ KeyID

int SBS::CallStation::KeyID
private

Definition at line 94 of file callstation.h.

Referenced by CallStation().

◆ Locked

bool SBS::CallStation::Locked
private

Definition at line 93 of file callstation.h.

Referenced by CallStation().

◆ Name

std::string SBS::CallStation::Name

Definition at line 35 of file callstation.h.

Referenced by Skyscraper::ScriptProcessor::CallStationSection::Run().

◆ Number

int SBS::CallStation::Number

Definition at line 36 of file callstation.h.

Referenced by CallStation(), Report(), and ReportError().

◆ panel

ButtonPanel* SBS::CallStation::panel
private

◆ ShowDirection

bool SBS::CallStation::ShowDirection

◆ timer

Timer* SBS::CallStation::timer
private

Definition at line 99 of file callstation.h.

Referenced by CallStation(), and Input().

◆ TimerDelay

Real SBS::CallStation::TimerDelay

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