File: controller.h

package info (click to toggle)
eris 1.3.14-3
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 3,016 kB
  • ctags: 1,819
  • sloc: cpp: 13,153; sh: 9,106; perl: 287; makefile: 201; ansic: 165
file content (51 lines) | stat: -rw-r--r-- 1,882 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#ifndef TEST_CONTROLLER_H
#define TEST_CONTROLLER_H

#include <skstream/skstream_unix.h>
#include <Atlas/Objects/ObjectsFwd.h>
#include <Atlas/Objects/Decoder.h>
#include <wfmath/point.h>

namespace Atlas { class Codec; }

namespace Eris { class Avatar; }

class Controller : public Atlas::Objects::ObjectsDecoder
{
public:
    Controller(const char* pipe);
    
    void setEntityVisibleToAvatar(const std::string& eid, Eris::Avatar* av);
    void setEntityVisibleToAvatar(const std::string& eid, const std::string& charId);

    void setEntityInvisibleToAvatar(const std::string& eid, Eris::Avatar* av);
    void setEntityInvisibleToAvatar(const std::string& eid, const std::string& charId);   
    
    void moveLocation(const std::string& eid, const std::string& loc, const WFMath::Point<3>& pos);
    void movePos(const std::string& eid, const WFMath::Point<3>& pos);
    void moveVelocity(const std::string& eid, const WFMath::Vector<3>& vel);
    void move(const std::string& eid, const Atlas::Objects::Operation::RootOperation& op);
    
    void create(const Atlas::Objects::Entity::RootEntity& ent);
    void deleteEntity(const std::string& eid);
    
    /** generalised attribute modification interface */
    void setAttr(const std::string& eid, const std::string& attr, const Atlas::Message::Element v); 
    
    void broadcastSoundFrom(const std::string& e, const Atlas::Objects::Operation::RootOperation& op);
    void broadcastSightFrom(const std::string& e, const Atlas::Objects::Operation::RootOperation& op);

    void command(const std::string& cid, const std::string& acc);
protected:
    virtual void objectArrived(const Atlas::Objects::Root& obj);
    
private:
    void send(const Atlas::Objects::Root &obj);
    
    unix_socket_stream m_stream;

    Atlas::Objects::ObjectsEncoder* m_encode;
    Atlas::Codec* m_codec;
};

#endif // of TEST_CONTROLLER_H