Rev | Line | |
---|
[2227] | 1 | /* has to be added to player |
---|
| 2 | multimap<std::string, Item*> Equipment;*/ |
---|
| 3 | |
---|
| 4 | #include "Item.h" |
---|
| 5 | #include "core/CoreIncludes.h" |
---|
| 6 | #include "core/XMLPort.h" |
---|
| 7 | #include "util/String.h" |
---|
| 8 | #include "objects/worldentities/pawns/Pawn.h" |
---|
| 9 | |
---|
| 10 | namespace orxonox |
---|
| 11 | { |
---|
| 12 | Item::Item(BaseObject* creator) : BaseObject(creator) |
---|
| 13 | { |
---|
| 14 | RegisterObject(Item); |
---|
| 15 | |
---|
| 16 | this->playerBaseClass_ = 0; |
---|
| 17 | } |
---|
| 18 | |
---|
| 19 | Item::~Item() |
---|
| 20 | { |
---|
| 21 | } |
---|
| 22 | void Item::XMLPort(Element& xmlelement, XMLPort::Mode mode) |
---|
| 23 | { |
---|
| 24 | SUPER(Item, XMLPort, xmlelement, mode); |
---|
| 25 | |
---|
| 26 | XMLPortParam(Item, "playerclass", setPlayerBaseClassName, getPlayerBaseClassName, xmlelement, mode); |
---|
| 27 | } |
---|
| 28 | |
---|
| 29 | void Item::addTo (Pawn* player) |
---|
| 30 | { |
---|
| 31 | //player->Equipment.insert ( std::pair<std::string, Item*>(this->itemname,this) ); |
---|
| 32 | } |
---|
| 33 | |
---|
| 34 | void Item::setPlayerBaseClassName(const std::string& name) |
---|
| 35 | { |
---|
| 36 | this->playerBaseClass_ = ClassByString(name); |
---|
| 37 | } |
---|
| 38 | |
---|
| 39 | const std::string& Item::getPlayerBaseClassName() const |
---|
| 40 | { |
---|
| 41 | if (this->playerBaseClass_) |
---|
| 42 | return this->playerBaseClass_->getName(); |
---|
| 43 | else |
---|
| 44 | return BLANKSTRING; |
---|
| 45 | } |
---|
| 46 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.