Line | |
---|
1 | /* |
---|
2 | orxonox - the future of 3D-vertical-scrollers |
---|
3 | |
---|
4 | Copyright (C) 2004 orx |
---|
5 | |
---|
6 | This program is free software; you can redistribute it and/or modify |
---|
7 | it under the terms of the GNU General Public License as published by |
---|
8 | the Free Software Foundation; either version 2, or (at your option) |
---|
9 | any later version. |
---|
10 | |
---|
11 | ### File Specific: |
---|
12 | main-programmer: Silvan Nellen |
---|
13 | co-programmer: Benjamin Knecht |
---|
14 | */ |
---|
15 | |
---|
16 | #include "weapons/weapon_manager.h" |
---|
17 | #include "playable.h" |
---|
18 | #include "event_handler.h" |
---|
19 | #include "player.h" |
---|
20 | |
---|
21 | |
---|
22 | Playable::Playable() |
---|
23 | { |
---|
24 | this->init(); |
---|
25 | } |
---|
26 | |
---|
27 | Playable::~Playable() |
---|
28 | { |
---|
29 | |
---|
30 | } |
---|
31 | |
---|
32 | void Playable::init() |
---|
33 | { |
---|
34 | this->setClassID(CL_PLAYABLE, "Playable"); |
---|
35 | PRINTF(4)("PLAYABLE INIT\n"); |
---|
36 | this->weaponMan = new WeaponManager(this); |
---|
37 | } |
---|
38 | |
---|
39 | /** |
---|
40 | * subscribe to all events the controllable needs |
---|
41 | */ |
---|
42 | void Playable::subscribeEvents(Player* player) |
---|
43 | { |
---|
44 | /*EventHandler*/ |
---|
45 | EventHandler* evh = EventHandler::getInstance(); |
---|
46 | std::list<int>::iterator ev; |
---|
47 | for (ev = this->events.begin(); ev != events.end(); ev++) |
---|
48 | { |
---|
49 | evh->subscribe(player, ES_GAME, (*ev)); |
---|
50 | } |
---|
51 | |
---|
52 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.