Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/branches/spaceshipcontrol/src/world_entities/player.cc @ 5847

Last change on this file since 5847 was 5847, checked in by snellen, 18 years ago

player.cc and player.h updated (both files in ../src/world_entities)

File size: 1.6 KB
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 "executor/executor.h"
17#include "player.h"
18
19#include "track_manager.h"
20#include "objModel.h"
21#include "resource_manager.h"
22#include "factory.h"
23
24#include "weapons/weapon_manager.h"
25#include "weapons/test_gun.h"
26#include "weapons/turret.h"
27#include "weapons/cannon.h"
28
29#include "list.h"
30
31#include "event_handler.h"
32
33#include "event.h"
34
35using namespace std;
36
37CREATE_FACTORY(Player, CL_PLAYER);
38
39/**
40 * creates a new Player
41 * @param isFree if the player is free
42*/
43Player::Player()
44{
45  this->init();
46}
47
48
49/**
50 *  destructs the player, deletes alocated memory
51 */
52Player::~Player ()
53{
54}
55
56//#include "glgui_pushbutton.h"
57
58/**
59 * initializes a Player
60 */
61void Player::init()
62{
63//  this->setRelDir(Quaternion(M_PI, Vector(1,0,0)));
64  this->setClassID(CL_PLAYER, "Player");
65
66  PRINTF(4)("PLAYER INIT\n");
67
68}
69
70/**
71 * subscribe to all events because the player dosen't know to witch keys the controllable can react
72 */
73void Player::subscribeEvents()
74{
75  //TODO: subscribe for all events!!
76}
77
78void Player::process(const Event &event)
79{
80  this->controllable->process(event);
81}
82
83
84void Player::setControllable(Playable controllalble)
85 {
86   this->controllable = controllable;
87 }
88
89
90
91Playable* Player::getControllable()
92{
93  return controllable;
94}
95
Note: See TracBrowser for help on using the repository browser.