[2000] | 1 | #ifndef _ShipEquipment_H__ |
---|
| 2 | #define _ShipEquipment_H__ |
---|
| 3 | #include <string> |
---|
[2289] | 4 | #include <map> |
---|
[2000] | 5 | |
---|
| 6 | /* |
---|
| 7 | multimap<std::string, Item*> equipment_; |
---|
| 8 | equipment_.insert(pair<std::string, Item*>("Weapon", new Item()));*/ |
---|
| 9 | |
---|
| 10 | |
---|
[2289] | 11 | /* std::map<std::itemtype, Item*> EQClasses; |
---|
| 12 | EQClasses["jacke"] = 0; |
---|
| 13 | Item* item = itemMap_["jacke"]; |
---|
| 14 | |
---|
| 15 | if (itemMap_["jacke"]) |
---|
| 16 | if (itemMap_.find("jacke") != itemMap_.end()) */ |
---|
[2094] | 17 | namespace orxonox |
---|
| 18 | { |
---|
[2324] | 19 | class Item; |
---|
| 20 | |
---|
[2094] | 21 | class _OrxonoxExport ShipEquipment |
---|
| 22 | { |
---|
| 23 | public: |
---|
[2289] | 24 | inline int getSpace() |
---|
| 25 | { |
---|
| 26 | return Usable.size()+Trunk.size(); |
---|
| 27 | }; |
---|
[2290] | 28 | bool insert(Item* item); |
---|
| 29 | bool erase (Item* item); |
---|
[2342] | 30 | //void print(std::multimap<std::string, Item*> eut); |
---|
[2324] | 31 | void eraseAll(); |
---|
| 32 | bool checkSlot(Item* item); |
---|
[2289] | 33 | // const std::multimap<std::string, Item*>& getEquipment() const { return this->Equipment; } |
---|
[2324] | 34 | inline std::multimap<std::string, Item*>& getEquipment() {return this->Equipment;} |
---|
| 35 | inline std::multimap<std::string, Item*>& getUsable() {return this->Usable;} |
---|
| 36 | inline std::multimap<std::string, Item*>& getTrunk() {return this->Trunk;} |
---|
| 37 | inline Pawn* getPlayer() {return this->player ;} |
---|
| 38 | inline void setPlayer(Pawn* setplayer) |
---|
| 39 | {this->player = setplayer;} |
---|
[2094] | 40 | private: |
---|
[2324] | 41 | Pawn* player; |
---|
[2094] | 42 | std::multimap<std::string, Item*> Equipment; |
---|
[2289] | 43 | std::multimap<std::string, Item*> Usable; |
---|
| 44 | std::multimap<std::string, Item*> Trunk; |
---|
[2094] | 45 | }; |
---|
[2083] | 46 | } |
---|
[2000] | 47 | |
---|
| 48 | |
---|
| 49 | |
---|
| 50 | |
---|
| 51 | |
---|
| 52 | |
---|
| 53 | |
---|
| 54 | |
---|
| 55 | |
---|
| 56 | |
---|
| 57 | |
---|
| 58 | |
---|
| 59 | |
---|
| 60 | |
---|
| 61 | #endif |
---|