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 void Report(const std::string &message);
47 bool ReportError(const std::string &message);
48 int GetFloor();
49 ButtonPanel* GetPanel();
50 void RemovePanel();
51 bool SelectFloor(int floor);
52 void SetController(int number);
53 DispatchController* GetController();
54 void SetPosition(Vector3 &position);
55 bool ServicesElevator(int elevator);
56 int GetElevatorArrived(int starting_floor, int destination_floor);
57 bool FireService(int value);
58 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);
59 void UpdateIndicator(const std::string &text, bool play_sound = true);
60 bool Input(const std::string &text);
61 void ProcessCache();
62 void Error(bool type = 0);
63 int GetRecallFloor();
64 void ReportElevator(Elevator *elevator);
65 bool Call(bool direction);
66 bool GetFloorFromID(const std::string &floor, int &result);
67 void SetLightsGroup(int up, int down);
68 void UpLight(bool value);
69 void DownLight(bool value);
70 void SetLights(int up, int down);
71 bool GetUpStatus();
72 bool GetDownStatus();
73 Control* GetUpControl();
74 Control* GetDownControl();
75 bool Press(bool up);
76 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);
77 int GetElevatorArrivedStandard(int floor, bool direction);
78
79private:
80 ButtonPanel* panel; //button panel object
81 int controller; //dispatch controller
82
84
85 Floor *floor; //floor this call button set is on
86
88
89 //for keypad
90 std::string InputCache;
91
92 bool Locked;
93 int KeyID;
94
95 class Timer; //internal timer class
96
97 //timer object
99};
100
101}
102
103#endif
std::string InputCache
Definition callstation.h:90
std::string Name
Definition callstation.h:35
std::vector< std::string > InvalidInput
Definition callstation.h:37
ButtonPanel * panel
Definition callstation.h:80
Indicator * indicator
Definition callstation.h:87
Ogre::Vector3 Vector3
Definition globals.h:58
Ogre::Real Real
Definition globals.h:57
#define SBSIMPEXP
Definition globals.h:53