Public Member Functions | |
tSettingRotation (char const *name) | |
int | Size () const |
tString const & | Current () const |
void | Rotate () |
Private Member Functions | |
virtual void | ReadVal (std::istream &is) |
virtual void | WriteVal (std::ostream &s) |
virtual bool | Writable () |
virtual bool | Save () |
Private Attributes | |
tArray< tString > | items_ |
int | current_ |
Definition at line 167 of file gGame.cpp.
tSettingRotation::tSettingRotation | ( | char const * | name | ) | [inline] |
Definition at line 170 of file gGame.cpp.
00171 : tConfItemBase( name ), 00172 current_(0) 00173 { 00174 }
int tSettingRotation::Size | ( | void | ) | const [inline] |
tString const& tSettingRotation::Current | ( | void | ) | const [inline] |
void tSettingRotation::Rotate | ( | ) | [inline] |
virtual void tSettingRotation::ReadVal | ( | std::istream & | is | ) | [inline, private, virtual] |
Implements tConfItemBase.
Definition at line 199 of file gGame.cpp.
References current_, tArray< T, MALLOC >::Insert(), items_, GrowingArrayBase::Len(), tString::ReadLine(), tArray< T, MALLOC >::SetLen(), tString::StrPos(), and tString::SubStr().
00200 { 00201 tString mapsT; 00202 mapsT.ReadLine (is); 00203 items_.SetLen (0); 00204 00205 int strpos = 0; 00206 int nextsemicolon = mapsT.StrPos(";"); 00207 00208 if (nextsemicolon != -1) 00209 { 00210 do 00211 { 00212 tString const &map = mapsT.SubStr(strpos, nextsemicolon - strpos); 00213 00214 strpos = nextsemicolon + 1; 00215 nextsemicolon = mapsT.StrPos(strpos, ";"); 00216 00217 items_.Insert(map); 00218 } 00219 while ((nextsemicolon = mapsT.StrPos(strpos, ";")) != -1); 00220 } 00221 00222 // make sure the current value is correct 00223 if ( current_ >= items_.Len() ) 00224 { 00225 current_ = 0; 00226 } 00227 }
virtual void tSettingRotation::WriteVal | ( | std::ostream & | s | ) | [inline, private, virtual] |
virtual bool tSettingRotation::Writable | ( | void | ) | [inline, private, virtual] |
virtual bool tSettingRotation::Save | ( | ) | [inline, private, virtual] |
tArray<tString> tSettingRotation::items_ [private] |
int tSettingRotation::current_ [private] |