46Action::Action(
Object *parent,
const std::string &name, std::vector<Object*> &action_parents,
const std::string &command,
const std::vector<std::string> ¶meters) :
ObjectBase(parent)
56 for (
size_t i = 0; i < parameters.size(); i++)
94 for (
size_t i = 0; i < count; i++)
255 Door *door =
dynamic_cast<Door*
>(parent);
258 std::string caller_name = caller->
GetName();
259 std::string caller_type = caller->
GetType();
261 std::string parent_name = parent->
GetName();
262 std::string parent_type = parent->
GetType();
271 car = elevator->
GetCar(1);
303 return car->
OpenDoors(number, 2, 0,
true);
318 return car->
OpenDoors(number, 3, 0,
true);
333 return car->
OpenDoors(number, 1, 0,
true);
348 return car->
OpenDoors(number, 2, 0,
false);
417 return elevator->
Stop(
true);
480 return elevator->
Up(
true);
487 return elevator->
Up(
false);
494 return elevator->
Down(
true);
501 return elevator->
Down(
false);
521 return elevator->
Up();
523 return elevator->
Down();
598 int param1 = 0, param2 = 0;
600 return car->
OpenDoors(param1, 3, param2,
false);
608 int param1 = 0, param2 = 0;
621 int param1 = 0, param2 = 0;
623 return car->
OpenDoors(param1, 3, param2,
true);
631 int param1 = 0, param2 = 0;
678 return car->
Input(
"1");
680 return car->
Input(
"2");
682 return car->
Input(
"3");
684 return car->
Input(
"4");
686 return car->
Input(
"5");
688 return car->
Input(
"6");
690 return car->
Input(
"7");
692 return car->
Input(
"8");
694 return car->
Input(
"9");
696 return car->
Input(
"0");
698 return car->
Input(
"-");
700 return car->
Input(
"*");
702 return car->
Input(
"<");
710 if (floor && callstation)
727 return callstation->
Input(
"1");
729 return callstation->
Input(
"2");
731 return callstation->
Input(
"3");
733 return callstation->
Input(
"4");
735 return callstation->
Input(
"5");
737 return callstation->
Input(
"6");
739 return callstation->
Input(
"7");
741 return callstation->
Input(
"8");
743 return callstation->
Input(
"9");
745 return callstation->
Input(
"0");
747 return callstation->
Input(
"-");
749 return callstation->
Input(
"*");
751 return callstation->
Input(
"<");
753 return callstation->
Call(
true);
755 return callstation->
Call(
false);
757 return callstation->
Press(
true);
759 return callstation->
Press(
false);
877 if (parent_type ==
"Mesh")
881 if (parent_name ==
"Landscape")
883 if (parent_name ==
"Buildings")
887 if (parent_type ==
"Floor")
896 if (parent_type ==
"Elevator" || parent_type ==
"ElevatorCar")
902 if (parent_type ==
"Shaft")
911 if (parent_type ==
"Stairwell")
928 std::vector<Sound*> soundlist;
930 if (parent_type ==
"SBS")
932 else if (parent_type ==
"Floor")
939 else if (parent_type ==
"Elevator" || parent_type ==
"ElevatorCar")
947 if ((
int)soundlist.size() > 0)
949 for (
size_t i = 0; i < soundlist.size(); i++)
954 bool result = soundlist[i]->Play();
956 if ((
int)soundlist.size() == 1)
970 std::vector<Sound*> soundlist;
972 if (parent_type ==
"SBS")
974 else if (parent_type ==
"Floor")
981 else if (parent_type ==
"Elevator" || parent_type ==
"ElevatorCar")
991 for (
size_t i = 0; i < soundlist.size(); i++)
994 soundlist[i]->Stop();
bool AddParent(Object *parent)
bool Run(Object *caller, Object *parent, bool &hold)
std::string GetCommandName()
std::string GetParentName(int number)
bool RemoveParent(Object *parent)
std::string GetParameter(int index)
std::vector< Object * > parent_objects
std::vector< std::string > command_parameters
bool DoAction(Object *caller, bool &hold)
Action(Object *parent, const std::string &name, std::vector< Object * > &action_parents, const std::string &command, const std::vector< std::string > ¶meters)
std::string GetParentType(int number)
bool SelectFloor(int floor)
bool Input(const std::string &text)
bool FireService(int value)
bool Call(bool direction)
void Teleport(Real X, Real Y, Real Z)
void GotoFloor(int floor, bool disable_current=true)
void Close(bool playsound=true)
bool Open(Vector3 &position, bool playsound=true, bool force=false)
void AutoClose(int interval)
void StopDoors(int number=0)
void HoldDoors(int number=0, bool sensor=false)
std::vector< Sound * > GetSound(const std::string &name)
bool OpenDoors(int number=0, int whichdoors=1, int floor=0, bool manual=false, bool hold=false)
bool ReplaceTexture(const std::string &oldtexture, const std::string &newtexture)
bool Input(const std::string &text)
void CloseDoors(int number=0, int whichdoors=1, int floor=0, bool manual=false, bool hold=false)
void ResetDoors(int number=0, bool sensor=false)
void EnableSensor(bool value, int number=0)
bool EnableACP(bool value)
bool EnableIndependentService(bool value, int car_number=0)
bool SetDownButton(bool value)
bool SetUpButton(bool value)
bool EnableUpPeak(bool value)
ElevatorCar * GetCar(int number)
bool EnableDownPeak(bool value)
bool SelectFloor(int floor)
bool ReturnToNearestFloor(bool parking=true, int car=1)
bool Stop(bool emergency=false)
void SetRunState(bool value)
bool EnableInspectionService(bool value)
CallStation * GetPrimaryCallStation()
bool SetHoistwayAccess(int floor, int access)
bool EnableFireService2(int value, int car_number=0, bool force=false)
bool SetGoButton(bool value)
std::vector< Sound * > GetSound(const std::string &name)
void ReplaceTexture(const std::string &oldtexture, const std::string &newtexture)
bool ReplaceTexture(const std::string &oldtexture, const std::string &newtexture)
const std::string & GetName()
virtual void Report(const std::string &message)
void SetName(const std::string &name)
virtual Vector3 GetPosition(bool relative=false)
const std::string & GetType()
Floor * GetFloor(int number)
std::vector< Sound * > GetSound(const std::string &name)
void ReplaceTexture(const std::string &oldtexture, const std::string &newtexture)
void ReplaceTexture(const std::string &oldtexture, const std::string &newtexture)
int ToInt(const std::string &string)
void SetCase(std::string &string, bool uppercase)
Real ToFloat(const std::string &string)
bool IsNumeric(char character)
bool StartsWith(const std::string &string, const std::string &check_string, bool ignore_case)
void TrimString(std::string &string)
bool ToBool(std::string string)
#define SBS_PROFILE(name)