NetworkMessage.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. #pragma once
  2. #include <ReferenceCounter.h>
  3. #include <Vec3.h>
  4. #include <Writer.h>
  5. #include <Punkt.h>
  6. class Chunk;
  7. class Block;
  8. class Entity;
  9. class Dimension;
  10. class ChatMessage;
  11. class ChatObserver;
  12. class ChunkMap;
  13. class NetworkMessage : public virtual Framework::ReferenceCounter
  14. {
  15. private:
  16. char* address;
  17. char addressLength;
  18. bool broadcast;
  19. char* message;
  20. int msgLength;
  21. bool useBackground;
  22. public:
  23. NetworkMessage();
  24. virtual ~NetworkMessage();
  25. void addressChunck(const Chunk* zChunk);
  26. void addressEntity(const Entity* zEntity);
  27. void addressBlock(const Block* zBlock);
  28. void addressDimension(const Dimension* zDim);
  29. void openDialog(Framework::Text dialogName);
  30. void addressGui(Framework::Text elementId);
  31. void setMessage(char* msg, int length);
  32. void sendChatMessage(ChatMessage* zMsg);
  33. void sendChatOptions(ChatObserver* zOptions);
  34. void sendMap(ChunkMap* zMap);
  35. void sendPlayerPositions(char *msg, int length);
  36. void setUseBackground();
  37. void sendToAll();
  38. void animateBlockBone(int dimensionId,
  39. Framework::Punkt chunkCenter,
  40. int index,
  41. int boneId,
  42. double time,
  43. Framework::Vec3<float> pos,
  44. Framework::Vec3<float> rotation);
  45. void writeTo(Framework::StreamWriter* zWriter) const;
  46. bool isBroadcast() const;
  47. bool isEmpty() const;
  48. bool isUseBackground() const;
  49. NetworkMessage* clone() const;
  50. };