Skyscraper 2.0
|
#include <escalator.h>
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 () |
![]() | |
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 | 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 () |
![]() | |
ObjectBase (Object *parent) | |
virtual | ~ObjectBase () |
Object * | GetParent () |
SBS * | GetRoot () |
void | SetName (const std::string &name) |
const std::string & | GetName () |
std::string | GetNameBase () |
Public Attributes | |
Real | Speed |
![]() | |
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 | |
Sound * | sound |
int | Run |
bool | is_enabled |
Vector3 | start |
Vector3 | end |
std::string | Direction |
Real | treadsize |
Real | risersize |
int | buffer_zone_steps |
std::vector< Step * > | Steps |
Timer * | malfunction_timer |
int | RandomProbability |
Real | RandomFrequency |
RandomGen * | rnd_time |
RandomGen * | rnd_type |
Additional Inherited Members | |
![]() | |
void | EnableLoop (bool value) |
void | LoopChildren () |
bool | SelfDestruct () |
![]() | |
SBS * | sbs |
Definition at line 29 of file escalator.h.
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 ) |
Definition at line 52 of file escalator.cpp.
References buffer_zone_steps, CreateSteps(), end, SBS::SBS::GetConfigFloat(), SBS::SBS::GetConfigInt(), SBS::Object::GetNumber(), is_enabled, SBS::Sound::Load(), malfunction_timer, SBS::Object::Move(), SBS::ObjectBase::Name, SBS::Floor::Number, RandomFrequency, RandomProbability, SBS::SBS::RegisterEscalator(), risersize, rnd_time, rnd_type, SBS::ObjectBase::sbs, SBS::ObjectBase::SetName(), SetRun(), SBS::Object::SetValues(), sound, Speed, start, Steps, SBS::ToString(), and treadsize.
SBS::Escalator::~Escalator | ( | ) |
Definition at line 108 of file escalator.cpp.
References SBS::SBS::FastDelete, SBS::ObjectBase::GetParent(), SBS::Object::GetType(), malfunction_timer, SBS::Object::parent_deleting, rnd_time, rnd_type, SBS::ObjectBase::sbs, sound, Steps, and SBS::SBS::UnregisterEscalator().
|
private |
Definition at line 233 of file escalator.cpp.
References SBS::SBS::AddFloorMain(), SBS::SBS::AddWallMain(), buffer_zone_steps, Direction, SBS::SBS::DrawWalls(), end, SBS::ObjectBase::GetName(), SBS::SBS::GetTextureManager(), SBS::Object::Move(), SBS::ObjectBase::Name, SBS::TextureManager::ResetTextureMapping(), SBS::SBS::ResetWalls(), risersize, SBS::ObjectBase::sbs, SBS::SetCase(), SBS::SBS::SetWallOrientation(), start, Steps, SBS::ToString(), treadsize, and SBS::TrimString().
Referenced by Escalator().
|
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().
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().
|
inline |
Definition at line 44 of file escalator.h.
Referenced by Skyscraper::EscalatorControl::Loop(), Malfunction(), SBS::Escalator::Timer::Notify(), and Skyscraper::EscalatorControl::UpdateRunState().
|
inline |
Definition at line 40 of file escalator.h.
Referenced by 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().
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().
|
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().
|
virtual |
Reimplemented from SBS::Object.
Definition at line 461 of file escalator.cpp.
References SBS::SBS::GetPower(), Run, SBS::ObjectBase::sbs, and Steps.
|
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().
|
virtual |
Reimplemented from SBS::ObjectBase.
Definition at line 198 of file escalator.cpp.
References SBS::ObjectBase::GetName(), and SBS::ObjectBase::ReportError().
|
virtual |
Reimplemented from SBS::Object.
Definition at line 487 of file escalator.cpp.
void SBS::Escalator::SetRun | ( | int | value | ) |
Definition at line 178 of file escalator.cpp.
Referenced by Escalator(), Malfunction(), Skyscraper::EscalatorControl::On_Slider1_Scroll(), and SBS::Action::Run().
|
private |
Definition at line 56 of file escalator.h.
Referenced by CreateSteps(), and Escalator().
|
private |
Definition at line 53 of file escalator.h.
Referenced by CreateSteps(), and MoveSteps().
|
private |
Definition at line 52 of file escalator.h.
Referenced by CreateSteps(), Escalator(), and MoveSteps().
|
private |
Definition at line 51 of file escalator.h.
Referenced by Enabled(), and Escalator().
|
private |
Definition at line 62 of file escalator.h.
Referenced by EnableMalfunctions(), Escalator(), and ~Escalator().
|
private |
Definition at line 64 of file escalator.h.
Referenced by EnableMalfunctions(), and Escalator().
|
private |
Definition at line 63 of file escalator.h.
Referenced by Escalator(), and SBS::Escalator::Timer::Notify().
|
private |
Definition at line 55 of file escalator.h.
Referenced by CreateSteps(), Escalator(), and MoveSteps().
|
private |
Definition at line 65 of file escalator.h.
Referenced by Escalator(), SBS::Escalator::Timer::Notify(), and ~Escalator().
|
private |
Definition at line 65 of file escalator.h.
Referenced by Escalator(), Malfunction(), and ~Escalator().
|
private |
Definition at line 50 of file escalator.h.
Referenced by Loop(), MoveSteps(), OnClick(), ResetState(), and SetRun().
|
private |
Definition at line 49 of file escalator.h.
Referenced by Enabled(), Escalator(), Loop(), and ~Escalator().
Real SBS::Escalator::Speed |
Definition at line 32 of file escalator.h.
Referenced by Escalator(), and MoveSteps().
|
private |
Definition at line 52 of file escalator.h.
Referenced by CreateSteps(), Escalator(), MoveSteps(), and ResetState().
|
private |
Definition at line 58 of file escalator.h.
Referenced by CreateSteps(), Enabled(), Escalator(), MoveSteps(), OnClick(), ResetState(), SetRun(), and ~Escalator().
|
private |
Definition at line 54 of file escalator.h.
Referenced by CreateSteps(), Escalator(), and MoveSteps().