Skyscraper 2.0
|
#include <control.h>
Public Member Functions | |
Control (Object *parent, const std::string &name, bool permanent, const std::string &sound, const std::vector< std::string > &action_names, const std::vector< Action * > &actions, std::vector< std::string > &textures, const std::string &direction, Real width, Real height, bool center, int selection_position) | |
~Control () | |
void | Enabled (bool value) |
bool | SetSelectPosition (int position) |
bool | ChangeSelectPosition (int position) |
bool | NextSelectPosition (bool check_state=true) |
bool | PreviousSelectPosition (bool check_state=true) |
int | GetSelectPosition () |
std::string | GetPositionAction (int position) |
std::string | GetSelectPositionAction () |
int | GetNextSelectPosition () |
int | GetPreviousSelectPosition () |
int | GetPositions () |
void | PlaySound () |
void | SetTexture (int position, const std::string &texture) |
std::string | GetTexture (int position) |
int | FindActionPosition (const std::string &name) |
int | FindNumericActionPosition () |
bool | DoAction () |
bool | Press (bool reverse=false) |
void | ChangeFloorLight (int floor, bool value) |
void | ChangeLight (bool value) |
void | RemoveAction (Action *action) |
bool | IsEnabled () |
bool | GetLightStatus () |
void | OnClick (Vector3 &position, bool shift, bool ctrl, bool alt, bool right) |
void | OnUnclick (bool right) |
void | Report (const std::string &message) |
bool | ReportError (const std::string &message) |
![]() | |
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) |
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 | 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 () |
![]() | |
ObjectBase (Object *parent) | |
virtual | ~ObjectBase () |
Object * | GetParent () |
SBS * | GetRoot () |
void | SetName (const std::string &name) |
const std::string & | GetName () |
std::string | GetNameBase () |
![]() | |
Lock (Object *parent) | |
virtual | ~Lock () |
void | SetLocked (bool value, int keyid) |
bool | IsLocked () |
bool | ToggleLock (bool force=false) |
int | GetKeyID () |
Public Attributes | |
std::string | Direction |
![]() | |
std::string | command |
std::string | command_processed |
std::string | context |
int | linenum |
std::string | includefile |
bool | parent_deleting |
Private Attributes | |
MeshObject * | ControlMesh |
int | current_position |
std::vector< std::string > | TextureArray |
std::vector< std::string > | ActionNames |
std::vector< Action * > | Actions |
Sound * | sound |
bool | light_status |
bool | is_enabled |
bool | action_hold |
bool | action_result |
Additional Inherited Members | |
![]() | |
void | EnableLoop (bool value) |
void | LoopChildren () |
bool | SelfDestruct () |
![]() | |
SBS * | sbs |
SBS::Control::Control | ( | Object * | parent, |
const std::string & | name, | ||
bool | permanent, | ||
const std::string & | sound, | ||
const std::vector< std::string > & | action_names, | ||
const std::vector< Action * > & | actions, | ||
std::vector< std::string > & | textures, | ||
const std::string & | direction, | ||
Real | width, | ||
Real | height, | ||
bool | center, | ||
int | selection_position ) |
Definition at line 39 of file control.cpp.
References action_hold, ActionNames, Actions, SBS::SBS::AddWallMain(), ControlMesh, SBS::MeshObject::CreateWallObject(), Direction, SBS::SBS::DrawWalls(), SBS::SBS::GetConfigFloat(), GetTexture(), is_enabled, light_status, SBS::Sound::Load(), SBS::SBS::RegisterControl(), SBS::SBS::ResetWalls(), SBS::ObjectBase::sbs, SBS::SetCase(), SetSelectPosition(), SBS::Object::SetValues(), sound, SBS::SBS::TexelOverride, TextureArray, and SBS::TrimString().
SBS::Control::~Control | ( | ) |
Definition at line 136 of file control.cpp.
References ControlMesh, SBS::SBS::FastDelete, SBS::ObjectBase::GetParent(), SBS::Object::GetType(), SBS::Object::parent_deleting, SBS::SBS::RemoveControl(), SBS::ObjectBase::sbs, sound, and SBS::SBS::UnregisterControl().
void SBS::Control::ChangeFloorLight | ( | int | floor, |
bool | value ) |
Definition at line 432 of file control.cpp.
References ChangeSelectPosition(), FindActionPosition(), light_status, and SBS::ToString().
void SBS::Control::ChangeLight | ( | bool | value | ) |
Definition at line 453 of file control.cpp.
References ChangeSelectPosition(), FindActionPosition(), FindNumericActionPosition(), and light_status.
bool SBS::Control::ChangeSelectPosition | ( | int | position | ) |
Definition at line 202 of file control.cpp.
References current_position, and SetSelectPosition().
Referenced by ChangeFloorLight(), ChangeLight(), NextSelectPosition(), and PreviousSelectPosition().
bool SBS::Control::DoAction | ( | ) |
Definition at line 358 of file control.cpp.
References action_hold, ActionNames, Actions, current_position, SBS::SBS::GetAction(), ReportError(), and SBS::ObjectBase::sbs.
Referenced by Press().
|
virtual |
Reimplemented from SBS::Object.
Definition at line 179 of file control.cpp.
References ControlMesh, SBS::MeshObject::Enabled(), and is_enabled.
int SBS::Control::FindActionPosition | ( | const std::string & | name | ) |
Definition at line 330 of file control.cpp.
References GetPositionAction(), and GetPositions().
Referenced by ChangeFloorLight(), ChangeLight(), and SBS::ButtonPanel::SetControls().
int SBS::Control::FindNumericActionPosition | ( | ) |
Definition at line 344 of file control.cpp.
References GetPositionAction(), GetPositions(), and SBS::IsNumeric().
Referenced by ChangeLight().
|
inline |
Definition at line 61 of file control.h.
Referenced by SBS::Elevator::CancelHallCall().
int SBS::Control::GetNextSelectPosition | ( | ) |
Definition at line 224 of file control.cpp.
References current_position, and GetPositions().
Referenced by NextSelectPosition(), and Press().
std::string SBS::Control::GetPositionAction | ( | int | position | ) |
Definition at line 273 of file control.cpp.
References ActionNames, Actions, SBS::SBS::GetAction(), and SBS::ObjectBase::sbs.
Referenced by FindActionPosition(), FindNumericActionPosition(), GetSelectPositionAction(), and Press().
int SBS::Control::GetPositions | ( | ) |
Definition at line 321 of file control.cpp.
References ActionNames, and Actions.
Referenced by FindActionPosition(), FindNumericActionPosition(), GetNextSelectPosition(), GetPreviousSelectPosition(), GetTexture(), SetSelectPosition(), and SetTexture().
int SBS::Control::GetPreviousSelectPosition | ( | ) |
Definition at line 246 of file control.cpp.
References current_position, and GetPositions().
Referenced by Press(), and PreviousSelectPosition().
int SBS::Control::GetSelectPosition | ( | ) |
Definition at line 267 of file control.cpp.
References current_position.
std::string SBS::Control::GetSelectPositionAction | ( | ) |
Definition at line 295 of file control.cpp.
References current_position, and GetPositionAction().
Referenced by Press().
std::string SBS::Control::GetTexture | ( | int | position | ) |
Definition at line 311 of file control.cpp.
References GetPositions(), and TextureArray.
Referenced by Control(), and SetSelectPosition().
bool SBS::Control::NextSelectPosition | ( | bool | check_state = true | ) |
Definition at line 212 of file control.cpp.
References ChangeSelectPosition(), GetNextSelectPosition(), and SetSelectPosition().
Referenced by OnUnclick(), and Press().
|
virtual |
Reimplemented from SBS::Object.
Definition at line 484 of file control.cpp.
References Press(), and SBS::Lock::ToggleLock().
|
virtual |
Reimplemented from SBS::Object.
Definition at line 493 of file control.cpp.
References action_hold, action_result, NextSelectPosition(), and PreviousSelectPosition().
void SBS::Control::PlaySound | ( | ) |
Definition at line 256 of file control.cpp.
References SBS::Sound::Play(), SBS::Sound::SetLoopState(), and sound.
Referenced by Press().
bool SBS::Control::Press | ( | bool | reverse = false | ) |
Definition at line 386 of file control.cpp.
References action_result, DoAction(), GetNextSelectPosition(), GetPositionAction(), GetPreviousSelectPosition(), GetSelectPositionAction(), SBS::Lock::IsLocked(), SBS::IsNumeric(), NextSelectPosition(), PlaySound(), PreviousSelectPosition(), and ReportError().
Referenced by OnClick(), SBS::CallStation::Press(), and SBS::Person::ProcessRoute().
bool SBS::Control::PreviousSelectPosition | ( | bool | check_state = true | ) |
Definition at line 234 of file control.cpp.
References ChangeSelectPosition(), GetPreviousSelectPosition(), and SetSelectPosition().
Referenced by OnUnclick(), and Press().
void SBS::Control::RemoveAction | ( | Action * | action | ) |
Definition at line 472 of file control.cpp.
References Actions.
|
virtual |
Reimplemented from SBS::ObjectBase.
Definition at line 511 of file control.cpp.
References SBS::ObjectBase::GetName(), and SBS::ObjectBase::Report().
|
virtual |
Reimplemented from SBS::ObjectBase.
Definition at line 517 of file control.cpp.
References SBS::ObjectBase::GetName(), and SBS::ObjectBase::ReportError().
Referenced by DoAction(), and Press().
bool SBS::Control::SetSelectPosition | ( | int | position | ) |
Definition at line 190 of file control.cpp.
References SBS::MeshObject::ChangeTexture(), ControlMesh, current_position, GetPositions(), and GetTexture().
Referenced by ChangeSelectPosition(), Control(), NextSelectPosition(), PreviousSelectPosition(), and SBS::CallStation::SetLights().
void SBS::Control::SetTexture | ( | int | position, |
const std::string & | texture ) |
Definition at line 301 of file control.cpp.
References GetPositions(), and TextureArray.
|
private |
Definition at line 77 of file control.h.
Referenced by Control(), DoAction(), and OnUnclick().
|
private |
Definition at line 78 of file control.h.
Referenced by OnUnclick(), and Press().
|
private |
Definition at line 71 of file control.h.
Referenced by Control(), DoAction(), GetPositionAction(), and GetPositions().
|
private |
Definition at line 72 of file control.h.
Referenced by Control(), DoAction(), GetPositionAction(), GetPositions(), and RemoveAction().
|
private |
Definition at line 68 of file control.h.
Referenced by Control(), Enabled(), SetSelectPosition(), and ~Control().
|
private |
Definition at line 69 of file control.h.
Referenced by ChangeSelectPosition(), DoAction(), GetNextSelectPosition(), GetPreviousSelectPosition(), GetSelectPosition(), GetSelectPositionAction(), and SetSelectPosition().
std::string SBS::Control::Direction |
|
private |
|
private |
Definition at line 75 of file control.h.
Referenced by ChangeFloorLight(), ChangeLight(), and Control().
|
private |
Definition at line 74 of file control.h.
Referenced by Control(), PlaySound(), and ~Control().
|
private |
Definition at line 70 of file control.h.
Referenced by Control(), GetTexture(), and SetTexture().