17
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-10-17 12:09:19 +02:00
Files
maszyna/world/MemCell.cppm
maj00r b8f040e6fd propagate template headers transitively, import Console where used
AnimModel.cpp reaches cParser through the simulation core, not a direct
import, so the previous pass missed it; the propagation now follows the
whole import closure. Train.cpp, drivermode.cpp and Globals.cpp call
Console:: inside _WIN32 guards without importing eu07.console - invisible
on Linux, where those blocks are skipped.
2026-09-10 01:41:24 +02:00

119 lines
3.5 KiB
C++

/*
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/.
*/
module;
#include <array>
#include <chrono>
#include <limits>
#include <mutex>
#include <type_traits>
#include <utility>
#include <vector>
#include <cstddef>
#include <deque>
#include <sstream>
#include <unordered_map>
#include <istream>
#include <ostream>
#include <string>
export module eu07.simcore:memcell;
import eu07.glm;
import :fwd;
import eu07.utilities.parser;
import :driver;
import :track;
import eu07.utilities.classes;
import eu07.utilities.names;
import eu07.utilities.comparison;
export {
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::equal,
comparison_operator const Value1Operator = comparison_operator::equal,
comparison_operator const Value2Operator = comparison_operator::equal,
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();
};
//---------------------------------------------------------------------------
} // export