123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- #pragma once
- #include <Punkt.h>
- #include <ReferenceCounter.h>
- #include <Vec3.h>
- #include <Writer.h>
- class Chunk;
- class Block;
- class Entity;
- class Dimension;
- class ChatMessage;
- class ChatObserver;
- class ChunkMap;
- class NetworkMessage : public virtual Framework::ReferenceCounter
- {
- private:
- char* address;
- char addressLength;
- bool broadcast;
- char* message;
- int msgLength;
- bool useBackground;
- std::function<void()> onAfterSend;
- public:
- NetworkMessage();
- virtual ~NetworkMessage();
- void setOnAfterSend(std::function<void()> onAfterSend);
- void addressChunck(const Chunk* zChunk);
- void addressEntity(const Entity* zEntity);
- void addressBlock(const Block* zBlock);
- void addressDimension(const Dimension* zDim);
- void openDialog(Framework::Text dialogName, Framework::Text uiml);
- void updateDialog(Framework::Text dialogName, Framework::Text uiml);
- void addressUIElement(Framework::Text elementId);
- void setMessage(char* msg, int length);
- void sendChatMessage(ChatMessage* zMsg);
- void sendChatOptions(ChatObserver* zOptions);
- void sendMap(ChunkMap* zMap);
- void sendPlayerPositions(char* msg, int length);
- void setUseBackground();
- void sendToAll();
- void animateBlockBone(int dimensionId,
- Framework::Punkt chunkCenter,
- int index,
- int boneId,
- double time,
- Framework::Vec3<float> pos,
- Framework::Vec3<float> rotation);
- void syncTime(double time,
- double nightLength,
- double transitionLength,
- double dayLength);
- void addEntityMessage(const Entity* zEntity);
- void removeEntityMessage(const Entity* zEntity);
- void writeTo(Framework::StreamWriter* zWriter) const;
- bool isBroadcast() const;
- bool isEmpty() const;
- bool isUseBackground() const;
- NetworkMessage* clone() const;
- };
|