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