Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jun 3, 2007, 10:17:15 PM (18 years ago)
Author:
nicolasc
Message:

some modularisaztion hacking
hardlinked armor to WE Health

Location:
branches/vs-enhencements/src/world_entities/weapons
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/vs-enhencements/src/world_entities/weapons/weapon_manager.cc

    r10544 r10669  
    1 
    21/*
    32   orxonox - the future of 3D-vertical-scrollers
     
    146145  BaseObject::loadParams(root);
    147146
    148   LoadParam(root, "slot-count", this, WeaponManager, setSlotCount)
     147  LoadParam(root, "slotCount", this, WeaponManager, setSlotCount)
    149148  .describe("how many slots(cannons) the WeaponManager can handle");
     149
    150150
    151151  LOAD_PARAM_START_CYCLE(root, element);
     
    156156  }
    157157  LOAD_PARAM_END_CYCLE(element);
     158
     159
    158160}
    159161
     
    357359 * @param slotCapability the capability @see WeaponSlotCapability
    358360 */
    359 void WeaponManager::setSlotCapability(int slot, long slotCapability)
     361void WeaponManager::setSlotCapability(int slot, unsigned long slotCapability)
    360362{
    361363  if (slot > slotCount)
  • branches/vs-enhencements/src/world_entities/weapons/weapon_manager.h

    r10437 r10669  
    6060    // setting up the WeaponManager with the following functions
    6161    void setSlotPosition(int slot, const Vector& position, PNode* parent = NULL);
     62//     inline void setSlotPosition(float slot, float x, float y,float z) {setSlotPosition((int)slot, Vector(x,y,z));};
    6263    void setSlotDirection(int slot, const Quaternion& rotation);
    6364    /** @param slot the slot to get the relative position from @returns the relative position of the Carrier to the Slot */
    6465    const Vector& getSlotPosition(int slot) const;
    65     void setSlotCapability(int slot, long slotCapability);
     66    void setSlotCapability(int slot, unsigned long slotCapability);
    6667    /** @param slot the slot to get the capabilities from @returns the capabilies */
    6768    long getSlotCapability(int slot) const;
     
    7677    bool addWeapon(Weapon* weapon, int configID = -1, int slotID = -1);
    7778    void removeWeapon(Weapon* weapon, int configID = -1);
     79
     80    inline void createWeaponSlot(int slot, float x, float y, float z, long capability) {
     81        this->setSlotPosition(slot, Vector( x, y, z));
     82        this->setSlotCapability(slot, capability); };
     83
     84    inline void addWeaponToSlot(int config, int slot, const std::string& weaponName){
     85      this->addWeapon( Weapon::createWeapon( weaponName ), config, slot); };
     86
    7887
    7988    Weapon* getWeapon(int slotID) const;
  • branches/vs-enhencements/src/world_entities/weapons/weapon_slot.cc

    r10534 r10669  
    4242
    4343WeaponSlot::~WeaponSlot()
    44 {}
     44{
     45}
    4546
    4647
     
    5556
    5657  LoadParam(root, "slot", this, WeaponSlot, setWeaponConfig)
    57       .describe("sets the weapon slot");
     58  .describe("sets the weapon slot");
    5859}
    5960
     
    6364void WeaponSlot::setWeaponClass()
    6465{
    65 
    6666}
    6767
Note: See TracChangeset for help on using the changeset viewer.