- if (dfn.TypeName() == "BattleResources") {
- battle::Resources *res(new battle::Resources);
- int index(battleResources.size());
- battleResources.push_back(res);
- ReadBattleResources(*res, *dfn.GetProperties());
- parsedDefinitions.insert(make_pair(dfn.Identifier(), ParsedDefinition(&dfn, BATTLE_RESOURCES, index)));
- } else if (dfn.TypeName() == "ComplexAnimation") {
- ComplexAnimation *animation(new ComplexAnimation);
- int index(complexAnimations.size());
- complexAnimations.push_back(animation);
- ReadComplexAnimation(*animation, *dfn.GetProperties());
- parsedDefinitions.insert(make_pair(dfn.Identifier(), ParsedDefinition(&dfn, COMPLEX_ANIMATION, index)));
- } else if (dfn.TypeName() == "Font") {
- Font *font(new Font);
- int index(fonts.size());
- fonts.push_back(font);
- ReadFont(*font, *dfn.GetProperties());
- parsedDefinitions.insert(make_pair(dfn.Identifier(), ParsedDefinition(&dfn, FONT, index)));
- } else if (dfn.TypeName() == "Frame") {
- Frame *frame(new Frame);
- int index(frames.size());
- frames.push_back(frame);
- ReadFrame(*frame, *dfn.GetProperties());
- parsedDefinitions.insert(make_pair(dfn.Identifier(), ParsedDefinition(&dfn, FRAME, index)));
- } else if (dfn.TypeName() == "Gauge") {
- Gauge *gauge(new Gauge);
- int index(gauges.size());
- gauges.push_back(gauge);
- ReadGauge(*gauge, *dfn.GetProperties());
- parsedDefinitions.insert(make_pair(dfn.Identifier(), ParsedDefinition(&dfn, GAUGE, index)));
- } else if (dfn.TypeName() == "Hero") {
- Hero *hero(new Hero);
- int index(heroes.size());
- heroes.push_back(hero);
- ReadHero(*hero, *dfn.GetProperties());
- parsedDefinitions.insert(make_pair(dfn.Identifier(), ParsedDefinition(&dfn, HERO, index)));
- } else if (dfn.TypeName() == "Ikari") {
- Ikari *ikari(new Ikari);
- int index(ikaris.size());
- ikaris.push_back(ikari);
- ReadIkari(*ikari, *dfn.GetProperties());
- parsedDefinitions.insert(make_pair(dfn.Identifier(), ParsedDefinition(&dfn, IKARI, index)));
- } else if (dfn.TypeName() == "Item") {
- Item *item(new Item);
- int index(items.size());
- items.push_back(item);
- ReadItem(*item, *dfn.GetProperties());
- parsedDefinitions.insert(make_pair(dfn.Identifier(), ParsedDefinition(&dfn, ITEM, index)));
- } else if (dfn.TypeName() == "MenuProperties") {
- graphics::MenuProperties *mprops(new graphics::MenuProperties);
- int index(menuProperties.size());
- menuProperties.push_back(mprops);
- ReadMenuProperties(*mprops, *dfn.GetProperties());
- parsedDefinitions.insert(make_pair(dfn.Identifier(), ParsedDefinition(&dfn, MENU_PROPERTIES, index)));
- } else if (dfn.TypeName() == "Monster") {
- Monster *monster(new Monster);
- int index(monsters.size());
- monsters.push_back(monster);
- ReadMonster(*monster, *dfn.GetProperties());
- parsedDefinitions.insert(make_pair(dfn.Identifier(), ParsedDefinition(&dfn, MONSTER, index)));
- } else if (dfn.TypeName() == "PartyLayout") {
- PartyLayout *layout(new PartyLayout);
- int index(partyLayouts.size());
- partyLayouts.push_back(layout);
- ReadPartyLayout(*layout, *dfn.GetProperties());
- parsedDefinitions.insert(make_pair(dfn.Identifier(), ParsedDefinition(&dfn, PARTY_LAYOUT, index)));
- } else if (dfn.TypeName() == "SimpleAnimation") {
- SimpleAnimation *animation(new SimpleAnimation);
- int index(simpleAnimations.size());
- simpleAnimations.push_back(animation);
- ReadSimpleAnimation(*animation, *dfn.GetProperties());
- parsedDefinitions.insert(make_pair(dfn.Identifier(), ParsedDefinition(&dfn, SIMPLE_ANIMATION, index)));
- } else if (dfn.TypeName() == "Spell") {
- Spell *spell(new Spell);
- int index(spells.size());
- spells.push_back(spell);
- ReadSpell(*spell, *dfn.GetProperties());
- parsedDefinitions.insert(make_pair(dfn.Identifier(), ParsedDefinition(&dfn, SPELL, index)));
- } else if (dfn.TypeName() == "Sprite") {
- Sprite *sprite(new Sprite);
- int index(sprites.size());
- sprites.push_back(sprite);
- ReadSprite(*sprite, *dfn.GetProperties());
- parsedDefinitions.insert(make_pair(dfn.Identifier(), ParsedDefinition(&dfn, SPRITE, index)));
- } else if (dfn.TypeName() == "TargetingMode") {
- TargetingMode *mode(new TargetingMode);
- int index(targetingModes.size());
- targetingModes.push_back(mode);
- ReadTargetingMode(*mode, *dfn.GetProperties());
- parsedDefinitions.insert(make_pair(dfn.Identifier(), ParsedDefinition(&dfn, TARGETING_MODE, index)));
- } else {
- throw Error("unhandled object type: " + dfn.TypeName());
- }