}
}
+void Capsule::SetClass(int index) {
+ curClass = index;
+ if (curClass < 0 ) {
+ curClass = 0;
+ }
+ if (curClass >= maxClass) {
+ curClass = maxClass - 1;
+ }
+}
+
Sprite *Capsule::BattleSprite() {
return GetClass().battleSprite;
}
void CapsuleChangeMenu::NextCapsule() {
+ int storedClass = parent->Game().state->GetCapsule().ClassIndex();
int &index = parent->Game().state->capsule;
++index;
index %= parent->Game().state->NumCapsules();
++index;
index %= parent->Game().state->NumCapsules();
}
+ parent->Game().state->GetCapsule().SetClass(storedClass);
}
void CapsuleChangeMenu::PreviousCapsule() {
+ int storedClass = parent->Game().state->GetCapsule().ClassIndex();
int &index = parent->Game().state->capsule;
--index;
if (index < 0) index += parent->Game().state->NumCapsules();
--index;
if (index < 0) index += parent->Game().state->NumCapsules();
}
+ parent->Game().state->GetCapsule().SetClass(storedClass);
}
void CapsuleChangeMenu::NextClass() {