12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- #pragma once
- #include <ReferenceCounter.h>
- #include <Vec3.h>
- #include <Writer.h>
- #include "StaticRegistry.h"
- class Dimension;
- class WorldUpdateTypeEnum
- {
- public:
- static const int ADD_ENTITY = 0;
- static const int REMOVE_ENTITY = 1;
- };
- class WorldUpdate : public Framework::ReferenceCounter
- {
- private:
- int affectedDimensionId;
- Framework::Vec3<int> minAffected;
- Framework::Vec3<int> maxAffected;
- int type;
- protected:
- virtual void write(Framework::StreamWriter* zWriter) = 0;
- public:
- WorldUpdate(int type,
- int dimensionId,
- Framework::Vec3<int> minAffected,
- Framework::Vec3<int> maxAffected);
- virtual void onUpdate(Dimension* zDimension) = 0;
- void writeAndCheck(Framework::StreamWriter* zWriter);
- int getAffectedDimension() const;
- const Framework::Vec3<int>& getMinAffectedPoint() const;
- const Framework::Vec3<int>& getMaxAffectedPoint() const;
- int getType() const;
- int distanceTo(int x, int y) const;
- };
|