Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

Last change on this file since 5883 was 5883, checked in by bensch, 18 years ago

orxonox/branches/spaceshipcontroll: completely working branche

File size: 1.2 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 "player.h"
17
18#include "event_handler.h"
19#include "event.h"
20
21using namespace std;
22
23
24/**
25 * creates a new Player
26*/
27Player::Player()
28{
29  this->init();
30}
31
32
33/**
34 *  destructs the player, deletes alocated memory
35 */
36Player::~Player ()
37{
38}
39
40
41/**
42 * initializes a Player
43 */
44void Player::init()
45{
46//  this->setRelDir(Quaternion(M_PI, Vector(1,0,0)));
47  this->setClassID(CL_PLAYER, "Player");
48
49  PRINTF(4)("PLAYER INIT\n");
50
51  this->controllable = NULL;
52}
53
54
55
56void Player::process(const Event &event)
57{
58  if (likely(this->controllable != NULL))
59    this->controllable->process(event);
60}
61
62
63void Player::setControllable(Playable* controllalble)
64{
65
66  this->controllable = controllalble;
67  this->controllable->subscribeEvents(this);
68
69}
70
71
72
73Playable* Player::getControllable()
74{
75  return controllable;
76}
77
Note: See TracBrowser for help on using the repository browser.