16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-20 02:09:19 +02:00

maintenance: event code refactoring

This commit is contained in:
tmj-fstate
2018-09-18 03:57:32 +02:00
parent 4da8b300e8
commit 40afc461fa
23 changed files with 2451 additions and 1644 deletions

View File

@@ -110,12 +110,12 @@ bool TEventLauncher::Load(cParser *parser)
*parser >> token;
szText = token;
if (token != "*") //*=nie brać command pod uwagę
iCheckMask |= conditional_memstring;
iCheckMask |= basic_event::flags::text;
parser->getTokens();
*parser >> token;
if (token != "*") //*=nie brać wartości 1. pod uwagę
{
iCheckMask |= conditional_memval1;
iCheckMask |= basic_event::flags::value_1;
fVal1 = atof(token.c_str());
}
else
@@ -124,7 +124,7 @@ bool TEventLauncher::Load(cParser *parser)
*parser >> token;
if (token.compare("*") != 0) //*=nie brać wartości 2. pod uwagę
{
iCheckMask |= conditional_memval2;
iCheckMask |= basic_event::flags::value_2;
fVal2 = atof(token.c_str());
}
else
@@ -280,8 +280,8 @@ TEventLauncher::export_as_text_( std::ostream &Output ) const {
<< "condition "
<< asMemCellName << ' '
<< szText << ' '
<< ( ( iCheckMask & conditional_memval1 ) != 0 ? to_string( fVal1 ) : "*" ) << ' '
<< ( ( iCheckMask & conditional_memval2 ) != 0 ? to_string( fVal2 ) : "*" ) << ' ';
<< ( ( iCheckMask & basic_event::flags::value_1 ) != 0 ? to_string( fVal1 ) : "*" ) << ' '
<< ( ( iCheckMask & basic_event::flags::value_2 ) != 0 ? to_string( fVal2 ) : "*" ) << ' ';
}
// footer
Output