NetworkResponse.h 883 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. #pragma once
  2. #include <Writer.h>
  3. #include <Vec3.h>
  4. class Chunk;
  5. class Block;
  6. class Entity;
  7. class NetworkResponse
  8. {
  9. private:
  10. char* adress;
  11. char adressLength;
  12. Framework::Vec3<float> minPosition;
  13. Framework::Vec3<float> maxPosition;
  14. bool broadcast;
  15. char* message;
  16. bool msgDelete;
  17. int msgLength;
  18. bool useBackground;
  19. public:
  20. NetworkResponse();
  21. ~NetworkResponse();
  22. void adressChunck( Chunk* zChunk );
  23. void adressEntity( Entity* zEntity );
  24. void adressBlock( Block* zBlock );
  25. void setMessage( char* msg, int length, bool deleteMsg );
  26. void setUseBackground();
  27. void sendToAll();
  28. bool isAreaAffected( Framework::Vec3<float> min, Framework::Vec3<float> max ) const;
  29. void writeTo( Framework::StreamWriter* zWriter ) const;
  30. bool isBroadcast() const;
  31. bool isEmpty() const;
  32. bool isUseBackground() const;
  33. };