Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/pickups2/src/orxonox/objects/pickup/Item.cc @ 2274

Last change on this file since 2274 was 2227, checked in by dsommer, 16 years ago

Turbo funktioniert

File size: 1002 bytes
Line 
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
10namespace orxonox
11{
12Item::Item(BaseObject* creator) : BaseObject(creator)
13{
14        RegisterObject(Item);
15
16        this->playerBaseClass_ = 0;
17}
18
19Item::~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
29void Item::addTo (Pawn* player)
30{
31        //player->Equipment.insert ( std::pair<std::string, Item*>(this->itemname,this) );
32}
33
34void Item::setPlayerBaseClassName(const std::string& name)
35{
36        this->playerBaseClass_ = ClassByString(name);
37}
38
39const 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.