Horizon
src
canvas
target.hpp
1
#pragma once
2
#include "common/common.hpp"
3
#include "util/uuid_path.hpp"
4
5
namespace
horizon {
6
class
Target
{
7
public
:
8
UUIDPath<2>
path;
9
ObjectType type;
10
Coordi
p;
11
unsigned
int
vertex = 0;
12
int
layer = 10000;
13
Target
(
const
UUIDPath<2>
&uu, ObjectType ot,
const
Coordi
&pi,
unsigned
int
v = 0,
int
l = 10000)
14
: path(uu), type(ot), p(pi), vertex(v), layer(l){};
15
Target
() : type(ObjectType::INVALID){};
16
bool
is_valid()
const
17
{
18
return
type != ObjectType::INVALID;
19
}
20
bool
operator<(
const
Target
&other)
const
21
{
22
if
(type < other.type) {
23
return
true
;
24
}
25
if
(type > other.type) {
26
return
false
;
27
}
28
if
(path < other.path) {
29
return
true
;
30
}
31
else
if
(other.path < path) {
32
return
false
;
33
}
34
return
vertex < other.vertex;
35
}
36
bool
operator==(
const
Target
&other)
const
37
{
38
return
(path == other.path) && (vertex == other.vertex) && (type == other.type);
39
}
40
};
41
}
// namespace horizon
horizon::Coord< int64_t >
horizon::UUIDPath< 2 >
horizon::Target
Definition:
target.hpp:6
Generated by
1.8.16