OSDN Git Service

Version update
[skyscrapersim/skyscraper.git] / src / sbs / trigger.h
1 /* $Id$ */
2
3 /*
4         Scalable Building Simulator - Proximity Trigger Class
5         The Skyscraper Project - Version 1.10 Alpha
6         Copyright (C)2004-2015 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_TRIGGER_H
27 #define _SBS_TRIGGER_H
28
29 #include "globals.h"
30 #include "action.h"
31
32 class SBSIMPEXP Trigger
33 {
34 public:
35         Object *object; //SBS object
36         std::string Name;
37         bool IsEnabled;
38
39         //functions
40         Trigger(Object *parent, const char *name, const char *sound_file, Ogre::Vector3 &area_min, Ogre::Vector3 &area_max, const std::vector<std::string> &action_names);
41         ~Trigger();
42         void Enabled(bool value);
43         Ogre::Vector3 GetPosition();
44         void SetPosition(const Ogre::Vector3 &position);
45         void SetPositionY(float position);
46         void Move(const Ogre::Vector3 &position);
47         void Move(const Ogre::Vector3 position, bool relative_x, bool relative_y, bool relative_z);
48         bool SetSelectPosition(int position);
49         bool ChangeSelectPosition(int position);
50         bool NextSelectPosition(bool check_state = true);
51         bool PreviousSelectPosition(bool check_state = true);
52         int GetSelectPosition();
53         const char* GetPositionAction(int position);
54         const char* GetSelectPositionAction();
55         int GetNextSelectPosition();
56         int GetPreviousSelectPosition();
57         int GetPositions();
58         void PlaySound();
59         int FindActionPosition(const char *name);
60         bool DoAction();
61         bool Check();
62
63 private:
64         Ogre::Vector3 area_min;
65         Ogre::Vector3 area_max;
66         Ogre::Vector3 pos;
67         int current_position; //current trigger position
68         bool IsInside;
69         std::vector<std::string> Actions; //trigger actions
70
71         Sound *sound; //sound object
72
73 };
74
75 #endif