Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 26, 2008, 7:42:29 PM (16 years ago)
Author:
polakma
Message:

added WeaponPack

Location:
code/branches/weapon2/src/orxonox/objects/worldentities/pawns
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • code/branches/weapon2/src/orxonox/objects/worldentities/pawns/Pawn.cc

    r2273 r2288  
    5252
    5353        this->lastHitOriginator_ = 0;
    54         this->weaponSystem_ = 0;
    5554
    5655        //WeaponSystem
     
    5857        WeaponSet * weaponSet1 = new WeaponSet(this,1);
    5958        this->weaponSystem_->attachWeaponSet(weaponSet1);
     59        //totally bad solution...
     60        weaponSet1->setParentWeaponSystem(weaponSystem_);
    6061
    6162
     
    7475        XMLPortParam(Pawn, "maxhealth", setMaxHealth, getMaxHealth, xmlelement, mode).defaultValues(200);
    7576        XMLPortParam(Pawn, "initialhealth", setInitialHealth, getInitialHealth, xmlelement, mode).defaultValues(100);
    76     }
     77
     78        XMLPortObject(Pawn, WeaponSlot, "weaponslots", setWeaponSlot, getWeaponSlot, xmlelement, mode);
     79        //XMLPortObject(Pawn, WeaponPack, "weapons", setWeaponPack, getWeaponPack, xmlelement, mode);
     80
     81        }
    7782
    7883    void Pawn::registerVariables()
     
    137142    void Pawn::fire(WeaponMode::Enum fireMode)
    138143    {
     144COUT(0) << "Pawn::fire" << std::endl;
    139145        if (this->weaponSystem_)
    140146            this->weaponSystem_->fire(fireMode);
     
    146152        this->spawn();
    147153    }
     154
     155    void Pawn::setWeaponSlot(WeaponSlot * wSlot)
     156    {
     157        this->weaponSystem_->attachWeaponSlot(wSlot);
     158    }
     159
     160    WeaponSlot * Pawn::getWeaponSlot(unsigned int index) const
     161    {
     162        return this->weaponSystem_->getWeaponSlotPointer(index);
     163    }
     164
    148165}
  • code/branches/weapon2/src/orxonox/objects/worldentities/pawns/Pawn.h

    r2145 r2288  
    7979            virtual void postSpawn();
    8080
     81            void setWeaponSlot(WeaponSlot * wSlot);
     82            WeaponSlot * getWeaponSlot(unsigned int index) const;
     83
    8184        protected:
    8285            virtual void spawn();
  • code/branches/weapon2/src/orxonox/objects/worldentities/pawns/Spectator.cc

    r2087 r2288  
    169169    }
    170170
    171     void Spectator::fire()
     171    void Spectator::fire(WeaponMode::Enum fireMode)
    172172    {
    173173        if (this->getPlayer())
  • code/branches/weapon2/src/orxonox/objects/worldentities/pawns/Spectator.h

    r2087 r2288  
    5656            virtual void rotateRoll(const Vector2& value);
    5757
    58             virtual void fire();
     58            virtual void fire(WeaponMode::Enum fireMode);
    5959            virtual void greet();
    6060
Note: See TracChangeset for help on using the changeset viewer.