- Timestamp:
- Dec 17, 2008, 8:00:43 AM (15 years ago)
- Location:
- code/branches/presentation
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/presentation
- Property svn:mergeinfo changed
/code/branches/pickups2 (added) merged: 2110,2136,2202,2227,2289-2290,2293-2294,2324,2342,2389,2397
- Property svn:mergeinfo changed
-
code/branches/presentation/src/orxonox/objects/pickup/ShipEquipment.h
r2094 r2500 1 2 1 #ifndef _ShipEquipment_H__ 3 2 #define _ShipEquipment_H__ 4 3 #include <string> 5 #include <multimap> 4 #include <map> 5 6 /* 7 multimap<std::string, BaseItem*> equipment_; 8 equipment_.insert(pair<std::string, BaseItem*>("Weapon", new BaseItem()));*/ 6 9 7 10 8 /* 9 multimap<std::string, Item*> equipment_;10 equipment_.insert(pair<std::string, Item*>("Weapon", new Item()));*/ 11 /* std::map<std::itemtype, BaseItem*> EQClasses; 12 EQClasses["jacke"] = 0; 13 BaseItem* item = itemMap_["jacke"]; 11 14 12 15 if (itemMap_["jacke"]) 16 if (itemMap_.find("jacke") != itemMap_.end()) */ 13 17 namespace orxonox 14 18 { 19 class BaseItem; 20 /** 21 @brief 22 ShipEquipment is the inventory of a player. It's part of the Pawn class. 23 24 */ 15 25 class _OrxonoxExport ShipEquipment 16 26 { 17 27 public: 18 void AddItem(Shipitem toAddItem); 19 void RemoveItem(Shipitem toRemoveItem); 20 bool CheckifValid(Shipitem toBeChecked); 21 int 22 28 inline int getSpace() 29 { 30 return Usable.size()+Trunk.size(); 31 }; 32 bool insert(BaseItem* item); 33 bool erase (BaseItem* item); 34 //void print(std::multimap<std::string, BaseItem*> eut); 35 void eraseAll(); 36 //bool checkSlot(BaseItem* item); 37 BaseItem* checkSlot(BaseItem* item); 38 // const std::multimap<std::string, BaseItem*>& getEquipment() const { return this->Equipment; } 39 inline std::multimap<std::string, BaseItem*>& getEquipment() {return this->Equipment;} 40 inline std::multimap<std::string, BaseItem*>& getUsable() {return this->Usable;} 41 inline std::multimap<std::string, BaseItem*>& getTrunk() {return this->Trunk;} 42 inline Pawn* getPlayer() {return this->player ;} 43 inline void setPlayer(Pawn* setplayer) 44 {this->player = setplayer;} 23 45 private: 24 std::multimap<std::string, Item*> Equipment; 46 Pawn* player;//!< Is a pointer to the belonging player 47 std::multimap<std::string, BaseItem*> Equipment;//!< the Equipment for permanent Items 48 std::multimap<std::string, BaseItem*> Usable;//!< Where Usables are stored 49 std::multimap<std::string, BaseItem*> Trunk;//!< Every other Item is stored here 25 50 }; 26 51 } … … 39 64 40 65 41 42 43 44 45 66 #endif
Note: See TracChangeset
for help on using the changeset viewer.