yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
dimension_service.h
Go to the documentation of this file.
1#ifndef YAZE_ZELDA3_DUNGEON_DIMENSION_SERVICE_H
2#define YAZE_ZELDA3_DUNGEON_DIMENSION_SERVICE_H
3
4#include <tuple>
5#include <utility>
6
8
9namespace yaze {
10namespace zelda3 {
11
20 public:
21 static DimensionService& Get();
22
26 int width_tiles = 1;
27 int height_tiles = 1;
28
29 int width_pixels() const { return width_tiles * 8; }
30 int height_pixels() const { return height_tiles * 8; }
31 };
32
33 // Primary lookup: returns tile-based dimensions with offset.
34 DimensionResult GetDimensions(const RoomObject& obj) const;
35
36 // Pixel-based convenience (width, height in pixels).
37 std::pair<int, int> GetPixelDimensions(const RoomObject& obj) const;
38
39 // Hit-test bounds: (x_tiles, y_tiles, width_tiles, height_tiles).
40 // x/y include the object's position.
41 std::tuple<int, int, int, int> GetHitTestBounds(
42 const RoomObject& obj) const;
43
44 // Selection bounds in pixels: (x_px, y_px, width_px, height_px).
45 // x/y include the object's position.
46 std::tuple<int, int, int, int> GetSelectionBoundsPixels(
47 const RoomObject& obj) const;
48
49 private:
50 DimensionService() = default;
51};
52
53} // namespace zelda3
54} // namespace yaze
55
56#endif // YAZE_ZELDA3_DUNGEON_DIMENSION_SERVICE_H
Unified dimension lookup for dungeon room objects.
static DimensionService & Get()
std::tuple< int, int, int, int > GetSelectionBoundsPixels(const RoomObject &obj) const
DimensionResult GetDimensions(const RoomObject &obj) const
std::tuple< int, int, int, int > GetHitTestBounds(const RoomObject &obj) const
std::pair< int, int > GetPixelDimensions(const RoomObject &obj) const