Rev | Line | |
---|
[5838] | 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: |
---|
[5841] | 12 | main-programmer: Silvan Nellen |
---|
| 13 | co-programmer: Benjamin Knecht |
---|
[5838] | 14 | */ |
---|
| 15 | |
---|
[5875] | 16 | #include "weapons/weapon_manager.h" |
---|
[5838] | 17 | #include "playable.h" |
---|
[5875] | 18 | #include "event_handler.h" |
---|
| 19 | #include "player.h" |
---|
[5838] | 20 | |
---|
[5872] | 21 | |
---|
[5838] | 22 | Playable::Playable() |
---|
| 23 | { |
---|
| 24 | this->init(); |
---|
| 25 | } |
---|
| 26 | |
---|
[5875] | 27 | Playable::~Playable() |
---|
[5838] | 28 | { |
---|
[5875] | 29 | |
---|
| 30 | } |
---|
| 31 | |
---|
| 32 | void Playable::init() |
---|
| 33 | { |
---|
[5838] | 34 | this->setClassID(CL_PLAYABLE, "Playable"); |
---|
| 35 | PRINTF(4)("PLAYABLE INIT\n"); |
---|
| 36 | this->weaponMan = new WeaponManager(this); |
---|
| 37 | } |
---|
| 38 | |
---|
[5872] | 39 | /** |
---|
| 40 | * subscribe to all events the controllable needs |
---|
| 41 | */ |
---|
| 42 | void Playable::subscribeEvents(Player* player) |
---|
| 43 | { |
---|
| 44 | /*EventHandler*/ |
---|
[5875] | 45 | EventHandler* evh = EventHandler::getInstance(); |
---|
[5876] | 46 | std::list<Event*>::iterator ev; |
---|
| 47 | for (ev = this->events.begin(); ev != events.end(); ev++) |
---|
[5872] | 48 | { |
---|
[5876] | 49 | if (!evh->isSubscribed(ES_GAME, (*ev)->type)) |
---|
| 50 | evh->subscribe(player, ES_GAME, (*ev)->type); |
---|
[5875] | 51 | } |
---|
[5872] | 52 | |
---|
| 53 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.