Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Apr 2, 2014, 8:38:07 PM (11 years ago)
Author:
noep
Message:

Cleaned up the process passing the collisionshape which was hit to the Pawn. Started implementation of ModularSpaceShip and ShipPart.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/modularships/src/orxonox/ShipPart.h

    r10007 r10011  
    3131
    3232#include "OrxonoxPrereqs.h"
     33#include "items/Item.h"
    3334
    3435#include <string>
     
    3839{ // tolua_export
    3940    class _OrxonoxExport ShipPart // tolua_export
     41        : public Item
    4042    { // tolua_export
    4143
     
    4446            virtual ~ShipPart();
    4547
     48            //virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
     49
     50            virtual void handleHit(float damage, float healthdamage, float shielddamage, Pawn* originator);
     51
     52            //virtual void attachTo(Pawn* newParent);
     53            //virtual void detach();
     54
     55            void addEntity(StaticEntity* entity);
     56            StaticEntity* getEntity(unsigned int index);
     57
     58            virtual void setDamageAbsorption(float value);
     59            inline float getDamageAbsorption()
     60                { return this->damageAbsorption_; }
     61
     62            virtual void setHealth(float health);
     63            inline void addHealth(float health)
     64                { this->setHealth(this->health_ + health); }
     65            inline void removeHealth(float health)
     66                { this->setHealth(this->health_ - health); }
     67            inline float getHealth() const
     68                { return this->health_; }
     69
     70            // FIXME: (noep) Why doesn't this work? Works fine in Engine.h
     71            //void addToSpaceShip(ModularSpaceShip* ship);
     72
    4673        protected:
     74            Pawn* parent_;
     75            unsigned int parentID_; // Object ID of the SpaceShip the Part is mounted on.
    4776
     77            float damageAbsorption_;
     78            float health_;
    4879
    4980        private:
    50 
     81            std::vector<StaticEntity*> entityList_; // list of all entities which belong to this part
    5182
    5283    }; // tolua_export
Note: See TracChangeset for help on using the changeset viewer.