4 * Created on: Sep 19, 2012
10 #include "TypeDescription.h"
12 using battle::Monster;
13 using battle::PartyLayout;
23 Caster::Caster(Interpreter &intp)
25 , battleResourcesId(TypeDescription::GetTypeId("BattleResources"))
26 , heroId(TypeDescription::GetTypeId("Hero"))
27 , itemId(TypeDescription::GetTypeId("Item"))
28 , mapId(TypeDescription::GetTypeId("Map"))
29 , monsterId(TypeDescription::GetTypeId("Monster"))
30 , partyLayoutId(TypeDescription::GetTypeId("PartyLayout"))
31 , spellId(TypeDescription::GetTypeId("Spell")) {
36 battle::Resources *Caster::GetBattleResources(const string &ident) {
37 return reinterpret_cast<battle::Resources *>(intp.GetObject(battleResourcesId, ident));
40 Hero *Caster::GetHero(const string &ident) {
41 return reinterpret_cast<Hero *>(intp.GetObject(heroId, ident));
44 Item *Caster::GetItem(const string &ident) {
45 return reinterpret_cast<Item *>(intp.GetObject(itemId, ident));
48 Map *Caster::GetMap(const string &ident) {
49 return reinterpret_cast<Map *>(intp.GetObject(mapId, ident));
52 Monster *Caster::GetMonster(const string &ident) {
53 return reinterpret_cast<Monster *>(intp.GetObject(monsterId, ident));
56 PartyLayout *Caster::GetPartyLayout(const string &ident) {
57 return reinterpret_cast<PartyLayout *>(intp.GetObject(partyLayoutId, ident));
60 Spell *Caster::GetSpell(const string &ident) {
61 return reinterpret_cast<Spell *>(intp.GetObject(spellId, ident));