-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcase.hxx
66 lines (50 loc) · 1.09 KB
/
case.hxx
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#pragma once
#include <stdexcept>
#include "case.hh"
namespace Djikstra
{
inline constexpr Case::Case(int x, int y) : x_(x), y_(y)
{
if (x_ < 0)
throw std::out_of_range("X is lower than 0");
if (y_ < 0)
throw std::out_of_range("Y is lower than 0");
}
inline void Case::cood_set(int x, int y) noexcept
{
x_ = x;
y_ = y;
}
inline constexpr Case::operator int () const
{
return x_;
}
inline void Case::weight_set(int weight) noexcept
{
weight_ = weight;
}
inline void Case::is_listed_set(bool listed) noexcept
{
is_listed_ = listed;
}
inline void Case::father_set(Case * const father) noexcept
{
father_ = father;
}
inline bool Case::is_listed() const noexcept
{
return is_listed_;
}
inline int Case::weight_get() const noexcept
{
return weight_;
}
inline int Case::x_get() const noexcept
{
return x_;
}
inline int Case::y_get() const noexcept
{
return y_;
}
}