/[enigma]/enigma/src/stones_simple.cc
ViewVC logotype

Diff of /enigma/src/stones_simple.cc

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.40 by sfennig, Sun Jul 27 19:44:19 2003 UTC revision 1.41 by mhawlisch, Tue Aug 5 09:26:48 2003 UTC
# Line 91  namespace Line 91  namespace
91          SimpleStone(const string &knd, const string & snd, bool hollow, bool is_glass)          SimpleStone(const string &knd, const string & snd, bool hollow, bool is_glass)
92              : Stone(knd.c_str())              : Stone(knd.c_str())
93              , traits(SimpleStoneTraits::Register(snd, hollow, is_glass))              , traits(SimpleStoneTraits::Register(snd, hollow, is_glass))
94                , sunglas(false)
95          {}          {}
96      private:      private:
97            bool sunglas; // seen through glasses
98    
99          SimpleStone(const SimpleStone& other)          SimpleStone(const SimpleStone& other)
100              : Stone(other.get_kind())              : Stone(other.get_kind())
101              , traits(other.traits)              , traits(other.traits)
# Line 115  namespace Line 118  namespace
118              return traits->is_hollow() || traits->is_glass();              return traits->is_hollow() || traits->is_glass();
119          }          }
120    
121            void message(const string& msg, const Value &val) {
122                if (traits->is_hollow() && msg == "glasses") {
123                    if (to_int(val)) {
124                        if (!sunglas) {
125                            sunglas = true;
126                            set_model( "invisible");
127                        }
128                    }
129                    else {
130                        if (sunglas) {
131                            sunglas = false;
132                            set_model( this->get_kind());
133                        }
134                    }
135                }
136            }
137    
138          const SimpleStoneTraits *traits; // owned by simple_stone_traits          const SimpleStoneTraits *traits; // owned by simple_stone_traits
139      };      };
140  }  }

Legend:
Removed from v.1.40  
changed lines
  Added in v.1.41

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26