Skyscraper 2.0
directional.h
Go to the documentation of this file.
1/*
2 Scalable Building Simulator - Directional Indicator 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_DIRECTIONAL_H
25#define _SBS_DIRECTIONAL_H
26
27namespace SBS {
28
30{
31public:
32
33 int elevator; //elevator this indicator is assigned to
34 int car; //elevator car this indicator is assigned to
35 int floor; //floor the indicator is on
36 int blink; //number of times to turn on/off indicator
37 std::string Direction; //direction the indicator faces; either 'front', 'back', 'left', or 'right'
38 std::string UpTextureUnlit; //unlit up texture
39 std::string UpTextureLit; //lit up texture
40 std::string DownTextureUnlit; //unlit down texture
41 std::string DownTextureLit; //lit down texture
42 bool UpStatus; //status of up light
43 bool DownStatus; //status of down light
44 bool Single; //is this a single-light indicator?
45 bool Vertical; //true if the lights are vertically separated or false if horizontally separated
46 bool ActiveDirection; //true if this indicator displays the active elevator direction, instead of only for an available call
47
48 //functions
49 DirectionalIndicator(Object *parent, int elevator, int car, int floor, bool active_direction, bool single, bool vertical, const std::string &BackTexture, const std::string &uptexture, const std::string &uptexture_lit, const std::string &downtexture, const std::string &downtexture_lit, Real CenterX, Real CenterZ, Real voffset, const std::string &direction, Real BackWidth, Real BackHeight, bool ShowBack, Real tw, Real th);
51 void Enabled(bool value);
52 void UpLight(bool value);
53 void DownLight(bool value);
54 void SetLights(int up, int down);
55 bool IsEnabled() { return is_enabled; }
56 void Off();
57 void Loop();
58
59private:
60 MeshObject* DirectionalMeshBack; //indicator mesh back object
61 MeshObject* DirectionalMeshUp; //indicator mesh up object
62 MeshObject* DirectionalMeshDown; //indicator mesh down object
63 MeshObject* DirectionalMesh; //indicator mesh single object
64
65 bool is_enabled; //true if indicator is currently enabled
66
67 //timer object
68 class Timer; //internal timer class
69 Timer* timer; //shut-off timer
70 Timer* blink_timer; //blink timer
74};
75
76}
77
78#endif
MeshObject * DirectionalMeshUp
Definition directional.h:61
MeshObject * DirectionalMeshDown
Definition directional.h:62
MeshObject * DirectionalMeshBack
Definition directional.h:60
MeshObject * DirectionalMesh
Definition directional.h:63
Ogre::Real Real
Definition globals.h:57
#define SBSIMPEXP
Definition globals.h:53