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

« back to all changes in this revision

Viewing changes to src/items/ShogunDot.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) 2008 Ronald Lamprecht
 
3
 *
 
4
 * This program is free software; you can redistribute it and/or
 
5
 * modify it under the terms of the GNU General Public License
 
6
 * as published by the Free Software Foundation; either version 2
 
7
 * of the License, or (at your option) any later version.
 
8
 *
 
9
 * This program is distributed in the hope that it will be useful,
 
10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
12
 * GNU General Public License for more details.
 
13
 *
 
14
 * You should have received a copy of the GNU General Public License along
 
15
 * with this program; if not, write to the Free Software Foundation, Inc.,
 
16
 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 
17
 *
 
18
 */
 
19
#ifndef SHOGUNDOTITEM_HH
 
20
#define SHOGUNDOTITEM_HH
 
21
 
 
22
#include "items.hh"
 
23
 
 
24
#include "enigma.hh"
 
25
 
 
26
namespace enigma {
 
27
    /**
 
28
     */
 
29
    class ShogunDot : public Item {
 
30
        CLONEOBJ(ShogunDot);
 
31
        DECL_ITEMTRAITS_ARRAY(3, traitsIdx());
 
32
 
 
33
    private:
 
34
        enum iState {
 
35
            OFF,     ///< inactive, no matching shogun stack on top
 
36
            ON       ///< active, matching shogun stack on top
 
37
        };
 
38
        
 
39
        enum ObjectPrivatFlagsBits {
 
40
            OBJBIT_HOLES =   127<<24,   ///< holes as defined in stones/ShogunStone.hh
 
41
        };
 
42
    public:
 
43
        ShogunDot(int holes);
 
44
 
 
45
        // Object interface
 
46
        virtual std::string getClass() const;
 
47
        virtual void setAttr(const string& key, const Value &val);
 
48
        virtual Value getAttr(const std::string &key) const;
 
49
        virtual Value message(const Message &m);
 
50
 
 
51
        // StateObject interface
 
52
        virtual void setState(int extState);
 
53
 
 
54
        // GridObject interface
 
55
        virtual void on_creation(GridPos p);
 
56
 
 
57
        // Item interface
 
58
        virtual void stone_change(Stone *st);
 
59
        
 
60
    private:
 
61
        int getHoles() const;
 
62
        int requiredShogunHoles() const;
 
63
        int traitsIdx() const;
 
64
    };
 
65
    
 
66
} // namespace enigma
 
67
 
 
68
#endif