WorldUpdate.h 914 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. #pragma once
  2. #include <ReferenceCounter.h>
  3. #include <Vec3.h>
  4. #include <Writer.h>
  5. #include "StaticRegistry.h"
  6. class Dimension;
  7. class WorldUpdate : public Framework::ReferenceCounter
  8. {
  9. private:
  10. int affectedDimensionId;
  11. Framework::Vec3<int> minAffected;
  12. Framework::Vec3<int> maxAffected;
  13. int type;
  14. protected:
  15. virtual void write(Framework::StreamWriter* zWriter) = 0;
  16. public:
  17. WorldUpdate(int type, int dimensionId, Framework::Vec3<int> minAffected, Framework::Vec3<int> maxAffected);
  18. virtual void onUpdate(Dimension* zDimension) = 0;
  19. void writeAndCheck(Framework::StreamWriter* zWriter);
  20. int getAffectedDimension() const;
  21. const Framework::Vec3<int>& getMinAffectedPoint() const;
  22. const Framework::Vec3<int>& getMaxAffectedPoint() const;
  23. int getType() const;
  24. int distanceTo(int x, int y) const;
  25. };
  26. class WorldUpdateType : public Framework::ReferenceCounter
  27. {
  28. protected:
  29. WorldUpdateType(int id);
  30. };