Skyscraper 2.0
|
#include <person.h>
Classes | |
struct | RouteEntry |
class | Timer |
Public Member Functions | |
Person (Object *parent, const std::string &name, int floor, bool service_access=false) | |
~Person () | |
void | GotoFloor (int floor) |
void | Loop () |
void | ProcessRoute () |
void | Report (const std::string &message) |
bool | ReportError (const std::string &message) |
int | GetRandomFloor () |
bool | IsRouteActive () |
bool | IsRandomActivityEnabled () |
void | EnableRandomActivity (bool value) |
void | SetFloor (int value) |
int | GetFloor () |
int | GetDestinationFloor () |
void | SetServiceAccess (bool value) |
bool | GetServiceAccess () |
void | Stop () |
std::string | GetStatus () |
![]() | |
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 | 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) |
virtual void | Enabled (bool value) |
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 | |
RandomGen * | rnd_time |
RandomGen * | rnd_dest |
![]() | |
std::string | command |
std::string | command_processed |
std::string | context |
int | linenum |
std::string | includefile |
bool | parent_deleting |
Private Attributes | |
int | current_floor |
int | dest_floor |
bool | service_access |
std::vector< RouteEntry > | route |
Timer * | random_timer |
int | RandomProbability |
Real | RandomFrequency |
Additional Inherited Members | |
![]() | |
void | EnableLoop (bool value) |
void | LoopChildren () |
bool | SelfDestruct () |
![]() | |
SBS * | sbs |
SBS::Person::Person | ( | Object * | parent, |
const std::string & | name, | ||
int | floor, | ||
bool | service_access = false ) |
Definition at line 51 of file person.cpp.
References current_floor, dest_floor, SBS::Object::EnableLoop(), SBS::SBS::GetConfigFloat(), SBS::SBS::GetConfigInt(), SBS::Object::GetNumber(), random_timer, RandomFrequency, RandomProbability, rnd_dest, rnd_time, SBS::ObjectBase::sbs, service_access, SetFloor(), and SBS::Object::SetValues().
SBS::Person::~Person | ( | ) |
Definition at line 75 of file person.cpp.
References SBS::SBS::FastDelete, SBS::Object::parent_deleting, random_timer, SBS::SBS::RemovePerson(), rnd_dest, rnd_time, SBS::ObjectBase::sbs, and Stop().
void SBS::Person::EnableRandomActivity | ( | bool | value | ) |
Definition at line 101 of file person.cpp.
References random_timer, RandomFrequency, Report(), SBS::TimerObject::Start(), and SBS::TimerObject::Stop().
Referenced by SBS::SBS::EnableRandomActivity(), and Skyscraper::PeopleManager::On_chkRandom_Click().
|
inline |
Definition at line 49 of file person.h.
Referenced by Skyscraper::PeopleManager::Loop().
|
inline |
Definition at line 48 of file person.h.
Referenced by Skyscraper::PeopleManager::Loop().
int SBS::Person::GetRandomFloor | ( | ) |
Definition at line 116 of file person.cpp.
References SBS::SBS::Basements, SBS::RandomGen::Get(), SBS::SBS::GetTotalFloors(), rnd_dest, and SBS::ObjectBase::sbs.
Referenced by SBS::Person::Timer::Notify().
|
inline |
Definition at line 51 of file person.h.
Referenced by Skyscraper::PeopleManager::Loop().
std::string SBS::Person::GetStatus | ( | ) |
Definition at line 452 of file person.cpp.
References SBS::ElevatorCar::AreDoorsOpen(), current_floor, SBS::ElevatorCar::GetElevator(), SBS::SBS::GetFloor(), SBS::Floor::ID, IsRouteActive(), SBS::Elevator::Number, route, SBS::ObjectBase::sbs, and SBS::ToString().
Referenced by Skyscraper::PeopleManager::Loop().
void SBS::Person::GotoFloor | ( | int | floor | ) |
Definition at line 121 of file person.cpp.
References SBS::Person::RouteEntry::call_made, SBS::Person::RouteEntry::callstation, current_floor, dest_floor, SBS::Person::RouteEntry::destination, SBS::Person::RouteEntry::elevator_route, SBS::Person::RouteEntry::floor_selected, SBS::SBS::GetFloor(), SBS::SBS::GetRouteToFloor(), SBS::Floor::ID, SBS::Person::RouteEntry::in_elevator, IsRouteActive(), SBS::Elevator::Name, SBS::Elevator::Number, Report(), route, SBS::ObjectBase::sbs, service_access, SBS::ToString(), and SBS::SBS::Verbose.
Referenced by SBS::Person::Timer::Notify(), and Skyscraper::PeopleManager::On_bGo_Click().
bool SBS::Person::IsRandomActivityEnabled | ( | ) |
Definition at line 508 of file person.cpp.
References SBS::TimerObject::IsRunning(), and random_timer.
Referenced by Skyscraper::PeopleManager::Loop().
|
inline |
Definition at line 44 of file person.h.
Referenced by GetStatus(), GotoFloor(), Skyscraper::PeopleManager::Loop(), SBS::Person::Timer::Notify(), ProcessRoute(), and SetFloor().
|
virtual |
Reimplemented from SBS::Object.
Definition at line 172 of file person.cpp.
References ProcessRoute(), and SBS_PROFILE.
void SBS::Person::ProcessRoute | ( | ) |
Definition at line 179 of file person.cpp.
References SBS::ElevatorCar::AreDoorsOpen(), current_floor, dest_floor, SBS::Elevator::FireServicePhase1, SBS::Elevator::GetActiveRecallFloor(), SBS::Floor::GetCallStationForElevator(), SBS::Elevator::GetCarForFloor(), SBS::Elevator::GetDestinationDispatch(), SBS::CallStation::GetDownStatus(), SBS::ElevatorCar::GetElevator(), SBS::SBS::GetElevator(), SBS::CallStation::GetElevatorArrived(), SBS::CallStation::GetElevatorArrivedStandard(), SBS::ElevatorCar::GetFloor(), SBS::SBS::GetFloor(), SBS::ElevatorCar::GetFloorButton(), SBS::CallStation::GetUpStatus(), SBS::Floor::ID, SBS::Elevator::InServiceMode(), SBS::Lock::IsLocked(), SBS::Elevator::IsMoving, IsRouteActive(), SBS::Elevator::Number, SBS::Elevator::OnFloor, SBS::CallStation::Press(), SBS::Control::Press(), Report(), route, SBS::ObjectBase::sbs, SBS_PROFILE, SBS::CallStation::SelectFloor(), Stop(), and SBS::ToString().
Referenced by Loop().
|
virtual |
Reimplemented from SBS::ObjectBase.
Definition at line 401 of file person.cpp.
References SBS::ObjectBase::GetName(), and SBS::ObjectBase::Report().
Referenced by EnableRandomActivity(), GotoFloor(), ProcessRoute(), and SetFloor().
|
virtual |
Reimplemented from SBS::ObjectBase.
Definition at line 407 of file person.cpp.
References SBS::ObjectBase::GetName(), and SBS::ObjectBase::ReportError().
void SBS::Person::SetFloor | ( | int | value | ) |
Definition at line 425 of file person.cpp.
References current_floor, SBS::SBS::GetFloor(), IsRouteActive(), Report(), SBS::ObjectBase::sbs, and SBS::ToString().
Referenced by Skyscraper::PeopleManager::On_bSetFloor_Click(), and Person().
|
inline |
Definition at line 50 of file person.h.
Referenced by Skyscraper::PeopleManager::On_chkService_Click().
void SBS::Person::Stop | ( | ) |
Definition at line 437 of file person.cpp.
References route.
Referenced by Skyscraper::PeopleManager::On_bStop_Click(), ProcessRoute(), and ~Person().
|
private |
Definition at line 67 of file person.h.
Referenced by GetStatus(), GotoFloor(), Person(), ProcessRoute(), and SetFloor().
|
private |
Definition at line 68 of file person.h.
Referenced by GotoFloor(), Person(), and ProcessRoute().
|
private |
Definition at line 75 of file person.h.
Referenced by EnableRandomActivity(), IsRandomActivityEnabled(), Person(), and ~Person().
|
private |
Definition at line 78 of file person.h.
Referenced by EnableRandomActivity(), and Person().
|
private |
Definition at line 77 of file person.h.
Referenced by SBS::Person::Timer::Notify(), and Person().
RandomGen * SBS::Person::rnd_dest |
Definition at line 33 of file person.h.
Referenced by GetRandomFloor(), Person(), and ~Person().
RandomGen* SBS::Person::rnd_time |
Definition at line 33 of file person.h.
Referenced by SBS::Person::Timer::Notify(), Person(), and ~Person().
|
private |
Definition at line 70 of file person.h.
Referenced by GetStatus(), GotoFloor(), ProcessRoute(), and Stop().
|
private |
Definition at line 69 of file person.h.
Referenced by GotoFloor(), and Person().