Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/pickups2/src/orxonox/objects/pickup/ShipEquipment.cc @ 2290

Last change on this file since 2290 was 2290, checked in by dsommer, 15 years ago

shipeq private matter…

File size: 735 bytes
Line 
1
2#include "ShipEquipment.h"
3
4namespace orxonox
5{
6        bool insert(Item* item)
7        {
8        if(checkSlot(player)==true)
9                Equipment.insert ( std::pair<std::string, Item*>(item->getName(),item) );
10        else
11                COUT(3) << "swap?" << std::endl;
12       
13
14
15
16
17        };
18        bool erase (Item* item)
19        {
20        if(Equipment.find(item->getName())!= Equipment.end())
21        {
22                std::multimap<std::string,Item*>::iterator it;
23                it=Equipment.find(item->getName());
24                Equipment.erase (it);
25                return true;
26        }
27        else
28                return false;
29        };
30        bool checkSlot(Item* item) const
31        {
32        std::multimap<std::string,Item*>::iterator it;
33        for ( it=Equipment.begin() ; it != Equipment.end(); it++ )
34        {
35                if((*it).second->playerBaseClass_==item->playerBaseClass_)
36                return false;
37        }
38        return true;
39        };
40}
Note: See TracBrowser for help on using the repository browser.