Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 28, 2008, 2:00:22 PM (16 years ago)
Author:
dsommer
Message:

private umgangen aber er liesst irgendwie die libs nicht :S

Location:
code/branches/pickups2/src/orxonox/objects/pickup
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • code/branches/pickups2/src/orxonox/objects/pickup/Item.cc

    r2289 r2293  
    11/* has to be added to player
    22   multimap<std::string, Item*> Equipment;*/
     3
    34
    45#include "Item.h"
     
    2728    }
    2829
    29 void Item::addTo (Pawn* player)
     30bool Item::addTo (Pawn* player)
    3031{
    31         if(checkSlot(player)==true)
     32        /*if(checkSlot(player)==true)
    3233        player->pickUp.Equipment.insert ( std::pair<std::string, Item*>(this->getName(),this) );
    3334        else
    34         COUT(3) << "swap?" << std::endl;
     35        COUT(3) << "swap?" << std::endl;*/
     36        return player->getPickUp().insert(this);
    3537}
    3638bool Item::remove(Pawn* player)
    3739{
    38         if(player->pickUp.Equipment.find(this->getName())!= player->pickUp.Equipment.end())
     40        /*if(player->pickUp.Equipment.find(this->getName())!= player->pickUp.Equipment.end())
    3941        {
    4042        std::multimap<std::string,Item*>::iterator it;
     
    4446        }
    4547        else
    46         return false;
     48        return false;*/
     49        return player->getPickUp().erase(this);
    4750}
    4851bool Item::checkSlot(Pawn* player)
    4952{
    50         std::multimap<std::string,Item*>::iterator it;
     53        /*std::multimap<std::string,Item*>::iterator it;
    5154        for ( it=player->pickUp.Equipment.begin() ; it != player->pickUp.Equipment.end(); it++ )
    5255        {
     
    5457        return false;
    5558        }
    56         return true;
     59        return true;*/
     60        return player->getPickUp().checkSlot(this);
    5761}
    5862void Item::setPlayerBaseClassName(const std::string& name)
  • code/branches/pickups2/src/orxonox/objects/pickup/Item.h

    r2289 r2293  
    44#include "core/BaseObject.h"
    55#include "OrxonoxPrereqs.h"
     6#include "ShipEquipment.h"
    67
    78namespace orxonox
     
    1819        virtual bool dropped(Pawn* player) { return true; } //erst bei festen Items
    1920        bool remove(Pawn* player);
    20         void addTo(Pawn* player);
     21        bool addTo(Pawn* player);
    2122
    2223        inline void setPlayerBaseClass(Identifier* identifier)
  • code/branches/pickups2/src/orxonox/objects/pickup/ShipEquipment.cc

    r2290 r2293  
     1#include "Item.h"
    12
    2 #include "ShipEquipment.h"
    33
    44namespace orxonox
    55{
    6         bool insert(Item* item)
     6        bool ShipEquipment::insert(Item* item)
    77        {
    88        if(checkSlot(player)==true)
     
    1111                COUT(3) << "swap?" << std::endl;
    1212       
    13 
    14 
    15 
    16 
    1713        };
    18         bool erase (Item* item)
     14        bool ShipEquipment::erase (Item* item)
    1915        {
    2016        if(Equipment.find(item->getName())!= Equipment.end())
     
    2824                return false;
    2925        };
    30         bool checkSlot(Item* item) const
     26        bool ShipEquipment::checkSlot(Item* item) const
    3127        {
    3228        std::multimap<std::string,Item*>::iterator it;
  • code/branches/pickups2/src/orxonox/objects/pickup/ShipEquipment.h

    r2290 r2293  
    2929        bool insert(Item* item);
    3030        bool erase (Item* item);
    31         bool checkSlot(Item* item) const;
     31        const bool checkSlot(Item* item) const;
    3232//      const std::multimap<std::string, Item*>& getEquipment() const { return this->Equipment; }
    3333
Note: See TracChangeset for help on using the changeset viewer.