X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Floader%2FCaster.cpp;h=050ac930e9ef956d90bb16763fd94a47e02697b5;hb=242bdb40a032306ad2bf57487e7f23a0c308fe44;hp=152c8b298dfa1958a793800c35f7cd8d0a760f20;hpb=7c43158af1abf38fa896a442cb3c6d8a5bc630e7;p=l2e.git diff --git a/src/loader/Caster.cpp b/src/loader/Caster.cpp index 152c8b2..050ac93 100644 --- a/src/loader/Caster.cpp +++ b/src/loader/Caster.cpp @@ -1,16 +1,19 @@ -/* - * Caster.cpp - * - * Created on: Sep 19, 2012 - * Author: holy - */ - #include "Caster.h" #include "TypeDescription.h" +#include "../battle/Resources.h" +#include "../battle/Monster.h" +#include "../battle/PartyLayout.h" +#include "../common/Capsule.h" +#include "../common/Hero.h" +#include "../common/Item.h" +#include "../common/Spell.h" +#include "../map/Map.h" +#include "../menu/Resources.h" using battle::Monster; using battle::PartyLayout; +using common::Capsule; using common::Hero; using common::Item; using common::Spell; @@ -21,44 +24,48 @@ using std::string; namespace loader { Caster::Caster(Interpreter &intp) -: intp(intp) -, battleResourcesId(TypeDescription::GetTypeId("BattleResources")) -, heroId(TypeDescription::GetTypeId("Hero")) -, itemId(TypeDescription::GetTypeId("Item")) -, mapId(TypeDescription::GetTypeId("Map")) -, monsterId(TypeDescription::GetTypeId("Monster")) -, partyLayoutId(TypeDescription::GetTypeId("PartyLayout")) -, spellId(TypeDescription::GetTypeId("Spell")) { +: intp(intp) { } battle::Resources *Caster::GetBattleResources(const string &ident) { - return reinterpret_cast(intp.GetObject(battleResourcesId, ident)); + return reinterpret_cast( + intp.GetObject(battle::Resources::TYPE_ID, ident)); +} + +Capsule *Caster::GetCapsule(const string &ident) { + return reinterpret_cast(intp.GetObject(Capsule::TYPE_ID, ident)); } Hero *Caster::GetHero(const string &ident) { - return reinterpret_cast(intp.GetObject(heroId, ident)); + return reinterpret_cast(intp.GetObject(Hero::TYPE_ID, ident)); } Item *Caster::GetItem(const string &ident) { - return reinterpret_cast(intp.GetObject(itemId, ident)); + return reinterpret_cast(intp.GetObject(Item::TYPE_ID, ident)); } Map *Caster::GetMap(const string &ident) { - return reinterpret_cast(intp.GetObject(mapId, ident)); + return reinterpret_cast(intp.GetObject(Map::TYPE_ID, ident)); +} + +menu::Resources *Caster::GetMenuResources(const string &ident) { + return reinterpret_cast( + intp.GetObject(menu::Resources::TYPE_ID, ident)); } Monster *Caster::GetMonster(const string &ident) { - return reinterpret_cast(intp.GetObject(monsterId, ident)); + return reinterpret_cast(intp.GetObject(Monster::TYPE_ID, ident)); } PartyLayout *Caster::GetPartyLayout(const string &ident) { - return reinterpret_cast(intp.GetObject(partyLayoutId, ident)); + return reinterpret_cast( + intp.GetObject(PartyLayout::TYPE_ID, ident)); } Spell *Caster::GetSpell(const string &ident) { - return reinterpret_cast(intp.GetObject(spellId, ident)); + return reinterpret_cast(intp.GetObject(Spell::TYPE_ID, ident)); } }