File: position.hpp

package info (click to toggle)
ares 126-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 32,600 kB
  • sloc: cpp: 356,508; ansic: 20,394; makefile: 16; sh: 2
file content (28 lines) | stat: -rw-r--r-- 648 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#if defined(Hiro_Position)
struct Position {
  using type = Position;

  Position();
  Position(f32 x, f32 y);
  template<typename X, typename Y>
  Position(X x, Y y) : Position((f32)x, (f32)y) {}

  explicit operator bool() const;
  auto operator==(const Position& source) const -> bool;
  auto operator!=(const Position& source) const -> bool;

  auto reset() -> type&;
  auto setPosition(Position position = {}) -> type&;
  auto setPosition(f32 x, f32 y) -> type&;
  auto setX(f32 x) -> type&;
  auto setY(f32 y) -> type&;
  auto x() const -> f32;
  auto y() const -> f32;

//private:
  struct State {
    f32 x;
    f32 y;
  } state;
};
#endif