Линия опасного перелета
More...
#include <trappy_line.h>
◆ TrappyLine() [1/5]
lib::TrappyLine::TrappyLine |
( |
| ) |
|
|
default |
◆ TrappyLine() [2/5]
lib::TrappyLine::TrappyLine |
( |
Target * | first_target, |
|
|
Target * | second_target ) |
|
inline |
18 :
targets_{std::make_pair(first_target, second_target)} {}
std::pair< Target *, Target * > targets_
Definition trappy_line.h:50
◆ TrappyLine() [3/5]
lib::TrappyLine::TrappyLine |
( |
std::pair< Target *, Target * > | targets | ) |
|
|
inline |
◆ TrappyLine() [4/5]
lib::TrappyLine::TrappyLine |
( |
const TrappyLine & | | ) |
|
|
default |
◆ TrappyLine() [5/5]
◆ CheckErrorValues()
void lib::TrappyLine::CheckErrorValues |
( |
| ) |
const |
|
inlineoverrideprivatevirtual |
- Exceptions
-
td::runtime_error | класс не содержит проверяемых данных |
Implements lib::JSONable.
45 {
46 throw std::runtime_error("dev: no checkable error values in TrappyLines");
47 }
◆ GetId()
virtual unsigned short lib::JSONable::GetId |
( |
| ) |
const |
|
inlinevirtualinherited |
Возвращает значение ид. объекта внутри файла
- Returns
- unsigned short: идентификатор объекта внутри файла
unsigned short id_
Идентификатор объекта внутри файла
Definition base.h:40
◆ GetJsonInfo()
QJsonObject lib::TrappyLine::GetJsonInfo |
( |
| ) |
const |
|
overridevirtual |
Implements lib::JSONable.
9 {
10 QVariantMap trappy_line_map;
11
12 trappy_line_map.insert(
"Id",
GetId());
13 trappy_line_map.insert(
"Id_P1",
targets_.first->GetId());
14 trappy_line_map.insert(
"Id_P2",
targets_.second->GetId());
15
16 return QJsonObject::fromVariantMap(trappy_line_map);
17}
virtual unsigned short GetId() const
Возвращает значение ид. объекта внутри файла
Definition base.h:26
◆ GetTargets()
std::pair< Target, Target > lib::TrappyLine::GetTargets |
( |
| ) |
const |
27 {
29 throw std::runtime_error("dev: target is nullptr");
30
32}
◆ GetTargetsPtrs() [1/2]
std::pair< Target *, Target * > & lib::TrappyLine::GetTargetsPtrs |
( |
| ) |
|
|
inline |
◆ GetTargetsPtrs() [2/2]
const std::pair< Target *, Target * > & lib::TrappyLine::GetTargetsPtrs |
( |
| ) |
const |
|
inline |
◆ IsChanged()
bool lib::TrappyLine::IsChanged |
( |
const QJsonObject & | trappy_line_obj | ) |
const |
|
overridevirtual |
Implements lib::JSONable.
19 {
20 unsigned short id1 =
21 static_cast<unsigned short>(trappy_line_obj.value("Id_P1").toInt());
22 unsigned short id2 =
23 static_cast<unsigned short>(trappy_line_obj.value("Id_P2").toInt());
25}
◆ operator=() [1/2]
◆ operator=() [2/2]
◆ operator==()
bool lib::TrappyLine::operator== |
( |
const TrappyLine & | tr_line | ) |
const |
34 {
35 return targets_.first == tr_line.GetTargetsPtrs().first &&
36 targets_.second == tr_line.GetTargetsPtrs().second;
37}
◆ SetId()
virtual void lib::JSONable::SetId |
( |
unsigned short | id | ) |
|
|
inlinevirtualinherited |
Устанавливает значение ид. объекта внутри файла
- Parameters
-
id | новый идентификатор объекта |
◆ SetJsonInfo()
void lib::TrappyLine::SetJsonInfo |
( |
const QJsonObject & | | ) |
|
|
inlineoverridevirtual |
◆ SetTargets() [1/2]
void lib::TrappyLine::SetTargets |
( |
std::pair< Target *, Target * > | targets | ) |
|
|
inline |
◆ SetTargets() [2/2]
void lib::TrappyLine::SetTargets |
( |
Target * | first_target, |
|
|
Target * | second_target ) |
|
inline |
31 {
32 targets_ = std::make_pair(first_target, second_target);
33 }
◆ id_
unsigned short lib::JSONable::id_ {USHRT_MAX} |
|
privateinherited |
Идентификатор объекта внутри файла
◆ targets_
The documentation for this class was generated from the following files: