~ubuntu-branches/ubuntu/raring/enigma/raring

« back to all changes in this revision

Viewing changes to src/floors/SimpleFloors.hh

  • Committer: Bazaar Package Importer
  • Author(s): Erich Schubert
  • Date: 2010-05-26 02:27:26 UTC
  • mfrom: (5.1.3 sid)
  • Revision ID: james.westby@ubuntu.com-20100526022726-7tnbf65s6btbibu2
Tags: 1.10~~pre-alpha+r2100-1
* New SVN checkout, shortly after upstream "pre-alpha" release
* Target unstable, to get more testing for enigma
* Remove spelling patches included upstream

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright (C) 2002,2003,2004 Daniel Heck
 
3
 * Copyright (C) 2008 Ronald Lamprecht
 
4
 *
 
5
 * This program is free software; you can redistribute it and/or
 
6
 * modify it under the terms of the GNU General Public License
 
7
 * as published by the Free Software Foundation; either version 2
 
8
 * of the License, or (at your option) any later version.
 
9
 *
 
10
 * This program is distributed in the hope that it will be useful,
 
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
13
 * GNU General Public License for more details.
 
14
 *
 
15
 * You should have received a copy of the GNU General Public License along
 
16
 * with this program; if not, write to the Free Software Foundation, Inc.,
 
17
 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 
18
 *
 
19
 */
 
20
#ifndef SIMPLEFLOORS_HH
 
21
#define SIMPLEFLOORS_HH
 
22
 
 
23
#include "floors.hh"
 
24
 
 
25
namespace enigma {
 
26
 
 
27
    /** 
 
28
     * Abyss
 
29
     */
 
30
    class Abyss : public Floor {
 
31
        CLONEOBJ(Abyss);
 
32
        
 
33
    public:
 
34
        Abyss();
 
35
 
 
36
        // Object interface
 
37
        virtual std::string getClass() const;
 
38
 
 
39
        // Floor interface
 
40
        virtual bool is_destructible() const;
 
41
        virtual void actor_contact(Actor *);
 
42
    };
 
43
 
 
44
    /** 
 
45
     * DummyFloor
 
46
     */
 
47
    class DummyFloor : public Floor {
 
48
        CLONEOBJ(DummyFloor);
 
49
        
 
50
    public:
 
51
        DummyFloor();
 
52
 
 
53
        // Object interface
 
54
        virtual std::string getClass() const;
 
55
 
 
56
        // Floor interface
 
57
        virtual void actor_contact(Actor *);
 
58
    };
 
59
 
 
60
    /** 
 
61
     * Fake
 
62
     */
 
63
    class FakeFloor : public Floor {
 
64
        CLONEOBJ(FakeFloor);
 
65
        
 
66
    public:
 
67
        FakeFloor(std::string flavor ="abyss");
 
68
 
 
69
        // Object interface
 
70
        virtual std::string getClass() const;
 
71
        
 
72
        // GridObject interface
 
73
        virtual std::string getModelName() const;
 
74
    };
 
75
 
 
76
    /** 
 
77
     * IceFloor
 
78
     */
 
79
    class IceFloor : public Floor {
 
80
        CLONEOBJ(IceFloor);
 
81
        
 
82
    public:
 
83
        IceFloor();
 
84
 
 
85
        // Object interface
 
86
        virtual std::string getClass() const;
 
87
    };
 
88
 
 
89
    /** 
 
90
     * InverseFloor
 
91
     */
 
92
    class InverseFloor : public Floor {
 
93
        CLONEOBJ(InverseFloor);
 
94
        
 
95
    public:
 
96
        InverseFloor(std::string flavor ="white");
 
97
 
 
98
        // Object interface
 
99
        virtual std::string getClass() const;
 
100
        
 
101
        // GridObject interface
 
102
        virtual std::string getModelName() const;
 
103
    };
 
104
 
 
105
    /** 
 
106
     * Space
 
107
     */
 
108
    class Space : public Floor {
 
109
        CLONEOBJ(Space);
 
110
 
 
111
    private:
 
112
        enum ObjectPrivatFlagsBits {
 
113
            OBJBIT_FORCETYP  =   1<<24   ///< apply flat force on space
 
114
        };
 
115
        
 
116
    public:
 
117
        Space(bool withForce = false);
 
118
 
 
119
        // Object interface
 
120
        virtual std::string getClass() const;
 
121
 
 
122
        // Floor interface
 
123
        virtual void add_force(Actor *a, ecl::V2 &);  // Note: actor = 0 must be allowed!
 
124
    };
 
125
 
 
126
    /** 
 
127
     * Swamp
 
128
     */
 
129
    class Swamp : public Floor {
 
130
        CLONEOBJ(Swamp);
 
131
        
 
132
    public:
 
133
        Swamp();
 
134
 
 
135
        // Object interface
 
136
        virtual std::string getClass() const;
 
137
 
 
138
        // Floor interface
 
139
        virtual bool is_destructible() const;
 
140
        virtual void get_sink_speed (double &sinkspeed, double &raisespeed) const;        
 
141
    };
 
142
 
 
143
    /** 
 
144
     * Yinyang
 
145
     */
 
146
    class YinyangFloor : public Floor {
 
147
        CLONEOBJ(YinyangFloor);
 
148
        
 
149
    private:
 
150
        enum iState {
 
151
            YIN,       ///< player 0 - black image
 
152
            YANG       ///< player 1 - white image
 
153
        };
 
154
 
 
155
        enum ObjectPrivatFlagsBits {
 
156
            OBJBIT_INVISIBLE =   1<<24,   ///< yinyang symbol not visible
 
157
        };
 
158
 
 
159
    public:
 
160
        YinyangFloor(int initState, bool isInvisible =false);
 
161
 
 
162
        // Object interface
 
163
        virtual std::string getClass() const;
 
164
        virtual void setAttr(const std::string &key, const Value &val);
 
165
        virtual Value getAttr(const std::string &key) const;
 
166
        
 
167
        // GridObject interface
 
168
        virtual std::string getModelName() const;
 
169
                
 
170
        // Floor interface
 
171
        virtual ecl::V2 process_mouseforce (Actor *a, ecl::V2 force);
 
172
    };
 
173
} // namespace enigma
 
174
 
 
175
#endif