NetworkMessage.h 841 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #pragma once
  2. #include <Writer.h>
  3. #include <Vec3.h>
  4. #include <ReferenceCounter.h>
  5. class Chunk;
  6. class Block;
  7. class Entity;
  8. class NetworkMessage : public virtual Framework::ReferenceCounter
  9. {
  10. private:
  11. char* address;
  12. char addressLength;
  13. bool broadcast;
  14. char* message;
  15. int msgLength;
  16. bool useBackground;
  17. public:
  18. NetworkMessage();
  19. ~NetworkMessage();
  20. void addressChunck(Chunk* zChunk);
  21. void addressEntity(Entity* zEntity);
  22. void addressBlock(Block* zBlock);;
  23. void addressDimension();
  24. void openDialog(Framework::Text dialogName);
  25. void addressGui(Framework::Text elementId);
  26. void setMessage(char* msg, int length);
  27. void setUseBackground();
  28. void sendToAll();
  29. void writeTo(Framework::StreamWriter* zWriter) const;
  30. bool isBroadcast() const;
  31. bool isEmpty() const;
  32. bool isUseBackground() const;
  33. NetworkMessage* clone() const;
  34. };