Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

private umgangen aber er liesst irgendwie die libs nicht :S

File:
1 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)
Note: See TracChangeset for help on using the changeset viewer.