WorldUpdate.cpp 651 B

123456789101112131415161718192021222324252627282930
  1. #include "WorldUpdate.h"
  2. WorldUpdate::WorldUpdate(int type, int dimensionId, Framework::Vec3<float> pos)
  3. : ReferenceCounter(),
  4. affectedDimensionId(dimensionId),
  5. type(type),
  6. pos(pos)
  7. {}
  8. void WorldUpdate::writeAndCheck(Framework::StreamWriter* zWriter)
  9. {
  10. zWriter->schreibe((char*)&type, 4);
  11. this->write(zWriter);
  12. zWriter->schreibe((char*)&type, 4);
  13. }
  14. int WorldUpdate::getAffectedDimension() const
  15. {
  16. return affectedDimensionId;
  17. }
  18. int WorldUpdate::getType() const
  19. {
  20. return type;
  21. }
  22. int WorldUpdate::distanceTo(int x, int y) const
  23. {
  24. return pos.abstand(Framework::Vec3<float>((float)x, (float)y, pos.z));
  25. }