mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-07-21 17:09:19 +02:00
partial initial refactoring: events, memcells, tracks, models, traction; NOTE: debug mode broken, investigate
This commit is contained in:
77
MemCell.h
77
MemCell.h
@@ -10,52 +10,59 @@ http://mozilla.org/MPL/2.0/.
|
||||
#pragma once
|
||||
|
||||
#include "Classes.h"
|
||||
#include "scenenode.h"
|
||||
#include "dumb3d.h"
|
||||
#include "names.h"
|
||||
|
||||
class TMemCell : public editor::basic_node {
|
||||
|
||||
class TMemCell
|
||||
{
|
||||
private:
|
||||
Math3D::vector3 vPosition;
|
||||
// content
|
||||
std::string szText;
|
||||
double fValue1;
|
||||
double fValue2;
|
||||
TCommandType eCommand;
|
||||
bool bCommand; // czy zawiera komendę dla zatrzymanego AI
|
||||
TEvent *OnSent; // event dodawany do kolejki po wysłaniu komendy zatrzymującej skład
|
||||
double fValue1 { 0.0 };
|
||||
double fValue2 { 0.0 };
|
||||
// other
|
||||
TCommandType eCommand { cm_Unknown };
|
||||
bool bCommand { false }; // czy zawiera komendę dla zatrzymanego AI
|
||||
TEvent *OnSent { nullptr }; // event dodawany do kolejki po wysłaniu komendy zatrzymującej skład
|
||||
public:
|
||||
std::string asTrackName; // McZapkie-100302 - zeby nazwe toru na ktory jest Putcommand wysylane pamietac
|
||||
|
||||
TMemCell( scene::node_data const &Nodedata );
|
||||
// legacy constructor
|
||||
TMemCell( Math3D::vector3 *p );
|
||||
void Init();
|
||||
void UpdateValues( std::string const &szNewText, double const fNewValue1, double const fNewValue2, int const CheckMask );
|
||||
bool Load(cParser *parser);
|
||||
void PutCommand( TController *Mech, Math3D::vector3 *Loc );
|
||||
bool Compare( std::string const &szTestText, double const fTestValue1, double const fTestValue2, int const CheckMask );
|
||||
bool Render();
|
||||
inline std::string const &Text() { return szText; }
|
||||
inline double Value1()
|
||||
{
|
||||
return fValue1;
|
||||
};
|
||||
inline double Value2()
|
||||
{
|
||||
return fValue2;
|
||||
};
|
||||
inline Math3D::vector3 Position()
|
||||
{
|
||||
return vPosition;
|
||||
};
|
||||
inline TCommandType Command()
|
||||
{
|
||||
return eCommand;
|
||||
};
|
||||
inline bool StopCommand()
|
||||
{
|
||||
return bCommand;
|
||||
};
|
||||
|
||||
void
|
||||
UpdateValues( std::string const &szNewText, double const fNewValue1, double const fNewValue2, int const CheckMask );
|
||||
bool
|
||||
Load(cParser *parser);
|
||||
void
|
||||
PutCommand( TController *Mech, Math3D::vector3 *Loc );
|
||||
bool
|
||||
Compare( std::string const &szTestText, double const fTestValue1, double const fTestValue2, int const CheckMask );
|
||||
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();
|
||||
void AssignEvents(TEvent *e);
|
||||
};
|
||||
|
||||
class memory_manager : public basic_table<TMemCell> {
|
||||
|
||||
};
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user