]> git.localhorst.tv Git - l2e.git/blob - src/loader/Caster.cpp
78a31b548db4737e0cd4cba08ee104fd73a9313f
[l2e.git] / src / loader / Caster.cpp
1 #include "Caster.h"
2
3 #include "TypeDescription.h"
4 #include "../battle/Resources.h"
5 #include "../battle/Monster.h"
6 #include "../battle/PartyLayout.h"
7 #include "../common/Hero.h"
8 #include "../common/Item.h"
9 #include "../common/Spell.h"
10 #include "../map/Map.h"
11 #include "../menu/Resources.h"
12
13 using battle::Monster;
14 using battle::PartyLayout;
15 using common::Hero;
16 using common::Item;
17 using common::Spell;
18 using map::Map;
19 using std::string;
20
21
22 namespace loader {
23
24 Caster::Caster(Interpreter &intp)
25 : intp(intp) {
26
27 }
28
29
30 battle::Resources *Caster::GetBattleResources(const string &ident) {
31         return reinterpret_cast<battle::Resources *>(
32                         intp.GetObject(battle::Resources::TYPE_ID, ident));
33 }
34
35 Hero *Caster::GetHero(const string &ident) {
36         return reinterpret_cast<Hero *>(intp.GetObject(Hero::TYPE_ID, ident));
37 }
38
39 Item *Caster::GetItem(const string &ident) {
40         return reinterpret_cast<Item *>(intp.GetObject(Item::TYPE_ID, ident));
41 }
42
43 Map *Caster::GetMap(const string &ident) {
44         return reinterpret_cast<Map *>(intp.GetObject(Map::TYPE_ID, ident));
45 }
46
47 menu::Resources *Caster::GetMenuResources(const string &ident) {
48         return reinterpret_cast<menu::Resources *>(
49                         intp.GetObject(menu::Resources::TYPE_ID, ident));
50 }
51
52 Monster *Caster::GetMonster(const string &ident) {
53         return reinterpret_cast<Monster *>(intp.GetObject(Monster::TYPE_ID, ident));
54 }
55
56 PartyLayout *Caster::GetPartyLayout(const string &ident) {
57         return reinterpret_cast<PartyLayout *>(
58                         intp.GetObject(PartyLayout::TYPE_ID, ident));
59 }
60
61 Spell *Caster::GetSpell(const string &ident) {
62         return reinterpret_cast<Spell *>(intp.GetObject(Spell::TYPE_ID, ident));
63 }
64
65 }