]> git.localhorst.tv Git - l2e.git/blobdiff - src/loader/Caster.cpp
moved menu resources to data files
[l2e.git] / src / loader / Caster.cpp
index 876e1282ff9fb5a5e3ac92b9e59127fa4d0d1dff..78a31b548db4737e0cd4cba08ee104fd73a9313f 100644 (file)
@@ -1,6 +1,14 @@
 #include "Caster.h"
 
 #include "TypeDescription.h"
+#include "../battle/Resources.h"
+#include "../battle/Monster.h"
+#include "../battle/PartyLayout.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;
@@ -14,44 +22,44 @@ 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<battle::Resources *>(intp.GetObject(battleResourcesId, ident));
+       return reinterpret_cast<battle::Resources *>(
+                       intp.GetObject(battle::Resources::TYPE_ID, ident));
 }
 
 Hero *Caster::GetHero(const string &ident) {
-       return reinterpret_cast<Hero *>(intp.GetObject(heroId, ident));
+       return reinterpret_cast<Hero *>(intp.GetObject(Hero::TYPE_ID, ident));
 }
 
 Item *Caster::GetItem(const string &ident) {
-       return reinterpret_cast<Item *>(intp.GetObject(itemId, ident));
+       return reinterpret_cast<Item *>(intp.GetObject(Item::TYPE_ID, ident));
 }
 
 Map *Caster::GetMap(const string &ident) {
-       return reinterpret_cast<Map *>(intp.GetObject(mapId, ident));
+       return reinterpret_cast<Map *>(intp.GetObject(Map::TYPE_ID, ident));
+}
+
+menu::Resources *Caster::GetMenuResources(const string &ident) {
+       return reinterpret_cast<menu::Resources *>(
+                       intp.GetObject(menu::Resources::TYPE_ID, ident));
 }
 
 Monster *Caster::GetMonster(const string &ident) {
-       return reinterpret_cast<Monster *>(intp.GetObject(monsterId, ident));
+       return reinterpret_cast<Monster *>(intp.GetObject(Monster::TYPE_ID, ident));
 }
 
 PartyLayout *Caster::GetPartyLayout(const string &ident) {
-       return reinterpret_cast<PartyLayout *>(intp.GetObject(partyLayoutId, ident));
+       return reinterpret_cast<PartyLayout *>(
+                       intp.GetObject(PartyLayout::TYPE_ID, ident));
 }
 
 Spell *Caster::GetSpell(const string &ident) {
-       return reinterpret_cast<Spell *>(intp.GetObject(spellId, ident));
+       return reinterpret_cast<Spell *>(intp.GetObject(Spell::TYPE_ID, ident));
 }
 
 }