Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 5871 in orxonox.OLD for branches/powerups


Ignore:
Timestamp:
Dec 2, 2005, 3:00:24 PM (19 years ago)
Author:
manuel
Message:

declared extendable

Location:
branches/powerups/src
Files:
4 edited
2 copied

Legend:

Unmodified
Added
Removed
  • branches/powerups/src/defs/class_id.h

    r5822 r5871  
    7474
    7575
     76
    7677  // subsuper-classes
    7778  CL_MASK_SUBSUPER_CLASS        =    0x00fff000,
     
    8485  CL_PROJECTILE                 =    0x00110000,
    8586  CL_WEAPON                     =    0x00120000,
    86 
     87  CL_EXTENDABLE                 =    0x00140000,
    8788  // subsuper-classes derivations taken : 1, 5, a, b, c.     << THIS IS A LIST OF ALL THE DCL_MASK_SUBSUPERCLASS_ID's taken
    8889
  • branches/powerups/src/lib/sound/sound_engine.cc

    r5834 r5871  
    281281
    282282  // INITIALIZING THE DEVICE:
    283   ALchar deviceName[] =
     283  ALubyte deviceName[] =
    284284#ifdef __WIN32__
    285285      "native";
  • branches/powerups/src/world_entities/extendable.h

    r5849 r5871  
    44*/
    55
    6 #ifndef _PROTO_CLASS_H
    7 #define _PROTO_CLASS_H
    8 
    9 #include "base_object.h"
     6#ifndef _EXTENDABLE_H
     7#define _EXTENDABLE_H
    108
    119// FORWARD DECLARATION
     
    1412
    1513//! A class for ...
    16 class ProtoClass : public BaseObject {
     14class Extendable : public BaseObject {
    1715
    1816 public:
    19   ProtoClass();
    20   virtual ~ProtoClass();
    21 
     17//   Extendable();
     18//   virtual ~Extendable();
     19  virtual bool pickup(PowerUp* powerUp) { return false; }
    2220
    2321 private:
     
    2523};
    2624
    27 #endif /* _PROTO_CLASS_H */
     25#endif /* _EXTENDABLE_H */
  • branches/powerups/src/world_entities/power_ups/power_up.cc

    r5439 r5871  
    1818
    1919#include "power_up.h"
     20#include "extendable.h"
    2021
    2122
     
    2425
    2526
    26 PowerUp::PowerUp ()
     27PowerUp::PowerUp (PowerUpType type)
    2728{
    28   this->setClassID(CL_POWER_UP, "PowerUp");
    29 
     29  this->init();
    3030}
    3131
     32PowerUp::PowerUp(const TiXmlElement* root)
     33{
     34  this->init();
     35  this->loadParams(root);
     36}
    3237
     38void PowerUp::init() {
     39  this->setClassID(CL_POWER_UP, "PowerUp");
     40  this->type = type;
     41}
    3342
    3443PowerUp::~PowerUp () {}
    3544
    3645
    37 void PowerUp::loadParam(const TiXmlElement* root)
     46void PowerUp::loadParams(const TiXmlElement* root)
    3847{
    3948  static_cast<WorldEntity*>(this)->loadParams(root);
    40 
    4149}
    4250
     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}
  • branches/powerups/src/world_entities/power_ups/power_up.h

    r5434 r5871  
    99#include "world_entity.h"
    1010
     11typedef enum PowerUpType
     12{
     13  PWR_UP_NULL,
     14  PWR_UP_SHIELD,
     15  PWR_UP_WEAPON,
     16} PowerUpType;
     17
    1118class PowerUp : public WorldEntity {
    1219
    13  public:
    14   PowerUp ();
     20public:
     21  PowerUp(PowerUpType type = PWR_UP_NULL);
     22  PowerUp(const TiXmlElement* root);
    1523  virtual ~PowerUp ();
    16   void loadParam(const TiXmlElement* root);
     24  void loadParams(const TiXmlElement* root);
     25  void collidesWith (WorldEntity* entity, const Vector& location);
     26
     27private:
     28  PowerUpType type;
     29  void init();
    1730};
    1831
Note: See TracChangeset for help on using the changeset viewer.