~ubuntu-branches/ubuntu/lucid/monopd/lucid

« back to all changes in this revision

Viewing changes to src/gameproperty.h

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Schepler
  • Date: 2004-02-13 18:05:30 UTC
  • Revision ID: james.westby@ubuntu.com-20040213180530-0etjgas7wosb2ben
Tags: upstream-0.9.0
ImportĀ upstreamĀ versionĀ 0.9.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// Copyright (c) 2003 Rob Kaper <cap@capsi.com>
 
2
//
 
3
// This program is free software; you can redistribute it and/or
 
4
// modify it under the terms of the GNU General Public License
 
5
// version 2 as published by the Free Software Foundation.
 
6
//
 
7
// This program is distributed in the hope that it will be useful,
 
8
// but WITHOUT ANY WARRANTY; without even the implied warranty of
 
9
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
10
// General Public License for more details.
 
11
//
 
12
// You should have received a copy of the GNU General Public License
 
13
// along with this program; see the file COPYING.  If not, write to
 
14
// the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 
15
// Boston, MA 02111-1307, USA.
 
16
 
 
17
#ifndef ATLANTIC_GAMEPROPERTY_H
 
18
#define ATLANTIC_GAMEPROPERTY_H
 
19
 
 
20
#include <string>
 
21
 
 
22
class GameObject;
 
23
 
 
24
class GameProperty
 
25
{
 
26
public:
 
27
        GameProperty(const std::string &key, GameObject *m_scope);
 
28
        std::string key() const;
 
29
        // void setScope(GameObject *scope);
 
30
        GameObject *scope();
 
31
        void setChanged(const bool &changed);
 
32
        bool changed() const;
 
33
 
 
34
protected:
 
35
        std::string m_key;
 
36
        GameObject *m_scope;
 
37
        bool m_changed;
 
38
};
 
39
 
 
40
class GameIntProperty : public GameProperty
 
41
{
 
42
public:
 
43
        GameIntProperty(const std::string &key, int value, GameObject *scope);
 
44
        bool setValue(int value);
 
45
        int value();
 
46
 
 
47
private:
 
48
        int m_value;
 
49
};
 
50
 
 
51
class GameStringProperty : public GameProperty
 
52
{
 
53
public:
 
54
        GameStringProperty(const std::string &key, const std::string &value, GameObject *scope);
 
55
        bool setValue(const std::string &value);
 
56
        std::string value() const;
 
57
 
 
58
private:
 
59
        std::string m_value;
 
60
};
 
61
 
 
62
class GameBoolProperty : public GameProperty
 
63
{
 
64
public:
 
65
        GameBoolProperty(const std::string &key, const bool &value, GameObject *scope);
 
66
        bool setValue(const bool &value);
 
67
        bool value() const;
 
68
 
 
69
private:
 
70
        bool m_value;
 
71
};
 
72
 
 
73
#endif