Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Apr 2, 2010, 5:35:14 PM (15 years ago)
Author:
dafrick
Message:

Lua bugs fixed.
Renamed name and description in PickupRepresentation to pickupName and pickupDescription to avoid problems.
More work on PickupInventory.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/pickup4/src/modules/pickup/PickupManager.cc

    r6669 r6675  
    127127    }
    128128   
    129     unsigned int PickupManager::getNumCarrierChildren(PickupCarrier* carrier)
     129    int PickupManager::getNumCarrierChildren(PickupCarrier* carrier)
    130130    {
    131131        if(carrier == NULL)
     
    134134    }
    135135           
    136     PickupCarrier* PickupManager::getCarrierChild(unsigned int index, PickupCarrier* carrier)
     136    PickupCarrier* PickupManager::getCarrierChild(int index, PickupCarrier* carrier)
    137137    {
     138        if(carrier == NULL)
     139            return NULL;
    138140        return carrier->getCarrierChild(index);
    139141    }
    140142   
    141     PickupRepresentation* PickupManager::getPickupRepresentation(unsigned int index, PickupCarrier* carrier)
     143    const std::string& PickupManager::getCarrierName(orxonox::PickupCarrier* carrier)
     144    {
     145        if(carrier == NULL)
     146            return BLANKSTRING;
     147        return carrier->getCarrierName();
     148    }
     149   
     150    PickupRepresentation* PickupManager::getPickupRepresentation(int index, PickupCarrier* carrier)
    142151    {
    143152        Pickupable* pickup = carrier->getPickup(index);
     
    149158   
    150159
    151     unsigned int PickupManager::getNumPickups(PickupCarrier* carrier)
     160    int PickupManager::getNumPickups(PickupCarrier* carrier)
    152161    {
     162        if(carrier == NULL)
     163            return 0;
    153164        return carrier->getNumPickups();
    154165    }
    155166   
    156     void PickupManager::dropPickup(unsigned int index, PickupCarrier* carrier)
     167    void PickupManager::dropPickup(int index, PickupCarrier* carrier)
    157168    {
    158169        Pickupable* pickup = carrier->getPickup(index);
     
    160171    }
    161172   
    162     void PickupManager::usePickup(unsigned int index, PickupCarrier* carrier, bool use)
     173    void PickupManager::usePickup(int index, PickupCarrier* carrier, bool use)
    163174    {
    164175        Pickupable* pickup = carrier->getPickup(index);
Note: See TracChangeset for help on using the changeset viewer.