Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/portals/src/modules/portals/PortalEndPoint.cc @ 8200

Last change on this file since 8200 was 8200, checked in by FelixSchulthess, 13 years ago

blah

  • Property svn:executable set to *
File size: 1.2 KB
Line 
1#include "PortalEndPoint.h"
2#include "core/XMLPort.h"
3
4namespace orxonox
5{
6    CreateFactory(PortalEndPoint);
7
8    std::map<unsigned int, PortalEndPoint *> PortalEndPoint::idMap_s;
9
10    PortalEndPoint::PortalEndPoint(BaseObject* creator) : DistanceMultiTrigger(creator), id_(0)
11    {
12        RegisterObject(PortalEndPoint);
13    }
14   
15    PortalEndPoint::~PortalEndPoint()
16    {
17     
18    }
19
20    void PortalEndPoint::XMLPort(Element& xmlelement, XMLPort::Mode mode)
21    {
22        SUPER(PortalEndPoint, XMLPort, xmlelement, mode);
23        XMLPortParam(PortalEndPoint, "id", setID, getID, xmlelement, mode);
24       
25        if(mode == XMLPort::LoadObject)
26        {
27            PortalEndPoint::idMap_s[this->id_] = this;
28        }
29    }
30
31    void PortalEndPoint::tick(float dt)
32    {
33        SUPER(PortalEndPoint, tick, dt);
34    }
35
36    void PortalEndPoint::jumpOut(WorldEntity* entity)
37    {
38        this->recentlyJumpedOut_.insert(entity);
39        entity->setPosition(this->getPosition());
40    }
41
42    bool PortalEndPoint::hasRecentlyJumpedOut(WorldEntity* entity)
43    {
44        if(this->recentlyJumpedOut_.find(entity) == this->recentlyJumpedOut_.end())
45        {
46            return false;
47        }
48        else
49            return true;
50    }
51
52}
Note: See TracBrowser for help on using the repository browser.