NetworkMessage.h 970 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 Dimension;
  9. class NetworkMessage : public virtual Framework::ReferenceCounter
  10. {
  11. private:
  12. char* address;
  13. char addressLength;
  14. bool broadcast;
  15. char* message;
  16. int msgLength;
  17. bool useBackground;
  18. public:
  19. NetworkMessage();
  20. virtual ~NetworkMessage();
  21. void addressChunck(const Chunk* zChunk);
  22. void addressEntity(const Entity* zEntity);
  23. void addressBlock(const Block* zBlock);
  24. void addressDimension(const Dimension* zDim);
  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. };