Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/branches/powerups/src/world_entities/power_ups/power_up.cc @ 5871

Last change on this file since 5871 was 5871, checked in by manuel, 18 years ago

declared extendable

File size: 1.1 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: Benjamin Grauer
13   co-programmer: ...
14*/
15
16#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_WORLD_ENTITY
17
18
19#include "power_up.h"
20#include "extendable.h"
21
22
23using namespace std;
24
25
26
27PowerUp::PowerUp (PowerUpType type)
28{
29  this->init();
30}
31
32PowerUp::PowerUp(const TiXmlElement* root)
33{
34  this->init();
35  this->loadParams(root);
36}
37
38void PowerUp::init() {
39  this->setClassID(CL_POWER_UP, "PowerUp");
40  this->type = type;
41}
42
43PowerUp::~PowerUp () {}
44
45
46void PowerUp::loadParams(const TiXmlElement* root)
47{
48  static_cast<WorldEntity*>(this)->loadParams(root);
49}
50
51
52void PowerUp::collidesWith (WorldEntity* entity, const Vector& location)
53{
54 if(entity->isA(CL_EXTENDABLE))
55  {
56    if(dynamic_cast<Extendable*>(entity)->pickup(this))
57    {
58      this->setVisibiliy(false);
59    }
60  }
61}
Note: See TracBrowser for help on using the repository browser.