NetworkMessage.h 912 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #pragma once
  2. #include <ReferenceCounter.h>
  3. #include <Vec3.h>
  4. #include <Writer.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. ;
  24. void addressDimension();
  25. void openDialog(Framework::Text dialogName);
  26. void addressGui(Framework::Text elementId);
  27. void setMessage(char* msg, int length);
  28. void setUseBackground();
  29. void sendToAll();
  30. void writeTo(Framework::StreamWriter* zWriter) const;
  31. bool isBroadcast() const;
  32. bool isEmpty() const;
  33. bool isUseBackground() const;
  34. NetworkMessage* clone() const;
  35. };