// // Created by max on 27.04.23. // #ifndef HOLESOME_TRANSLATED_COORDINATES_H #define HOLESOME_TRANSLATED_COORDINATES_H #include #include "coordinates.h" #include "coordinate_transformer.h" #define INITIAL_WORLD_TO_GRID_FACTOR 0.25f class TranslatedCoordinates { public: explicit TranslatedCoordinates(WorldCoordinates worldCoordinates); WorldCoordinates world() const; IsometricCoordinates isometric() const; GridCoordinates grid() const; void set(WorldCoordinates newWorldCoordinates); void set(const TranslatedCoordinates& newCoordinates); void set(IsometricCoordinates newIsometricCoordinates); void move(WorldCoordinates deltaWorldCoordinates); void move(sf::Vector2f deltaWorldCoordinates); private: WorldCoordinates worldCoordinates; const float worldToGridFactor = INITIAL_WORLD_TO_GRID_FACTOR; const std::shared_ptr coordTransformer = std::make_shared(); }; #endif //HOLESOME_TRANSLATED_COORDINATES_H