OSDN Git Service

Year update
[skyscrapersim/skyscraper.git] / src / sbs / callbutton.h
1 /* $Id$ */
2
3 /*
4         Scalable Building Simulator - Call Button Subsystem Class
5         The Skyscraper Project - Version 1.8 Alpha
6         Copyright (C)20042012 Ryan Thoryk
7         http://www.skyscrapersim.com
8         http://sourceforge.net/projects/skyscraper
9         Contact - ryan@tliquest.net
10
11         This program is free software; you can redistribute it and/or
12         modify it under the terms of the GNU General Public License
13         as published by the Free Software Foundation; either version 2
14         of the License, or (at your option) any later version.
15
16         This program is distributed in the hope that it will be useful,
17         but WITHOUT ANY WARRANTY; without even the implied warranty of
18         MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19         GNU General Public License for more details.
20
21         You should have received a copy of the GNU General Public License
22         along with this program; if not, write to the Free Software
23         Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
24 */
25
26 #ifndef _SBS_CALLBUTTON_H
27 #define _SBS_CALLBUTTON_H
28
29 class SBSIMPEXP CallButton
30 {
31 public:
32
33         Object *object; //SBS object
34         std::vector<int> Elevators; //elevators this call button set is assigned to
35         int floor; //floor this call button set is on
36         int Number; //call button index number (on the specified floor)
37         std::string Direction; //direction the buttons face; either 'front', 'back', 'left', or 'right'
38         bool IsEnabled;
39         bool UpStatus; //status of up light
40         bool DownStatus; //status of down light
41
42         //functions
43         CallButton(std::vector<int> &elevators, int floornum, int number, const char *BackTexture, const char *UpButtonTexture, const char *UpButtonTexture_Lit, const char *DownButtonTexture, const char *DownButtonTexture_Lit, float CenterX, float CenterZ, float voffset, const char *direction, float BackWidth, float BackHeight, bool ShowBack, float tw, float th);
44         ~CallButton();
45         void Enabled(bool value);
46         void Call(bool direction); //true is up, false is down
47         void UpLight(bool value);
48         void DownLight(bool value);
49         void SetLights(int up, int down);
50         bool ServicesElevator(int elevator);
51         void Loop(bool direction);
52         void Report(const char *message);
53         bool ReportError(const char *message);
54
55 private:
56         MeshObject* CallButtonBackMesh; //call button mesh object
57         MeshObject* CallButtonMeshUp; //call button mesh object
58         MeshObject* CallButtonMeshDown; //call button mesh object
59
60         std::string UpTexture, UpTextureLit;
61         std::string DownTexture, DownTextureLit;
62
63         bool ProcessedUp;
64         bool ProcessedDown;
65
66         char intbuffer[65];
67         char buffer[20];
68 };
69
70 #endif