9#ifndef __NETWORK_NODE_H__
10#define __NETWORK_NODE_H__
13#include "EventKeyboard.h"
14#include "EventMouse.h"
15#include "EventNetwork.h"
21enum class MessageType {
99 unsigned int attr=0,
int sock=-1);
111 Mouse::Button button,
Vector mouse_position,
117 int sendMessage(MessageType msg_type,
int num_bytes,
const void *bytes,
Definition: EventNetwork.h:28
Definition: NetworkNode.h:60
int prepMessageHeader(MessageType msg_type, int msg_size)
Prepare message buffer and header.
int sendMessage(MessageType msg_type, EventKeyboardAction action, Keyboard::Key key, int sock=-1)
Send message from Client to Server.
int genDataEvents(int sock=0) const
Called each step to generate data events, when appropriate.
int sendMessage(MessageType msg_type, EventMouseAction action, Mouse::Button button, Vector mouse_position, int sock=-1)
Send message from Client to Server.
virtual int handleData(const EventNetwork *p_e)
Handle and generate events based on type.
virtual Object * createObject(std::string object_type)
Create (new) Object of given type.
int sendMessage(MessageType msg_type, int num_bytes, const void *bytes, int sock=-1)
Send message from either Client to Server or Server to Client.
int sizeBuffer(int msg_size)
Increase size of network message buffer (if needed).
int sendMessage(MessageType msg_type, int sock=-1)
Send message (supporting various message types).
virtual int eventHandler(const Event *p_e) override
Handle network and step events.
int sendMessage(MessageType msg_type, Object *p_obj, unsigned int attr=0, int sock=-1)
Send message from Server to Client.
Key
Keys Dragonfly recognizes.
Definition: EventKeyboard.h:25
An animation for a sprite.
Definition: Animation.h:15
EventKeyboardAction
Types of keyboard actions Dragonfly recognizes.
Definition: EventKeyboard.h:15
EventMouseAction
Set of mouse actions recognized by Dragonfly.
Definition: EventMouse.h:16