Skyscraper 2.0
lock.h
Go to the documentation of this file.
1/*
2 Scalable Building Simulator - Lock and DoorLock Classes
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_LOCK_H
25#define _SBS_LOCK_H
26
27namespace SBS {
28
30{
31public:
32 Lock(Object *parent);
33 virtual ~Lock() {}
34 void SetLocked(bool value, int keyid);
35 bool IsLocked();
36 bool ToggleLock(bool force = false);
37 int GetKeyID();
38
39private:
40 bool Locked;
41 int KeyID;
42 Object *Parent; //parent object
43};
44
46{
47public:
48 DoorLock(Object *parent);
49 virtual ~DoorLock() {}
50 void SetDirection(bool direction);
51 void SetLocked(int side, int keyid);
52 bool GetSide(const Vector3 &position);
53 bool IsLocked(const Vector3 &position);
54 bool ToggleLock(const Vector3 &position, bool force = false);
55 int GetKeyID();
56
57private:
59 int Locked;
60 int KeyID;
61 Object *Parent; //parent object
62};
63
64}
65
66#endif
Object * Parent
Definition lock.h:61
int KeyID
Definition lock.h:60
int Locked
Definition lock.h:59
virtual ~DoorLock()
Definition lock.h:49
bool Direction
Definition lock.h:58
Object * Parent
Definition lock.h:42
int KeyID
Definition lock.h:41
bool Locked
Definition lock.h:40
virtual ~Lock()
Definition lock.h:33
Ogre::Vector3 Vector3
Definition globals.h:58
#define SBSIMPEXP
Definition globals.h:53