Skyscraper 2.0
callstation.h
Go to the documentation of this file.
1/*
2 Scalable Building Simulator - Call Station Object
3 The Skyscraper Project - Version 2.0
4 Copyright (C)2004-2024 Ryan Thoryk
5 https://www.skyscrapersim.net
6 https://sourceforge.net/projects/skyscraper/
7 Contact - ryan@skyscrapersim.net
8
9 This program is free software; you can redistribute it and/or
10 modify it under the terms of the GNU General Public License
11 as published by the Free Software Foundation; either version 2
12 of the License, or (at your option) any later version.
13
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
18
19 You should have received a copy of the GNU General Public License
20 along with this program; if not, write to the Free Software
21 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22*/
23
24#ifndef _SBS_CALLSTATION_H
25#define _SBS_CALLSTATION_H
26
27#include "lock.h"
28
29namespace SBS {
30
31class SBSIMPEXP CallStation : public Object, public Lock
32{
33public:
34
35 std::string Name;
36 int Number;
37 std::vector<std::string> InvalidInput;
40
41 //functions
42 CallStation(Object *parent, int floornum, int number);
44 ButtonPanel* CreateButtonPanel(const std::string &texture, int rows, int columns, const std::string &direction, Real width, Real height, Real spacingX, Real spacingY, Real tw, Real th);
45 void Enabled(bool value);
46 bool IsEnabled();
47 void Report(const std::string &message);
48 bool ReportError(const std::string &message);
49 int GetFloor();
50 ButtonPanel* GetPanel();
51 void RemovePanel();
52 bool SelectFloor(int floor);
53 void SetController(int number);
54 DispatchController* GetController();
55 void SetPosition(Vector3 &position);
56 bool ServicesElevator(int elevator);
57 int GetElevatorArrived(int starting_floor, int destination_floor);
58 bool FireService(int value);
59 Indicator* AddIndicator(const std::string &sound, const std::string &texture_prefix, const std::string &blank_texture, const std::string &direction, Real CenterX, Real CenterZ, Real width, Real height, Real voffset, Real timer_duration);
60 void UpdateIndicator(const std::string &text, bool play_sound = true);
61 bool Input(const std::string &text);
62 void ProcessCache();
63 void Error(bool type = 0);
64 int GetRecallFloor();
65 void ReportElevator(Elevator *elevator);
66 bool Call(bool direction);
67 bool GetFloorFromID(const std::string &floor, int &result);
68 void SetLightsGroup(int up, int down);
69 void UpLight(bool value);
70 void DownLight(bool value);
71 void SetLights(int up, int down);
72 bool GetUpStatus();
73 bool GetDownStatus();
74 Control* GetUpControl();
75 Control* GetDownControl();
76 bool Press(bool up);
77 bool CreateCallButtons(const std::string &sound_file_up, const std::string &sound_file_down, std::string BackTexture, const std::string &UpButtonTexture, const std::string &UpButtonTexture_Lit, const std::string &DownButtonTexture, const std::string &DownButtonTexture_Lit, const std::string &direction, Real BackWidth, Real BackHeight, bool ShowBack, Real tw, Real th);
78 int GetElevatorArrivedStandard(int floor, bool direction);
79
80private:
81 ButtonPanel* panel; //button panel object
82 int controller; //dispatch controller
83
85
86 Floor *floor; //floor this call button set is on
87
89
90 //for keypad
91 std::string InputCache;
92
93 bool Locked;
94 int KeyID;
95
96 class Timer; //internal timer class
97
98 //timer object
100};
101
102}
103
104#endif
std::string InputCache
Definition callstation.h:91
std::string Name
Definition callstation.h:35
std::vector< std::string > InvalidInput
Definition callstation.h:37
ButtonPanel * panel
Definition callstation.h:81
Indicator * indicator
Definition callstation.h:88
Ogre::Vector3 Vector3
Definition globals.h:58
Ogre::Real Real
Definition globals.h:57
#define SBSIMPEXP
Definition globals.h:53