Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/orxonox/trunk/src/world_entities/weapons/weapon.cc @ 4837

Last change on this file since 4837 was 4836, checked in by bensch, 19 years ago

orxonox/trunk: renamed all the \param → @param and so on in Doxygen tags.
Thanks a lot to the kDevelop team. this took since the last commit :)

File size: 3.7 KB
Line 
1
2/*
3   orxonox - the future of 3D-vertical-scrollers
4
5   Copyright (C) 2004 orx
6
7   This program is free software; you can redistribute it and/or modify
8   it under the terms of the GNU General Public License as published by
9   the Free Software Foundation; either version 2, or (at your option)
10   any later version.
11
12### File Specific
13   main-programmer: Patrick Boenzli
14   co-programmer: Benjamin Grauer
15*/
16
17#include "weapon.h"
18
19#include "projectile.h"
20
21#include "load_param.h"
22#include "vector.h"
23#include "list.h"
24#include "state.h"
25
26/**
27 *  standard constructor
28
29   creates a new weapon
30*/
31Weapon::Weapon (PNode* parent, const Vector& coordinate, const Quaternion& direction)
32{
33  parent->addChild(this, PNODE_ALL);
34  this->setRelCoor(coordinate);
35  this->setRelDir(direction);
36}
37
38
39/**
40 *  standard deconstructor
41*/
42Weapon::~Weapon ()
43{
44  // model will be deleted from WorldEntity-destructor
45  //this->worldEntities = NULL;
46
47  /* dont delete objectComponentsX here, they will be killed when the pnodes are cleaned out */
48
49  /* all animations are deleted via the animation player*/
50}
51
52
53/**
54  *  enables the weapon
55
56    a weapon can be enabled/disabled because of various reasons. if a weapon is
57    been enabled, it can interact in a world. elswhere it wont react to any
58    action.
59*/
60void Weapon::enable()
61{
62  this->enabled = true;
63}
64
65
66/**
67  *  disables the weapon
68
69    a weapon can be enabled/disabled because of various reasons. if a weapon is
70    been enabled, it can interact in a world. elswhere it wont react to any
71    action.
72*/
73void Weapon::disable()
74{
75  this->enabled = false;
76}
77
78
79/**
80  *  checks if the weapon is enabled
81  * @returns true if enabled
82
83    a weapon can be ebabled/disabled because of various reasons. if a weapon is
84    been enabled, it can interact in a world. elswhere it wont react to any
85    action.
86*/
87bool Weapon::isEnabled()
88{
89  return this->enabled;
90}
91
92
93/**
94 *  sets a new projectile to the weapon
95 * @param new projectile for this weapon
96
97   weapon an projectile are independent, so you can combine them as you want
98*/
99void Weapon::setProjectile(Projectile* projectile)
100{
101  this->projectile = projectile;
102}
103
104
105/**
106 *  sets a new projectile to the weapon
107 * @returns the current projectile of this weapon
108
109   weapon an projectile are independent, so you can combine them as you want
110*/
111Projectile* Weapon::getProjectile()
112{
113  return this->projectile;
114}
115
116
117/**
118 *  this activates the weapon
119
120   This is needed, since there can be more than one weapon on a ship. the
121   activation can be connected with an animation. for example the weapon is
122   been armed out.
123*/
124void Weapon::activate()
125{}
126
127
128/**
129 *  this deactivates the weapon
130
131   This is needed, since there can be more than one weapon on a ship. the
132   activation can be connected with an animation. for example the weapon is
133   been armed out.
134*/
135void Weapon::deactivate()
136{}
137
138/**
139 *  asks if the current weapon is active
140 * @returns true if it the weapon is active
141*/
142bool Weapon::isActive()
143{}
144
145
146
147
148
149
150/**
151 *  is called, when the weapon gets hit (=collide with something)
152 * @param from which entity it is been hit
153 * @param where it is been hit
154
155   this may not be used, since it would make the game relay complicated when one
156   can destroy the weapons of enemies or vice versa.
157*/
158void Weapon::hit (WorldEntity* entity, const Vector& position)
159{}
160
161
162/**
163 *  is called, when the weapon is destroyed
164
165   this is in conjunction with the hit function, so when a weapon is able to get
166   hit, it can also be destoryed.
167*/
168void Weapon::destroy ()
169{}
170
171
172/**
173 *  tick signal for time dependent/driven stuff
174*/
175void Weapon::tick (float time)
176{}
177
178
179/**
180 *  is called, when there is no fire button pressed
181*/
182void Weapon::weaponIdle()
183{}
184
185
186/**
187 *  this will draw the weapon
188*/
189void Weapon::draw ()
190{}
191
Note: See TracBrowser for help on using the repository browser.