24#ifndef _SBS_ELEVATOR_H
25#define _SBS_ELEVATOR_H
42 int LastQueueFloor[2];
131 bool CreateElevator(
bool relative,
Real x,
Real z,
int floor);
132 Wall* CreateCounterweight(
const std::string &frame_texture,
const std::string &weight_texture,
Real x,
Real z,
const Vector3 &size,
Real weight_voffset);
133 bool AddRails(
const std::string &main_texture,
const std::string &edge_texture,
Real x,
Real z,
bool orientation,
Real rail_distance,
Real rail_width);
134 bool AddRoute(
int floor,
int direction,
int call_type);
135 bool DeleteRoute(
int floor,
int direction);
136 bool RouteExists(
bool direction,
int floor);
138 bool CallCancelAll();
139 bool Stop(
bool emergency =
false);
140 void ProcessCallQueue();
143 void Enabled(
bool value);
145 Real GetElevatorStart();
146 Real GetDestination();
147 Real GetStoppingDistance();
148 bool GetBrakeStatus();
149 int GetEmergencyStopStatus();
150 void UpdateFloorIndicators();
152 Real GetJerkPosition();
153 void SetFloorSkipText(
const std::string &
id);
154 std::string GetFloorSkipText();
155 bool InServiceMode();
156 bool Go(
int floor,
bool hold =
false);
157 bool EnableACP(
bool value);
158 bool EnableUpPeak(
bool value);
159 bool EnableDownPeak(
bool value);
160 bool EnableIndependentService(
bool value,
int car_number = 0);
161 bool EnableInspectionService(
bool value);
162 bool EnableFireService1(
int value);
163 bool EnableFireService2(
int value,
int car_number = 0,
bool force =
false);
164 bool SetRecallFloor(
int floor);
165 bool SetAlternateRecallFloor(
int floor);
166 bool SetACPFloor(
int floor);
167 void GoToRecallFloor();
170 bool SetGoButton(
bool value);
171 bool SetUpButton(
bool value);
172 bool SetDownButton(
bool value);
174 int GetBottomFloor();
175 void UpdateDirectionalIndicators();
177 void ResetQueue(
bool up,
bool down,
bool stop_if_empty =
true);
178 void DeleteActiveRoute();
179 bool IsQueueActive();
180 bool BeyondDecelMarker(
int direction,
Real destination);
181 void Report(
const std::string &message);
182 bool ReportError(
const std::string &message);
183 bool IsQueued(
int floor,
int queue = 0);
184 void SetRunState(
bool value);
186 bool GetArrivalDirection(
int floor);
187 void MoveObjects(
Real offset);
189 int AvailableForCall(
bool destination,
int floor,
int direction,
bool report_on_failure =
true);
190 bool SelectFloor(
int floor);
192 bool ReturnToNearestFloor(
bool parking =
true,
int car = 1);
193 bool ReturnToBottomFloor();
198 bool Down(
bool value);
201 int GetActiveCallFloor();
202 int GetActiveCallDirection();
203 int GetActiveCallType();
207 bool OnRecallFloor();
208 int GetActiveRecallFloor();
209 std::vector<Floor*> GetLobbies();
211 void CancelHallCall(
int floor,
int direction);
212 bool IsManuallyStopped();
214 bool CheckInterlocks(
bool skip_current_floor =
false);
216 int AreDoorsMoving(
bool car_doors =
true,
bool shaft_doors =
true);
217 bool AreShaftDoorsClosed(
bool skip_current_floor =
false);
219 bool AreDoorsOpening(
bool car_doors =
true,
bool shaft_doors =
true);
220 bool AreDoorsClosing(
bool car_doors =
true,
bool shaft_doors =
true);
221 bool IsServicedFloor(
int floor,
bool report =
true);
222 void ChangeLight(
int floor,
bool value);
226 bool GetHoldStatus();
228 bool OnBottomFloor();
229 bool IsNudgeModeActive();
230 void ResetShaftDoors(
int floor);
232 void ResetNudgeTimers(
bool start =
true);
234 void EnableNudgeMode(
bool value);
235 bool OnParkingFloor();
236 bool SetHoistwayAccess(
int floor,
int access);
237 void SetControls(
const std::string &action_name);
238 bool GetDestinationDispatch();
239 int GetRecallFloor();
240 void AddController(
int controller);
241 void RemoveController(
int controller);
242 bool GetCallStatus(
int floor,
bool &up,
bool &down);
244 void EnableMalfunctions(
bool value);
251 ElevatorCar* GetCarForFloor(
int number,
bool report_on_failure =
false);
252 int GetFloorForCar(
int car,
int number);
253 Real GetCarOffset(
int number);
275 this->call_type = call_type;
277 this->direction = direction;
282 return floor < element.
floor;
301 std::vector<ElevatorCar*>
Cars;
328 void MoveElevatorToFloor();
330 void PlayStartingSounds();
331 void PlayStoppingSounds(
bool emergency =
false);
332 void PlayMovingSounds();
333 void HandleDequeue(
int direction,
bool stop_if_empty =
true);
335 Real GetDestinationAltitude(
int floor);
336 Real GetDestinationOffset(
int floor);
337 void DirectionalIndicatorsOff();
338 void NotifyArrival(
bool early =
false);
339 void ProcessGotoFloor(
int floor,
int direction);
340 void DoSetControls();
341 void SameFloorArrival(
int floor,
int direction);
bool operator<(const XrUuidMSFT &lh, const XrUuidMSFT &rh) noexcept
std::string MotorUpRunSound
std::string CounterweightStopSound
std::string MotorEmergencyStopSound
std::string FloorSkipText
DynamicMesh * DoorContainer
std::string MotorDownStartSound
int QueuePositionDirection
std::vector< QueueEntry > UpQueue
std::string MotorDownRunSound
Timer * malfunction_timer
std::vector< ElevatorCar * > Cars
std::string MotorUpStopSound
bool CalculateStoppingDistance
std::queue< std::string > ControlQueue
DynamicMesh * GetDoorContainer()
std::string MotorIdleSound
std::string MotorUpStartSound
std::vector< QueueEntry > DownQueue
int IndependentServiceCar
Sound * counterweightsound
std::string MotorDownStopSound
std::string CounterweightStartSound
std::vector< int > Controllers
MeshObject * WeightRopeMesh
std::string CounterweightMoveSound
QueueEntry(int floor, int call_type, int car, int direction)