Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 17, 2008, 8:00:43 AM (15 years ago)
Author:
landauf
Message:

merged pickups2 to presentation

Location:
code/branches/presentation
Files:
1 edited
1 copied

Legend:

Unmodified
Added
Removed
  • code/branches/presentation

  • code/branches/presentation/src/orxonox/objects/pickup/ShipEquipment.cc

    • Property svn:eol-style set to native
    r2498 r2500  
    1 #include "Item.h"
     1#include "BaseItem.h"
    22#include "ShipEquipment.h"
    33#include "objects/worldentities/pawns/Pawn.h"
     
    99@brief
    1010    Insert a permanent Item to the Equipment. Is usually called by the addTo function in Items.
    11    
     11
    1212@param item
    1313    pointer to the item which is to be inserted.
     
    1616    if new item has sucessfully been added it will return true, in any other case the return value is false.
    1717*/
    18         bool ShipEquipment::insert(Item* item)
     18        bool ShipEquipment::insert(BaseItem* item)
    1919        {
    2020        if(checkSlot(item)==NULL)
    2121        {
    22                 Equipment.insert ( std::pair<std::string, Item*>(item->getName(),item) );
     22                Equipment.insert ( std::pair<std::string, BaseItem*>(item->getName(),item) );
    2323                return true;
    2424        }
     
    2626        {
    2727                COUT(3) << "SWAP?" <<  endl;
    28                 //Abfrage- irgendne ifschleife... 
     28                //Abfrage- irgendne ifschleife...
    2929                if((checkSlot(item)->dropped(player))==true);
    3030                {
    31                         Equipment.insert ( std::pair<std::string, Item*>(item->getName(),item) );
     31                        Equipment.insert ( std::pair<std::string, BaseItem*>(item->getName(),item) );
    3232                        COUT(3) << "SWAPPED!" <<  endl;
    3333                        return true;
     
    4242@brief
    4343    Erases a permanent Item in the Equipment. Is usually called by the remove/dropped function in Items.
    44    
     44
    4545@param item
    4646    pointer to the item which is to be erased.
     
    4949    if new item has sucessfully been erased it will return true, in any other case the return value is false.
    5050*/
    51         bool ShipEquipment::erase (Item* item)
     51        bool ShipEquipment::erase (BaseItem* item)
    5252        {
    53         std::multimap<std::string,Item*>::iterator it = Equipment.find(item->getName());
     53        std::multimap<std::string,BaseItem*>::iterator it = Equipment.find(item->getName());
    5454        if(it != Equipment.end())
    5555        {
     
    5959        return false;
    6060        };
    61         /*void print(std::multimap<std::string, Item*> eut)
     61        /*void print(std::multimap<std::string, BaseItem*> eut)
    6262        {
    63                 std::multimap<std::string,Item*>::iterator it;
     63                std::multimap<std::string,BaseItem*>::iterator it;
    6464                COUT(3) << "Liste:" <<  endl;
    6565                for ( it=eut.begin() ; it != eut.end(); ++it )
     
    7575        {
    7676                //print(Equipment);
    77                 for (std::multimap<std::string,Item*>::iterator it = Equipment.begin(); it != Equipment.end(); )
     77                for (std::multimap<std::string,BaseItem*>::iterator it = Equipment.begin(); it != Equipment.end(); )
    7878                {
    7979
     
    8383        }
    8484
    85         Item* ShipEquipment::checkSlot(Item* item)
     85        BaseItem* ShipEquipment::checkSlot(BaseItem* item)
    8686        {
    87         std::multimap<std::string,Item*>::iterator it;
     87        std::multimap<std::string,BaseItem*>::iterator it;
    8888        for ( it= getPlayer()->getPickUp().getEquipment().begin() ; it != getPlayer()->getPickUp().getEquipment().end(); it++ )
    8989        {
     
    9494        return NULL;
    9595        };
    96        
     96
    9797}
Note: See TracChangeset for help on using the changeset viewer.