forked from firleju/maszyna
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMemCell.h
94 lines (83 loc) · 3.07 KB
/
MemCell.h
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
/*
This Source Code Form is subject to the
terms of the Mozilla Public License, v.
2.0. If a copy of the MPL was not
distributed with this file, You can
obtain one at
http://mozilla.org/MPL/2.0/.
*/
#pragma once
#include "Classes.h"
#include "scenenode.h"
#include "Names.h"
#include "comparison.h"
class TMemCell : public scene::basic_node {
public:
// constructors
explicit TMemCell( scene::node_data const &Nodedata );
// methods
void
UpdateValues( std::string const &szNewText, double const fNewValue1, double const fNewValue2, int const CheckMask );
bool
Load(cParser *parser);
void
PutCommand( TController *Mech, glm::dvec3 const *Loc ) const;
bool
Compare( std::string const &szTestText, double const fTestValue1, double const fTestValue2, int const CheckMask,
comparison_operator const TextOperator = comparison_operator::eq,
comparison_operator const Value1Operator = comparison_operator::eq,
comparison_operator const Value2Operator = comparison_operator::eq,
comparison_pass const Pass = comparison_pass::all ) const;
std::string const &
Text() const {
return szText; }
double
Value1() const {
return fValue1; };
double
Value2() const {
return fValue2; };
TCommandType
Command() const {
return eCommand; };
bool
StopCommand() const {
return bCommand; };
void StopCommandSent();
TCommandType CommandCheck();
bool IsVelocity() const;
void AssignEvents(basic_event *e);
std::string Values() const;
void LogValues() const;
// members
std::string asTrackName; // McZapkie-100302 - zeby nazwe toru na ktory jest Putcommand wysylane pamietac
TTrack *Track { nullptr }; // resolved binding with the specified track
bool is_exportable { true }; // export helper; autogenerated cells don't need to be exported
private:
// methods
// serialize() subclass details, sends content of the subclass to provided stream
void serialize_( std::ostream &Output ) const;
// deserialize() subclass details, restores content of the subclass from provided stream
void deserialize_( std::istream &Input );
// export() subclass details, sends basic content of the class in legacy (text) format to provided stream
void export_as_text_( std::ostream &Output ) const;
// members
// content
std::string szText;
double fValue1 { 0.0 };
double fValue2 { 0.0 };
// other
TCommandType eCommand { TCommandType::cm_Unknown };
bool bCommand { false }; // czy zawiera komendę dla zatrzymanego AI
basic_event *OnSent { nullptr }; // event dodawany do kolejki po wysłaniu komendy zatrzymującej skład
};
class memory_table : public basic_table<TMemCell> {
public:
// legacy method, initializes traction after deserialization from scenario file
void
InitCells();
// legacy method, sends content of all cells to the log
void
log_all();
};
//---------------------------------------------------------------------------