[wpdev-commits] wolfpack items.cpp,1.426,1.427 items.h,1.206,1.207
Brought to you by:
rip,
thiagocorrea
From: Sebastian H. <dar...@us...> - 2004-07-24 19:00:06
|
Update of /cvsroot/wpdev/wolfpack In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8361 Modified Files: items.cpp items.h Log Message: More options for the beverage script Index: items.h =================================================================== RCS file: /cvsroot/wpdev/wolfpack/items.h,v retrieving revision 1.206 retrieving revision 1.207 diff -C2 -d -r1.206 -r1.207 *** items.h 20 Jul 2004 11:35:36 -0000 1.206 --- items.h 24 Jul 2004 18:59:56 -0000 1.207 *************** *** 61,69 **** unsigned char lightsource_; unsigned int decaydelay_; ! // Misc Properties bool loaded; void load(); void reset(); public: cItemBaseDef( const QCString& id ); --- 61,78 ---- unsigned char lightsource_; unsigned int decaydelay_; ! unsigned int flags_; ! // Misc Properties bool loaded; void load(); void reset(); + + inline void setWaterSource(bool data) { + if (data) { + flags_ |= 0x01; + } else { + flags_ &= ~ 0x01; + } + } public: cItemBaseDef( const QCString& id ); *************** *** 118,121 **** --- 127,135 ---- return lightsource_; } + + inline bool isWaterSource() { + load(); + return (flags_ & 0x01) != 0; + } }; *************** *** 285,288 **** --- 299,306 ---- // Basedef Properties + inline bool isWaterSource() { + return basedef_ ? basedef_->isWaterSource() : false; + } + inline float weight() { Index: items.cpp =================================================================== RCS file: /cvsroot/wpdev/wolfpack/items.cpp,v retrieving revision 1.426 retrieving revision 1.427 diff -C2 -d -r1.426 -r1.427 *** items.cpp 20 Jul 2004 11:35:36 -0000 1.426 --- items.cpp 24 Jul 2004 18:59:56 -0000 1.427 *************** *** 85,88 **** --- 85,89 ---- type_ = 0; lightsource_ = 0; + flags_ = 0; } *************** *** 117,120 **** --- 118,125 ---- decaydelay_ = node->value().toUInt(); } + else if ( node->name() == "watersource" ) + { + setWaterSource( node->value().toUInt() != 0 ); + } } *************** *** 2055,2058 **** --- 2060,2071 ---- PY_PROPERTY( "ownervisible", visible_ == 1 ? 1 : 0 ) PY_PROPERTY( "movable", magic_ ) + /* + \rproperty item.watersource This property indicates that this type of item is a source of + water. If there is a "quantity" tag for the item, it should be used, otherwise the source + is indepletable. + + This property is inherited from the base id of this item. + */ + PY_PROPERTY( "watersource", isWaterSource() ) return cUObject::getProperty( name ); |