/* orxonox - the future of 3D-vertical-scrollers Copyright (C) 2004 orx This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ### File Specific: main-programmer: Silvan Nellen co-programmer: Benjamin Knecht */ #include "player.h" #include "playable.h" #include "event_handler.h" using namespace std; /** * creates a new Player */ Player::Player() { this->init(); } /** * destructs the player, deletes alocated memory */ Player::~Player () { } /** * initializes a Player */ void Player::init() { // this->setRelDir(Quaternion(M_PI, Vector(1,0,0))); this->setClassID(CL_PLAYER, "Player"); PRINTF(4)("PLAYER INIT\n"); this->controllable = NULL; } void Player::process(const Event &event) { if (likely(this->controllable != NULL)) this->controllable->process(event); } bool Player::setControllable(Playable* controllable) { if(controllable != NULL && controllable->subscribePlayer(this)) { this->controllable = controllable; return true; } else return false; }