namespace battle {
class Hero;
class Monster;
+ class PartyLayout;
class Stats;
}
public:
graphics::Animation *GetAnimation(const std::string &name);
+ bool GetBoolean(const std::string &name) const;
battle::Hero *GetHero(const std::string &name);
battle::Monster *GetMonster(const std::string &name);
int GetNumber(const std::string &name) const;
+ battle::PartyLayout *GetPartyLayout(const std::string &name);
graphics::Sprite *GetSprite(const std::string &name);
+ const char *GetString(const std::string &name) const;
+ geometry::Vector<int> GetVector(const std::string &name) const;
+
+public:
+ const std::vector<bool> &Booleans() const { return booleans; }
+ const std::vector<graphics::ComplexAnimation *> &ComplexAnimations() const { return complexAnimations; }
+ const std::vector<battle::Hero *> &Heroes() const { return heroes; }
+ const std::vector<SDL_Surface *> &Images() const { return images; }
+ const std::vector<battle::Monster *> &Monsters() const { return monsters; }
+ const std::vector<int> &Numbers() const { return numbers; }
+ const std::vector<battle::PartyLayout *> &PartyLayouts() const { return partyLayouts; }
+ const std::vector<graphics::SimpleAnimation *> &SimpleAnimations() const { return simpleAnimations; }
+ const std::vector<graphics::Sprite *> &Sprites() const { return sprites; }
+ const std::vector<const char *> &Strings() const { return strings; }
+ const std::vector<geometry::Vector<int> > &Vectors() const { return vectors; }
private:
void ReadDefinition(const Definition &);
void ReadObject(const Definition &);
graphics::Animation *GetAnimation(const Value &);
- const std::vector<Value *> &GetValueArray(const Value &);
- const std::vector<PropertyList *> &GetPropertyListArray(const Value &);
bool GetBoolean(const Value &);
SDL_Surface *GetImage(const Value &);
int GetNumber(const Value &);
+ battle::PartyLayout *GetPartyLayout(const Value &);
const PropertyList *GetPropertyList(const Value &);
+ const std::vector<PropertyList *> &GetPropertyListArray(const Value &);
graphics::Sprite *GetSprite(const Value &);
const char *GetString(const Value &);
+ const std::vector<Value *> &GetValueArray(const Value &);
geometry::Vector<int> GetVector(const Value &);
void ReadComplexAnimation(graphics::ComplexAnimation &, const PropertyList &);
void ReadComplexAnimationFrame(graphics::ComplexAnimation::FrameProp &, const PropertyList &);
void ReadHero(battle::Hero &, const PropertyList &);
void ReadMonster(battle::Monster &, const PropertyList &);
+ void ReadPartyLayout(battle::PartyLayout &, const PropertyList &);
void ReadSimpleAnimation(graphics::SimpleAnimation &, const PropertyList &);
void ReadSprite(graphics::Sprite &, const PropertyList &);
void ReadStats(battle::Stats &, const PropertyList &);
private:
const ParsedSource &source;
- enum DynamicType {
- ANIMATION,
+ enum Type {
+ BOOLEAN,
COMPLEX_ANIMATION,
HERO,
+ IMAGE,
MONSTER,
NUMBER,
+ PARTY_LAYOUT,
+ PROPERTY_LIST_ARRAY,
SIMPLE_ANIMATION,
SPRITE,
+ STRING,
+ VECTOR,
+ VALUE_ARRAY,
};
struct ParsedDefinition {
- ParsedDefinition(const Definition *dfn, DynamicType type, int index)
+ ParsedDefinition(const Definition *dfn, Type type, int index)
: dfn(dfn), type(type), index(index) { }
- bool IsCompatible(DynamicType with) const;
const Definition *dfn;
- DynamicType type;
+ Type type;
int index;
};
std::map<std::string, ParsedDefinition> parsedDefinitions;
- std::vector<graphics::Animation *> animations;
+ std::vector<bool> booleans;
+ std::vector<graphics::ComplexAnimation *> complexAnimations;
std::vector<battle::Hero *> heroes;
std::vector<SDL_Surface *> images;
std::vector<battle::Monster *> monsters;
std::vector<int> numbers;
+ std::vector<battle::PartyLayout *> partyLayouts;
+ std::vector<PropertyList *> propertyLists;
+ std::vector<std::vector<PropertyList *> > propertyListArrays;
+ std::vector<graphics::SimpleAnimation *> simpleAnimations;
std::vector<graphics::Sprite *> sprites;
+ std::vector<const char *> strings;
+ std::vector<std::vector<Value *> > valueArrays;
+ std::vector<geometry::Vector<int> > vectors;
};