Last change
on this file since 5849 was
5849,
checked in by snellen, 19 years ago
|
player.cc and player.h updated (both files in ../src/world_entities)
|
File size:
1.3 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 "factory.h" |
---|
19 | |
---|
20 | #include "list.h" |
---|
21 | |
---|
22 | #include "event_handler.h" |
---|
23 | |
---|
24 | #include "event.h" |
---|
25 | |
---|
26 | using namespace std; |
---|
27 | |
---|
28 | CREATE_FACTORY(Player, CL_PLAYER); |
---|
29 | |
---|
30 | /** |
---|
31 | * creates a new Player |
---|
32 | */ |
---|
33 | Player::Player() |
---|
34 | { |
---|
35 | this->init(); |
---|
36 | } |
---|
37 | |
---|
38 | |
---|
39 | /** |
---|
40 | * destructs the player, deletes alocated memory |
---|
41 | */ |
---|
42 | Player::~Player () |
---|
43 | { |
---|
44 | } |
---|
45 | |
---|
46 | |
---|
47 | /** |
---|
48 | * initializes a Player |
---|
49 | */ |
---|
50 | void Player::init() |
---|
51 | { |
---|
52 | // this->setRelDir(Quaternion(M_PI, Vector(1,0,0))); |
---|
53 | this->setClassID(CL_PLAYER, "Player"); |
---|
54 | |
---|
55 | PRINTF(4)("PLAYER INIT\n"); |
---|
56 | |
---|
57 | } |
---|
58 | |
---|
59 | /** |
---|
60 | * subscribe to all events because the player dosen't know to witch keys the controllable can react |
---|
61 | */ |
---|
62 | void Player::subscribeEvents() |
---|
63 | { |
---|
64 | //TODO: subscribe for all events!! |
---|
65 | } |
---|
66 | |
---|
67 | void Player::process(const Event &event) |
---|
68 | { |
---|
69 | this->controllable->process(event); |
---|
70 | } |
---|
71 | |
---|
72 | |
---|
73 | void Player::setControllable(Playable controllalble) |
---|
74 | { |
---|
75 | this->controllable = controllable; |
---|
76 | } |
---|
77 | |
---|
78 | |
---|
79 | |
---|
80 | Playable* Player::getControllable() |
---|
81 | { |
---|
82 | return controllable; |
---|
83 | } |
---|
84 | |
---|
Note: See
TracBrowser
for help on using the repository browser.