code:
#include "Database/Messages.hpp"
Messages::Messages(const Messages& other)
: IModifiable(other)
, m_actionFailure(other.m_actionFailure)
, m_actorDamage(other.m_actorDamage)
, m_actorDrain(other.m_actorDrain)
, m_actorGain(other.m_actorGain)
, m_actorLoss(other.m_actorLoss)
, m_actorNoDamage(other.m_actorNoDamage)
, m_actorNoHit(other.m_actorNoHit)
, m_actorRecovery(other.m_actorRecovery)
, m_alwaysDash(other.m_alwaysDash)
, m_bgmVolume(other.m_bgmVolume)
, m_bgsVolume(other.m_bgsVolume)
, m_buffAdd(other.m_buffAdd)
, m_buffRemove(other.m_buffRemove)
, m_commandRemember(other.m_commandRemember)
, m_counterAttack(other.m_counterAttack)
, m_criticalToActor(other.m_criticalToActor)
, m_criticalToEnemy(other.m_criticalToEnemy)
, m_debuffAdd(other.m_debuffAdd)
, m_defeat(other.m_defeat)
, m_emerge(other.m_emerge)
, m_enemyDamage(other.m_enemyDamage)
, m_enemyDrain(other.m_enemyDrain)
, m_enemyGain(other.m_enemyGain)
, m_enemyLoss(other.m_enemyLoss)
, m_enemyNoDamage(other.m_enemyNoDamage)
, m_enemyNoHit(other.m_enemyNoHit)
, m_enemyRecovery(other.m_enemyRecovery)
, m_escapeFailure(other.m_escapeFailure)
, m_escapeStart(other.m_escapeStart)
, m_evasion(other.m_evasion)
, m_expNext(other.m_expNext)
, m_expTotal(other.m_expTotal)
, m_file(other.m_file)
, m_levelUp(other.m_levelUp)
, m_loadMessage(other.m_loadMessage)
, m_magicEvasion(other.m_magicEvasion)
, m_magicReflection(other.m_magicReflection)
, m_meVolume(other.m_meVolume)
, m_obtainExp(other.m_obtainExp)
, m_obtainGold(other.m_obtainGold)
, m_obtainItem(other.m_obtainItem)
, m_obtainSkill(other.m_obtainSkill)
, m_partyName(other.m_partyName)
, m_possession(other.m_possession)
, m_preemptive(other.m_preemptive)
, m_saveMessage(other.m_saveMessage)
, m_seVolume(other.m_seVolume)
, m_substitute(other.m_substitute)
, m_surprise(other.m_surprise)
, m_useItem(other.m_useItem)
, m_victory(other.m_victory)
, m_oldactionFailure(other.m_actionFailure)
, m_oldactorDamage(other.m_actorDamage)
, m_oldactorDrain(other.m_actorDrain)
, m_oldactorGain(other.m_actorGain)
, m_oldactorLoss(other.m_actorLoss)
, m_oldactorNoDamage(other.m_actorNoDamage)
, m_oldactorNoHit(other.m_actorNoHit)
, m_oldactorRecovery(other.m_actorRecovery)
, m_oldalwaysDash(other.m_alwaysDash)
, m_oldbgmVolume(other.m_bgmVolume)
, m_oldbgsVolume(other.m_bgsVolume)
, m_oldbuffAdd(other.m_buffAdd)
, m_oldbuffRemove(other.m_buffRemove)
, m_oldcommandRemember(other.m_commandRemember)
, m_oldcounterAttack(other.m_counterAttack)
, m_oldcriticalToActor(other.m_criticalToActor)
, m_oldcriticalToEnemy(other.m_criticalToEnemy)
, m_olddebuffAdd(other.m_debuffAdd)
, m_olddefeat(other.m_defeat)
, m_oldemerge(other.m_emerge)
, m_oldenemyDamage(other.m_enemyDamage)
, m_oldenemyDrain(other.m_enemyDrain)
, m_oldenemyGain(other.m_enemyGain)
, m_oldenemyLoss(other.m_enemyLoss)
, m_oldenemyNoDamage(other.m_enemyNoDamage)
, m_oldenemyNoHit(other.m_enemyNoHit)
, m_oldenemyRecovery(other.m_enemyRecovery)
, m_oldescapeFailure(other.m_escapeFailure)
, m_oldescapeStart(other.m_escapeStart)
, m_oldevasion(other.m_evasion)
, m_oldexpNext(other.m_expNext)
, m_oldexpTotal(other.m_expTotal)
, m_oldfile(other.m_file)
, m_oldlevelUp(other.m_levelUp)
, m_oldloadMessage(other.m_loadMessage)
, m_oldmagicEvasion(other.m_magicEvasion)
, m_oldmagicReflection(other.m_magicReflection)
, m_oldmeVolume(other.m_meVolume)
, m_oldobtainExp(other.m_obtainExp)
, m_oldobtainGold(other.m_obtainGold)
, m_oldobtainItem(other.m_obtainItem)
, m_oldobtainSkill(other.m_obtainSkill)
, m_oldpartyName(other.m_partyName)
, m_oldpossession(other.m_possession)
, m_oldpreemptive(other.m_preemptive)
, m_oldsaveMessage(other.m_saveMessage)
, m_oldseVolume(other.m_seVolume)
, m_oldsubstitute(other.m_substitute)
, m_oldsurprise(other.m_surprise)
, m_olduseItem(other.m_useItem)
, m_oldvictory(other.m_victory) {}
Messages& Messages::operator=(const Messages& other) {
  IModifiable::operator=(other);
  m_actionFailure = other.m_actionFailure;
  m_actorDamage = other.m_actorDamage;
  m_actorDrain = other.m_actorDrain;
  m_actorGain = other.m_actorGain;
  m_actorLoss = other.m_actorLoss;
  m_actorNoDamage = other.m_actorNoDamage;
  m_actorNoHit = other.m_actorNoHit;
  m_actorRecovery = other.m_actorRecovery;
  m_alwaysDash = other.m_alwaysDash;
  m_bgmVolume = other.m_bgmVolume;
  m_bgsVolume = other.m_bgsVolume;
  m_buffAdd = other.m_buffAdd;
  m_buffRemove = other.m_buffRemove;
  m_commandRemember = other.m_commandRemember;
  m_counterAttack = other.m_counterAttack;
  m_criticalToActor = other.m_criticalToActor;
  m_criticalToEnemy = other.m_criticalToEnemy;
  m_debuffAdd = other.m_debuffAdd;
  m_defeat = other.m_defeat;
  m_emerge = other.m_emerge;
  m_enemyDamage = other.m_enemyDamage;
  m_enemyDrain = other.m_enemyDrain;
  m_enemyGain = other.m_enemyGain;
  m_enemyLoss = other.m_enemyLoss;
  m_enemyNoDamage = other.m_enemyNoDamage;
  m_enemyNoHit = other.m_enemyNoHit;
  m_enemyRecovery = other.m_enemyRecovery;
  m_escapeFailure = other.m_escapeFailure;
  m_escapeStart = other.m_escapeStart;
  m_evasion = other.m_evasion;
  m_expNext = other.m_expNext;
  m_expTotal = other.m_expTotal;
  m_file = other.m_file;
  m_levelUp = other.m_levelUp;
  m_loadMessage = other.m_loadMessage;
  m_magicEvasion = other.m_magicEvasion;
  m_magicReflection = other.m_magicReflection;
  m_meVolume = other.m_meVolume;
  m_obtainExp = other.m_obtainExp;
  m_obtainGold = other.m_obtainGold;
  m_obtainItem = other.m_obtainItem;
  m_obtainSkill = other.m_obtainSkill;
  m_partyName = other.m_partyName;
  m_possession = other.m_possession;
  m_preemptive = other.m_preemptive;
  m_saveMessage = other.m_saveMessage;
  m_seVolume = other.m_seVolume;
  m_substitute = other.m_substitute;
  m_surprise = other.m_surprise;
  m_useItem = other.m_useItem;
  m_victory = other.m_victory;
  m_oldactionFailure = other.m_oldactionFailure;
  m_oldactorDamage = other.m_oldactorDamage;
  m_oldactorDrain = other.m_oldactorDrain;
  m_oldactorGain = other.m_oldactorGain;
  m_oldactorLoss = other.m_oldactorLoss;
  m_oldactorNoDamage = other.m_oldactorNoDamage;
  m_oldactorNoHit = other.m_oldactorNoHit;
  m_oldactorRecovery = other.m_oldactorRecovery;
  m_oldalwaysDash = other.m_oldalwaysDash;
  m_oldbgmVolume = other.m_oldbgmVolume;
  m_oldbgsVolume = other.m_oldbgsVolume;
  m_oldbuffAdd = other.m_oldbuffAdd;
  m_oldbuffRemove = other.m_oldbuffRemove;
  m_oldcommandRemember = other.m_oldcommandRemember;
  m_oldcounterAttack = other.m_oldcounterAttack;
  m_oldcriticalToActor = other.m_oldcriticalToActor;
  m_oldcriticalToEnemy = other.m_oldcriticalToEnemy;
  m_olddebuffAdd = other.m_olddebuffAdd;
  m_olddefeat = other.m_olddefeat;
  m_oldemerge = other.m_oldemerge;
  m_oldenemyDamage = other.m_oldenemyDamage;
  m_oldenemyDrain = other.m_oldenemyDrain;
  m_oldenemyGain = other.m_oldenemyGain;
  m_oldenemyLoss = other.m_oldenemyLoss;
  m_oldenemyNoDamage = other.m_oldenemyNoDamage;
  m_oldenemyNoHit = other.m_oldenemyNoHit;
  m_oldenemyRecovery = other.m_oldenemyRecovery;
  m_oldescapeFailure = other.m_oldescapeFailure;
  m_oldescapeStart = other.m_oldescapeStart;
  m_oldevasion = other.m_oldevasion;
  m_oldexpNext = other.m_oldexpNext;
  m_oldexpTotal = other.m_oldexpTotal;
  m_oldfile = other.m_oldfile;
  m_oldlevelUp = other.m_oldlevelUp;
  m_oldloadMessage = other.m_oldloadMessage;
  m_oldmagicEvasion = other.m_oldmagicEvasion;
  m_oldmagicReflection = other.m_oldmagicReflection;
  m_oldmeVolume = other.m_oldmeVolume;
  m_oldobtainExp = other.m_oldobtainExp;
  m_oldobtainGold = other.m_oldobtainGold;
  m_oldobtainItem = other.m_oldobtainItem;
  m_oldobtainSkill = other.m_oldobtainSkill;
  m_oldpartyName = other.m_oldpartyName;
  m_oldpossession = other.m_oldpossession;
  m_oldpreemptive = other.m_oldpreemptive;
  m_oldsaveMessage = other.m_oldsaveMessage;
  m_oldseVolume = other.m_oldseVolume;
  m_oldsubstitute = other.m_oldsubstitute;
  m_oldsurprise = other.m_oldsurprise;
  m_olduseItem = other.m_olduseItem;
  m_oldvictory = other.m_oldvictory;
  return *this;
}
Messages::Messages(Messages&& other) noexcept
: IModifiable(std::move(other))
, m_actionFailure(std::move(other.m_actionFailure))
, m_actorDamage(std::move(other.m_actorDamage))
, m_actorDrain(std::move(other.m_actorDrain))
, m_actorGain(std::move(other.m_actorGain))
, m_actorLoss(std::move(other.m_actorLoss))
, m_actorNoDamage(std::move(other.m_actorNoDamage))
, m_actorNoHit(std::move(other.m_actorNoHit))
, m_actorRecovery(std::move(other.m_actorRecovery))
, m_alwaysDash(std::move(other.m_alwaysDash))
, m_bgmVolume(std::move(other.m_bgmVolume))
, m_bgsVolume(std::move(other.m_bgsVolume))
, m_buffAdd(std::move(other.m_buffAdd))
, m_buffRemove(std::move(other.m_buffRemove))
, m_commandRemember(std::move(other.m_commandRemember))
, m_counterAttack(std::move(other.m_counterAttack))
, m_criticalToActor(std::move(other.m_criticalToActor))
, m_criticalToEnemy(std::move(other.m_criticalToEnemy))
, m_debuffAdd(std::move(other.m_debuffAdd))
, m_defeat(std::move(other.m_defeat))
, m_emerge(std::move(other.m_emerge))
, m_enemyDamage(std::move(other.m_enemyDamage))
, m_enemyDrain(std::move(other.m_enemyDrain))
, m_enemyGain(std::move(other.m_enemyGain))
, m_enemyLoss(std::move(other.m_enemyLoss))
, m_enemyNoDamage(std::move(other.m_enemyNoDamage))
, m_enemyNoHit(std::move(other.m_enemyNoHit))
, m_enemyRecovery(std::move(other.m_enemyRecovery))
, m_escapeFailure(std::move(other.m_escapeFailure))
, m_escapeStart(std::move(other.m_escapeStart))
, m_evasion(std::move(other.m_evasion))
, m_expNext(std::move(other.m_expNext))
, m_expTotal(std::move(other.m_expTotal))
, m_file(std::move(other.m_file))
, m_levelUp(std::move(other.m_levelUp))
, m_loadMessage(std::move(other.m_loadMessage))
, m_magicEvasion(std::move(other.m_magicEvasion))
, m_magicReflection(std::move(other.m_magicReflection))
, m_meVolume(std::move(other.m_meVolume))
, m_obtainExp(std::move(other.m_obtainExp))
, m_obtainGold(std::move(other.m_obtainGold))
, m_obtainItem(std::move(other.m_obtainItem))
, m_obtainSkill(std::move(other.m_obtainSkill))
, m_partyName(std::move(other.m_partyName))
, m_possession(std::move(other.m_possession))
, m_preemptive(std::move(other.m_preemptive))
, m_saveMessage(std::move(other.m_saveMessage))
, m_seVolume(std::move(other.m_seVolume))
, m_substitute(std::move(other.m_substitute))
, m_surprise(std::move(other.m_surprise))
, m_useItem(std::move(other.m_useItem))
, m_victory(std::move(other.m_victory))
, m_oldactionFailure(std::move(other.m_actionFailure))
, m_oldactorDamage(std::move(other.m_actorDamage))
, m_oldactorDrain(std::move(other.m_actorDrain))
, m_oldactorGain(std::move(other.m_actorGain))
, m_oldactorLoss(std::move(other.m_actorLoss))
, m_oldactorNoDamage(std::move(other.m_actorNoDamage))
, m_oldactorNoHit(std::move(other.m_actorNoHit))
, m_oldactorRecovery(std::move(other.m_actorRecovery))
, m_oldalwaysDash(std::move(other.m_alwaysDash))
, m_oldbgmVolume(std::move(other.m_bgmVolume))
, m_oldbgsVolume(std::move(other.m_bgsVolume))
, m_oldbuffAdd(std::move(other.m_buffAdd))
, m_oldbuffRemove(std::move(other.m_buffRemove))
, m_oldcommandRemember(std::move(other.m_commandRemember))
, m_oldcounterAttack(std::move(other.m_counterAttack))
, m_oldcriticalToActor(std::move(other.m_criticalToActor))
, m_oldcriticalToEnemy(std::move(other.m_criticalToEnemy))
, m_olddebuffAdd(std::move(other.m_debuffAdd))
, m_olddefeat(std::move(other.m_defeat))
, m_oldemerge(std::move(other.m_emerge))
, m_oldenemyDamage(std::move(other.m_enemyDamage))
, m_oldenemyDrain(std::move(other.m_enemyDrain))
, m_oldenemyGain(std::move(other.m_enemyGain))
, m_oldenemyLoss(std::move(other.m_enemyLoss))
, m_oldenemyNoDamage(std::move(other.m_enemyNoDamage))
, m_oldenemyNoHit(std::move(other.m_enemyNoHit))
, m_oldenemyRecovery(std::move(other.m_enemyRecovery))
, m_oldescapeFailure(std::move(other.m_escapeFailure))
, m_oldescapeStart(std::move(other.m_escapeStart))
, m_oldevasion(std::move(other.m_evasion))
, m_oldexpNext(std::move(other.m_expNext))
, m_oldexpTotal(std::move(other.m_expTotal))
, m_oldfile(std::move(other.m_file))
, m_oldlevelUp(std::move(other.m_levelUp))
, m_oldloadMessage(std::move(other.m_loadMessage))
, m_oldmagicEvasion(std::move(other.m_magicEvasion))
, m_oldmagicReflection(std::move(other.m_magicReflection))
, m_oldmeVolume(std::move(other.m_meVolume))
, m_oldobtainExp(std::move(other.m_obtainExp))
, m_oldobtainGold(std::move(other.m_obtainGold))
, m_oldobtainItem(std::move(other.m_obtainItem))
, m_oldobtainSkill(std::move(other.m_obtainSkill))
, m_oldpartyName(std::move(other.m_partyName))
, m_oldpossession(std::move(other.m_possession))
, m_oldpreemptive(std::move(other.m_preemptive))
, m_oldsaveMessage(std::move(other.m_saveMessage))
, m_oldseVolume(std::move(other.m_seVolume))
, m_oldsubstitute(std::move(other.m_substitute))
, m_oldsurprise(std::move(other.m_surprise))
, m_olduseItem(std::move(other.m_useItem))
, m_oldvictory(std::move(other.m_victory)) {}

Messages& Messages::operator=(Messages&& other) noexcept {
  IModifiable::operator=(std::move(other));
  m_actionFailure = std::move(other.m_actionFailure);
  m_actorDamage = std::move(other.m_actorDamage);
  m_actorDrain = std::move(other.m_actorDrain);
  m_actorGain = std::move(other.m_actorGain);
  m_actorLoss = std::move(other.m_actorLoss);
  m_actorNoDamage = std::move(other.m_actorNoDamage);
  m_actorNoHit = std::move(other.m_actorNoHit);
  m_actorRecovery = std::move(other.m_actorRecovery);
  m_alwaysDash = std::move(other.m_alwaysDash);
  m_bgmVolume = std::move(other.m_bgmVolume);
  m_bgsVolume = std::move(other.m_bgsVolume);
  m_buffAdd = std::move(other.m_buffAdd);
  m_buffRemove = std::move(other.m_buffRemove);
  m_commandRemember = std::move(other.m_commandRemember);
  m_counterAttack = std::move(other.m_counterAttack);
  m_criticalToActor = std::move(other.m_criticalToActor);
  m_criticalToEnemy = std::move(other.m_criticalToEnemy);
  m_debuffAdd = std::move(other.m_debuffAdd);
  m_defeat = std::move(other.m_defeat);
  m_emerge = std::move(other.m_emerge);
  m_enemyDamage = std::move(other.m_enemyDamage);
  m_enemyDrain = std::move(other.m_enemyDrain);
  m_enemyGain = std::move(other.m_enemyGain);
  m_enemyLoss = std::move(other.m_enemyLoss);
  m_enemyNoDamage = std::move(other.m_enemyNoDamage);
  m_enemyNoHit = std::move(other.m_enemyNoHit);
  m_enemyRecovery = std::move(other.m_enemyRecovery);
  m_escapeFailure = std::move(other.m_escapeFailure);
  m_escapeStart = std::move(other.m_escapeStart);
  m_evasion = std::move(other.m_evasion);
  m_expNext = std::move(other.m_expNext);
  m_expTotal = std::move(other.m_expTotal);
  m_file = std::move(other.m_file);
  m_levelUp = std::move(other.m_levelUp);
  m_loadMessage = std::move(other.m_loadMessage);
  m_magicEvasion = std::move(other.m_magicEvasion);
  m_magicReflection = std::move(other.m_magicReflection);
  m_meVolume = std::move(other.m_meVolume);
  m_obtainExp = std::move(other.m_obtainExp);
  m_obtainGold = std::move(other.m_obtainGold);
  m_obtainItem = std::move(other.m_obtainItem);
  m_obtainSkill = std::move(other.m_obtainSkill);
  m_partyName = std::move(other.m_partyName);
  m_possession = std::move(other.m_possession);
  m_preemptive = std::move(other.m_preemptive);
  m_saveMessage = std::move(other.m_saveMessage);
  m_seVolume = std::move(other.m_seVolume);
  m_substitute = std::move(other.m_substitute);
  m_surprise = std::move(other.m_surprise);
  m_useItem = std::move(other.m_useItem);
  m_victory = std::move(other.m_victory);
  m_oldactionFailure = std::move(other.m_oldactionFailure);
  m_oldactorDamage = std::move(other.m_oldactorDamage);
  m_oldactorDrain = std::move(other.m_oldactorDrain);
  m_oldactorGain = std::move(other.m_oldactorGain);
  m_oldactorLoss = std::move(other.m_oldactorLoss);
  m_oldactorNoDamage = std::move(other.m_oldactorNoDamage);
  m_oldactorNoHit = std::move(other.m_oldactorNoHit);
  m_oldactorRecovery = std::move(other.m_oldactorRecovery);
  m_oldalwaysDash = std::move(other.m_oldalwaysDash);
  m_oldbgmVolume = std::move(other.m_oldbgmVolume);
  m_oldbgsVolume = std::move(other.m_oldbgsVolume);
  m_oldbuffAdd = std::move(other.m_oldbuffAdd);
  m_oldbuffRemove = std::move(other.m_oldbuffRemove);
  m_oldcommandRemember = std::move(other.m_oldcommandRemember);
  m_oldcounterAttack = std::move(other.m_oldcounterAttack);
  m_oldcriticalToActor = std::move(other.m_oldcriticalToActor);
  m_oldcriticalToEnemy = std::move(other.m_oldcriticalToEnemy);
  m_olddebuffAdd = std::move(other.m_olddebuffAdd);
  m_olddefeat = std::move(other.m_olddefeat);
  m_oldemerge = std::move(other.m_oldemerge);
  m_oldenemyDamage = std::move(other.m_oldenemyDamage);
  m_oldenemyDrain = std::move(other.m_oldenemyDrain);
  m_oldenemyGain = std::move(other.m_oldenemyGain);
  m_oldenemyLoss = std::move(other.m_oldenemyLoss);
  m_oldenemyNoDamage = std::move(other.m_oldenemyNoDamage);
  m_oldenemyNoHit = std::move(other.m_oldenemyNoHit);
  m_oldenemyRecovery = std::move(other.m_oldenemyRecovery);
  m_oldescapeFailure = std::move(other.m_oldescapeFailure);
  m_oldescapeStart = std::move(other.m_oldescapeStart);
  m_oldevasion = std::move(other.m_oldevasion);
  m_oldexpNext = std::move(other.m_oldexpNext);
  m_oldexpTotal = std::move(other.m_oldexpTotal);
  m_oldfile = std::move(other.m_oldfile);
  m_oldlevelUp = std::move(other.m_oldlevelUp);
  m_oldloadMessage = std::move(other.m_oldloadMessage);
  m_oldmagicEvasion = std::move(other.m_oldmagicEvasion);
  m_oldmagicReflection = std::move(other.m_oldmagicReflection);
  m_oldmeVolume = std::move(other.m_oldmeVolume);
  m_oldobtainExp = std::move(other.m_oldobtainExp);
  m_oldobtainGold = std::move(other.m_oldobtainGold);
  m_oldobtainItem = std::move(other.m_oldobtainItem);
  m_oldobtainSkill = std::move(other.m_oldobtainSkill);
  m_oldpartyName = std::move(other.m_oldpartyName);
  m_oldpossession = std::move(other.m_oldpossession);
  m_oldpreemptive = std::move(other.m_oldpreemptive);
  m_oldsaveMessage = std::move(other.m_oldsaveMessage);
  m_oldseVolume = std::move(other.m_oldseVolume);
  m_oldsubstitute = std::move(other.m_oldsubstitute);
  m_oldsurprise = std::move(other.m_oldsurprise);
  m_olduseItem = std::move(other.m_olduseItem);
  m_oldvictory = std::move(other.m_oldvictory);
  return *this;
}

const std::string& Messages::actionFailure() { return m_actionFailure; }
void Messages::setActionFailure(const std::string& value) {
  if (m_actionFailure == value) {
    return;
  }
  MODIFIABLE_SET_OLD_VALUE(actionFailure);
  if (!signalsDisabled()) {
  emit_signal(actionFailureModified(), this, value);
  }
  setModified();
}
const std::string& Messages::actorDamage() { return m_actorDamage; }
void Messages::setActorDamage(const std::string& value) {
  if (m_actorDamage == value) {
    return;
  }
  MODIFIABLE_SET_OLD_VALUE(actorDamage);
  m_actorDamage = value;
  if (!signalsDisabled()) {
  emit_signal(actorDamageModified(), this, value);
  }
  setModified();
}
const std::string& Messages::actorDrain() { return m_actorDrain; }
void Messages::setActorDrain(const std::string& value) {
  if (m_actorDrain == value) {
    return;
  }
  MODIFIABLE_SET_OLD_VALUE(actorDrain);
  m_actorDrain = value;
  if (!signalsDisabled()) {
  emit_signal(actorDrainModified(), this, value);
  }
  setModified();
}
const std::string& Messages::actorGain() { return m_actorGain; }
void Messages::setActorGain(const std::string& value) {
  if (m_actorGain == value) {
    return;
  }
  MODIFIABLE_SET_OLD_VALUE(actorGain);
  m_actorGain = value;
  if (!signalsDisabled()) {
  emit_signal(actorGainModified(), this, value);
  }
  setModified();
}
const std::string& Messages::actorLoss() { return m_actorLoss; }
void Messages::setActorLoss(const std::string& value) {
  if (m_actorLoss == value) {
    return;
  }
  MODIFIABLE_SET_OLD_VALUE(actorLoss);
  m_actorLoss = value;
  if (!signalsDisabled()) {
  emit_signal(actorLossModified(), this, value);
  }
  setModified();
}
const std::string& Messages::actorNoDamage() { return m_actorNoDamage; }
void Messages::setActorNoDamage(const std::string& value) {
  if (m_actorNoDamage == value) {
    return;
  }
  MODIFIABLE_SET_OLD_VALUE(actorNoDamage);
  m_actorNoDamage = value;
  if (!signalsDisabled()) {
  emit_signal(actorNoDamageModified(), this, value);
  }
  setModified();
}
const std::string& Messages::actorNoHit() { return m_actorNoHit; }
void Messages::setActorNoHit(const std::string& value) {
  if (m_actorNoHit == value) {
    return;
  }
  MODIFIABLE_SET_OLD_VALUE(actorNoHit);
  m_actorNoHit = value;
  if (!signalsDisabled()) {
  emit_signal(actorNoHitModified(), this, value);
  }
  setModified();
}
const std::string& Messages::actorRecovery() { return m_actorRecovery; }
void Messages::setActorRecovery(const std::string& value) {
  if (m_actorRecovery == value) {
    return;
  }
  MODIFIABLE_SET_OLD_VALUE(actorRecovery);
  m_actorRecovery = value;
  if (!signalsDisabled()) {
  emit_signal(actorRecoveryModified(), this, value);
  }
  setModified();
}
const std::string& Messages::alwaysDash() { return m_alwaysDash; }
void Messages::setAlwaysDash(const std::string& value) {
  if (m_alwaysDash == value) {
    return;
  }
  MODIFIABLE_SET_OLD_VALUE(alwaysDash);
  m_alwaysDash = value;
  if (!signalsDisabled()) {
  emit_signal(alwaysDashModified(), this, value);
  }
  setModified();
}
const std::string& Messages::bgmVolume() { return m_bgmVolume; }
void Messages::setBgmVolume(const std::string& value) {
  if (m_bgmVolume == value) {
    return;
  }
  MODIFIABLE_SET_OLD_VALUE(bgmVolume);
  m_bgmVolume = value;
  if (!signalsDisabled()) {
  emit_signal(bgmVolumeModified(), this, value);
  }
  setModified();
}
const std::string& Messages::bgsVolume() { return m_bgsVolume; }
void Messages::setBgsVolume(const std::string& value) {
  if (m_bgsVolume == value) {
    return;
  }
  MODIFIABLE_SET_OLD_VALUE(bgsVolume);
  m_bgsVolume = value;
  if (!signalsDisabled()) {
  emit_signal(bgsVolumeModified(), this, value);
  }
  setModified();
}
const std::string& Messages::buffAdd() { return m_buffAdd; }
void Messages::setBuffAdd(const std::string& value) {
  if (m_buffAdd == value) {
    return;
  }
  MODIFIABLE_SET_OLD_VALUE(buffAdd);
  m_buffAdd = value;
  if (!signalsDisabled()) {
  emit_signal(buffAddModified(), this, value);
  }
  setModified();
}
const std::string& Messages::buffRemove() { return m_buffRemove; }
void Messages::setBuffRemove(const std::string& value) {
  if (m_buffRemove == value) {
    return;
  }
  MODIFIABLE_SET_OLD_VALUE(buffRemove);
  m_buffRemove = value;
  if (!signalsDisabled()) {
  emit_signal(buffRemoveModified(), this, value);
  }
  setModified();
}
const std::string& Messages::commandRemember() { return m_commandRemember; }
void Messages::setCommandRemember(const std::string& value) {
  if (m_commandRemember == value) {
    return;
  }
  MODIFIABLE_SET_OLD_VALUE(commandRemember);
  m_commandRemember = value;
  if (!signalsDisabled()) {
  emit_signal(commandRememberModified(), this, value);
  }
  setModified();
}
const std::string& Messages::counterAttack() { return m_counterAttack; }
void Messages::setCounterAttack(const std::string& value) {
  if (m_counterAttack == value) {
    return;
  }
  MODIFIABLE_SET_OLD_VALUE(counterAttack);
  m_counterAttack = value;
  if (!signalsDisabled()) {
  emit_signal(counterAttackModified(), this, value);
  }
  setModified();
}
const std::string& Messages::criticalToActor() { return m_criticalToActor; }
void Messages::setCriticalToActor(const std::string& value) {
  if (m_criticalToActor == value) {
    return;
  }
  MODIFIABLE_SET_OLD_VALUE(criticalToActor);
  m_criticalToActor = value;
  if (!signalsDisabled()) {
  emit_signal(criticalToActorModified(), this, value);
  }
  setModified();
}
const std::string& Messages::criticalToEnemy() { return m_criticalToEnemy; }
void Messages::setCriticalToEnemy(const std::string& value) {
  if (m_criticalToEnemy == value) {
    return;
  }
  MODIFIABLE_SET_OLD_VALUE(criticalToEnemy);
  m_criticalToEnemy = value;
  if (!signalsDisabled()) {
  emit_signal(criticalToEnemyModified(), this, value);
  }
  setModified();
}
const std::string& Messages::debuffAdd() { return m_debuffAdd; }
void Messages::setDebuffAdd(const std::string& value) {
  if (m_debuffAdd == value) {
    return;
  }
  MODIFIABLE_SET_OLD_VALUE(debuffAdd);
  m_debuffAdd = value;
  if (!signalsDisabled()) {
  emit_signal(debuffAddModified(), this, value);
  }
  setModified();
}
const std::string& Messages::defeat() { return m_defeat; }
void Messages::setDefeat(const std::string& value) {
  if (m_defeat == value) {
    return;
  }
  MODIFIABLE_SET_OLD_VALUE(defeat);
  m_defeat = value;
  if (!signalsDisabled()) {
  emit_signal(defeatModified(), this, value);
  }
  setModified();
}
const std::string& Messages::emerge() { return m_emerge; }
void Messages::setEmerge(const std::string& value) {
  if (m_emerge == value) {
    return;
  }
  MODIFIABLE_SET_OLD_VALUE(emerge);
  m_emerge = value;
  if (!signalsDisabled()) {
  emit_signal(emergeModified(), this, value);
  }
  setModified();
}
const std::string& Messages::enemyDamage() { return m_enemyDamage; }
void Messages::setEnemyDamage(const std::string& value) {
  if (m_enemyDamage == value) {
    return;
  }
  MODIFIABLE_SET_OLD_VALUE(enemyDamage);
  m_enemyDamage = value;
  if (!signalsDisabled()) {
  emit_signal(enemyDamageModified(), this, value);
  }
  setModified();
}
const std::string& Messages::enemyDrain() { return m_enemyDrain; }
void Messages::setEnemyDrain(const std::string& value) {
  if (m_enemyDrain == value) {
    return;
  }
  MODIFIABLE_SET_OLD_VALUE(enemyDrain);
  m_enemyDrain = value;
  if (!signalsDisabled()) {
  emit_signal(enemyDrainModified(), this, value);
  }
  setModified();
}
const std::string& Messages::enemyGain() { return m_enemyGain; }
void Messages::setEnemyGain(const std::string& value) {
  if (m_enemyGain == value) {
    return;
  }
  MODIFIABLE_SET_OLD_VALUE(enemyGain);
  m_enemyGain = value;
  if (!signalsDisabled()) {
  emit_signal(enemyGainModified(), this, value);
  }
  setModified();
}
const std::string& Messages::enemyLoss() { return m_enemyLoss; }
void Messages::setEnemyLoss(const std::string& value) {
  if (m_enemyLoss == value) {
    return;
  }
  MODIFIABLE_SET_OLD_VALUE(enemyLoss);
  m_enemyLoss = value;
  if (!signalsDisabled()) {
  emit_signal(enemyLossModified(), this, value);
  }
  setModified();
}
const std::string& Messages::enemyNoDamage() { return m_enemyNoDamage; }
void Messages::setEnemyNoDamage(const std::string& value) {
  if (m_enemyNoDamage == value) {
    return;
  }
  MODIFIABLE_SET_OLD_VALUE(enemyNoDamage);
  m_enemyNoDamage = value;
  if (!signalsDisabled()) {
  emit_signal(enemyNoDamageModified(), this, value);
  }
  setModified();
}
const std::string& Messages::enemyNoHit() { return m_enemyNoHit; }
void Messages::setEnemyNoHit(const std::string& value) {
  if (m_enemyNoHit == value) {
    return;
  }
  MODIFIABLE_SET_OLD_VALUE(enemyNoHit);
  m_enemyNoHit = value;
  if (!signalsDisabled()) {
  emit_signal(enemyNoHitModified(), this, value);
  }
  setModified();
}
const std::string& Messages::enemyRecovery() { return m_enemyRecovery; }
void Messages::setEnemyRecovery(const std::string& value) {
  if (m_enemyRecovery == value) {
    return;
  }
  MODIFIABLE_SET_OLD_VALUE(enemyRecovery);
  m_enemyRecovery = value;
  if (!signalsDisabled()) {
  emit_signal(enemyRecoveryModified(), this, value);
  }
  setModified();
}
const std::string& Messages::escapeFailure() { return m_escapeFailure; }
void Messages::setEscapeFailure(const std::string& value) {
  if (m_escapeFailure == value) {
    return;
  }
  MODIFIABLE_SET_OLD_VALUE(escapeFailure);
  m_escapeFailure = value;
  if (!signalsDisabled()) {
  emit_signal(escapeFailureModified(), this, value);
  }
  setModified();
}
const std::string& Messages::escapeStart() { return m_escapeStart; }
void Messages::setEscapeStart(const std::string& value) {
  if (m_escapeStart == value) {
    return;
  }
  MODIFIABLE_SET_OLD_VALUE(escapeStart);
  m_escapeStart = value;
  if (!signalsDisabled()) {
  emit_signal(escapeStartModified(), this, value);
  }
  setModified();
}
const std::string& Messages::evasion() { return m_evasion; }
void Messages::setEvasion(const std::string& value) {
  if (m_evasion == value) {
    return;
  }
  MODIFIABLE_SET_OLD_VALUE(evasion);
  m_evasion = value;
  if (!signalsDisabled()) {
  emit_signal(evasionModified(), this, value);
  }
  setModified();
}
const std::string& Messages::expNext() { return m_expNext; }
void Messages::setExpNext(const std::string& value) {
  if (m_expNext == value) {
    return;
  }
  MODIFIABLE_SET_OLD_VALUE(expNext);
  m_expNext = value;
  if (!signalsDisabled()) {
  emit_signal(expNextModified(), this, value);
  }
  setModified();
}
const std::string& Messages::expTotal() { return m_expTotal; }
void Messages::setExpTotal(const std::string& value) {
  if (m_expTotal == value) {
    return;
  }
  MODIFIABLE_SET_OLD_VALUE(expTotal);
  m_expTotal = value;
  if (!signalsDisabled()) {
  emit_signal(expTotalModified(), this, value);
  }
  setModified();
}
const std::string& Messages::file() { return m_file; }
void Messages::setFile(const std::string& value) {
  if (m_file == value) {
    return;
  }
  MODIFIABLE_SET_OLD_VALUE(file);
  m_file = value;
  if (!signalsDisabled()) {
  emit_signal(fileModified(), this, value);
  }
  setModified();
}
const std::string& Messages::levelUp() { return m_levelUp; }
void Messages::setLevelUp(const std::string& value) {
  if (m_levelUp == value) {
    return;
  }
  MODIFIABLE_SET_OLD_VALUE(levelUp);
  m_levelUp = value;
  if (!signalsDisabled()) {
  emit_signal(levelUpModified(), this, value);
  }
  setModified();
}
const std::string& Messages::loadMessage() { return m_loadMessage; }
void Messages::setLoadMessage(const std::string& value) {
  if (m_loadMessage == value) {
    return;
  }
  MODIFIABLE_SET_OLD_VALUE(loadMessage);
  m_loadMessage = value;
  if (!signalsDisabled()) {
  emit_signal(loadMessageModified(), this, value);
  }
  setModified();
}
const std::string& Messages::magicEvasion() { return m_magicEvasion; }
void Messages::setMagicEvasion(const std::string& value) {
  if (m_magicEvasion == value) {
    return;
  }
  MODIFIABLE_SET_OLD_VALUE(magicEvasion);
  m_magicEvasion = value;
  if (!signalsDisabled()) {
  emit_signal(magicEvasionModified(), this, value);
  }
  setModified();
}
const std::string& Messages::magicReflection() { return m_magicReflection; }
void Messages::setMagicReflection(const std::string& value) {
  if (m_magicReflection == value) {
    return;
  }
  MODIFIABLE_SET_OLD_VALUE(magicReflection);
  m_magicReflection = value;
  if (!signalsDisabled()) {
  emit_signal(magicReflectionModified(), this, value);
  }
  setModified();
}
const std::string& Messages::meVolume() { return m_meVolume; }
void Messages::setMeVolume(const std::string& value) {
  if (m_meVolume == value) {
    return;
  }
  MODIFIABLE_SET_OLD_VALUE(meVolume);
  m_meVolume = value;
  if (!signalsDisabled()) {
  emit_signal(meVolumeModified(), this, value);
  }
  setModified();
}
const std::string& Messages::obtainExp() { return m_obtainExp; }
void Messages::setObtainExp(const std::string& value) {
  if (m_obtainExp == value) {
    return;
  }
  MODIFIABLE_SET_OLD_VALUE(obtainExp);
  m_obtainExp = value;
  if (!signalsDisabled()) {
  emit_signal(obtainExpModified(), this, value);
  }
  setModified();
}
const std::string& Messages::obtainGold() { return m_obtainGold; }
void Messages::setObtainGold(const std::string& value) {
  if (m_obtainGold == value) {
    return;
  }
  MODIFIABLE_SET_OLD_VALUE(obtainGold);
  m_obtainGold = value;
  if (!signalsDisabled()) {
  emit_signal(obtainGoldModified(), this, value);
  }
  setModified();
}
const std::string& Messages::obtainItem() { return m_obtainItem; }
void Messages::setObtainItem(const std::string& value) {
  if (m_obtainItem == value) {
    return;
  }
  MODIFIABLE_SET_OLD_VALUE(obtainItem);
  m_obtainItem = value;
  if (!signalsDisabled()) {
  emit_signal(obtainItemModified(), this, value);
  }
  setModified();
}
const std::string& Messages::obtainSkill() { return m_obtainSkill; }
void Messages::setObtainSkill(const std::string& value) {
  if (m_obtainSkill == value) {
    return;
  }
  MODIFIABLE_SET_OLD_VALUE(obtainSkill);
  m_obtainSkill = value;
  if (!signalsDisabled()) {
  emit_signal(obtainSkillModified(), this, value);
  }
  setModified();
}
const std::string& Messages::partyName() { return m_partyName; }
void Messages::setPartyName(const std::string& value) {
  if (m_partyName == value) {
    return;
  }
  MODIFIABLE_SET_OLD_VALUE(partyName);
  m_partyName = value;
  if (!signalsDisabled()) {
  emit_signal(partyNameModified(), this, value);
  }
  setModified();
}
const std::string& Messages::possession() { return m_possession; }
void Messages::setPossession(const std::string& value) {
  if (m_possession == value) {
    return;
  }
  MODIFIABLE_SET_OLD_VALUE(possession);
  m_possession = value;
  if (!signalsDisabled()) {
  emit_signal(possessionModified(), this, value);
  }
  setModified();
}
const std::string& Messages::preemptive() { return m_preemptive; }
void Messages::setPreemptive(const std::string& value) {
  if (m_preemptive == value) {
    return;
  }
  MODIFIABLE_SET_OLD_VALUE(preemptive);
  m_preemptive = value;
  if (!signalsDisabled()) {
  emit_signal(preemptiveModified(), this, value);
  }
  setModified();
}
const std::string& Messages::saveMessage() { return m_saveMessage; }
void Messages::setSaveMessage(const std::string& value) {
  if (m_saveMessage == value) {
    return;
  }
  MODIFIABLE_SET_OLD_VALUE(saveMessage);
  m_saveMessage = value;
  if (!signalsDisabled()) {
  emit_signal(saveMessageModified(), this, value);
  }
  setModified();
}
const std::string& Messages::seVolume() { return m_seVolume; }
void Messages::setSeVolume(const std::string& value) {
  if (m_seVolume == value) {
    return;
  }
  MODIFIABLE_SET_OLD_VALUE(seVolume);
  m_seVolume = value;
  if (!signalsDisabled()) {
  emit_signal(seVolumeModified(), this, value);
  }
  setModified();
}
const std::string& Messages::substitute() { return m_substitute; }
void Messages::setSubstitute(const std::string& value) {
  if (m_substitute == value) {
    return;
  }
  MODIFIABLE_SET_OLD_VALUE(substitute);
  m_substitute = value;
  if (!signalsDisabled()) {
  emit_signal(substituteModified(), this, value);
  }
  setModified();
}
const std::string& Messages::surprise() { return m_surprise; }
void Messages::setSurprise(const std::string& value) {
  if (m_surprise == value) {
    return;
  }
  MODIFIABLE_SET_OLD_VALUE(surprise);
  m_surprise = value;
  if (!signalsDisabled()) {
  emit_signal(surpriseModified(), this, value);
  }
  setModified();
}
const std::string& Messages::useItem() { return m_useItem; }
void Messages::setUseItem(const std::string& value) {
  if (m_useItem == value) {
    return;
  }
  MODIFIABLE_SET_OLD_VALUE(useItem);
  m_useItem = value;
  if (!signalsDisabled()) {
  emit_signal(useItemModified(), this, value);
  }
  setModified();
}
const std::string& Messages::victory() { return m_victory; }
void Messages::setVictory(const std::string& value) {
  if (m_victory == value) {
    return;
  }
  MODIFIABLE_SET_OLD_VALUE(victory);
  m_victory = value;
  if (!signalsDisabled()) {
  emit_signal(victoryModified(), this, value);
  }
  setModified();
}

void Messages::restoreOriginal() {
  IModifiable::restoreOriginal();
  MODIFIABLE_SET_OLD_VALUE(actionFailure);
  MODIFIABLE_SET_OLD_VALUE(actorDamage);
  MODIFIABLE_SET_OLD_VALUE(actorDrain);
  MODIFIABLE_SET_OLD_VALUE(actorGain);
  MODIFIABLE_SET_OLD_VALUE(actorLoss);
  MODIFIABLE_SET_OLD_VALUE(actorNoDamage);
  MODIFIABLE_SET_OLD_VALUE(actorNoHit);
  MODIFIABLE_SET_OLD_VALUE(actorRecovery);
  MODIFIABLE_SET_OLD_VALUE(alwaysDash);
  MODIFIABLE_SET_OLD_VALUE(bgmVolume);
  MODIFIABLE_SET_OLD_VALUE(bgsVolume);
  MODIFIABLE_SET_OLD_VALUE(buffAdd);
  MODIFIABLE_SET_OLD_VALUE(buffRemove);
  MODIFIABLE_SET_OLD_VALUE(commandRemember);
  MODIFIABLE_SET_OLD_VALUE(counterAttack);
  MODIFIABLE_SET_OLD_VALUE(criticalToActor);
  MODIFIABLE_SET_OLD_VALUE(criticalToEnemy);
  MODIFIABLE_SET_OLD_VALUE(debuffAdd);
  MODIFIABLE_SET_OLD_VALUE(defeat);
  MODIFIABLE_SET_OLD_VALUE(emerge);
  MODIFIABLE_SET_OLD_VALUE(enemyDamage);
  MODIFIABLE_SET_OLD_VALUE(enemyDrain);
  MODIFIABLE_SET_OLD_VALUE(enemyGain);
  MODIFIABLE_SET_OLD_VALUE(enemyLoss);
  MODIFIABLE_SET_OLD_VALUE(enemyNoDamage);
  MODIFIABLE_SET_OLD_VALUE(enemyNoHit);
  MODIFIABLE_SET_OLD_VALUE(enemyRecovery);
  MODIFIABLE_SET_OLD_VALUE(escapeFailure);
  MODIFIABLE_SET_OLD_VALUE(escapeStart);
  MODIFIABLE_SET_OLD_VALUE(evasion);
  MODIFIABLE_SET_OLD_VALUE(expNext);
  MODIFIABLE_SET_OLD_VALUE(expTotal);
  MODIFIABLE_SET_OLD_VALUE(file);
  MODIFIABLE_SET_OLD_VALUE(levelUp);
  MODIFIABLE_SET_OLD_VALUE(loadMessage);
  MODIFIABLE_SET_OLD_VALUE(magicEvasion);
  MODIFIABLE_SET_OLD_VALUE(magicReflection);
  MODIFIABLE_SET_OLD_VALUE(meVolume);
  MODIFIABLE_SET_OLD_VALUE(obtainExp);
  MODIFIABLE_SET_OLD_VALUE(obtainGold);
  MODIFIABLE_SET_OLD_VALUE(obtainItem);
  MODIFIABLE_SET_OLD_VALUE(obtainSkill);
  MODIFIABLE_SET_OLD_VALUE(partyName);
  MODIFIABLE_SET_OLD_VALUE(possession);
  MODIFIABLE_SET_OLD_VALUE(preemptive);
  MODIFIABLE_SET_OLD_VALUE(saveMessage);
  MODIFIABLE_SET_OLD_VALUE(seVolume);
  MODIFIABLE_SET_OLD_VALUE(substitute);
  MODIFIABLE_SET_OLD_VALUE(surprise);
  MODIFIABLE_SET_OLD_VALUE(useItem);
  MODIFIABLE_SET_OLD_VALUE(victory);
}
void Messages::acceptChanges() {
  IModifiable::acceptChanges();
  MODIFIABLE_ACCEPT_VALUE(actionFailure);
  MODIFIABLE_ACCEPT_VALUE(actorDamage);
  MODIFIABLE_ACCEPT_VALUE(actorDrain);
  MODIFIABLE_ACCEPT_VALUE(actorGain);
  MODIFIABLE_ACCEPT_VALUE(actorLoss);
  MODIFIABLE_ACCEPT_VALUE(actorNoDamage);
  MODIFIABLE_ACCEPT_VALUE(actorNoHit);
  MODIFIABLE_ACCEPT_VALUE(actorRecovery);
  MODIFIABLE_ACCEPT_VALUE(alwaysDash);
  MODIFIABLE_ACCEPT_VALUE(bgmVolume);
  MODIFIABLE_ACCEPT_VALUE(bgsVolume);
  MODIFIABLE_ACCEPT_VALUE(buffAdd);
  MODIFIABLE_ACCEPT_VALUE(buffRemove);
  MODIFIABLE_ACCEPT_VALUE(commandRemember);
  MODIFIABLE_ACCEPT_VALUE(counterAttack);
  MODIFIABLE_ACCEPT_VALUE(criticalToActor);
  MODIFIABLE_ACCEPT_VALUE(criticalToEnemy);
  MODIFIABLE_ACCEPT_VALUE(debuffAdd);
  MODIFIABLE_ACCEPT_VALUE(defeat);
  MODIFIABLE_ACCEPT_VALUE(emerge);
  MODIFIABLE_ACCEPT_VALUE(enemyDamage);
  MODIFIABLE_ACCEPT_VALUE(enemyDrain);
  MODIFIABLE_ACCEPT_VALUE(enemyGain);
  MODIFIABLE_ACCEPT_VALUE(enemyLoss);
  MODIFIABLE_ACCEPT_VALUE(enemyNoDamage);
  MODIFIABLE_ACCEPT_VALUE(enemyNoHit);
  MODIFIABLE_ACCEPT_VALUE(enemyRecovery);
  MODIFIABLE_ACCEPT_VALUE(escapeFailure);
  MODIFIABLE_ACCEPT_VALUE(escapeStart);
  MODIFIABLE_ACCEPT_VALUE(evasion);
  MODIFIABLE_ACCEPT_VALUE(expNext);
  MODIFIABLE_ACCEPT_VALUE(expTotal);
  MODIFIABLE_ACCEPT_VALUE(file);
  MODIFIABLE_ACCEPT_VALUE(levelUp);
  MODIFIABLE_ACCEPT_VALUE(loadMessage);
  MODIFIABLE_ACCEPT_VALUE(magicEvasion);
  MODIFIABLE_ACCEPT_VALUE(magicReflection);
  MODIFIABLE_ACCEPT_VALUE(meVolume);
  MODIFIABLE_ACCEPT_VALUE(obtainExp);
  MODIFIABLE_ACCEPT_VALUE(obtainGold);
  MODIFIABLE_ACCEPT_VALUE(obtainItem);
  MODIFIABLE_ACCEPT_VALUE(obtainSkill);
  MODIFIABLE_ACCEPT_VALUE(partyName);
  MODIFIABLE_ACCEPT_VALUE(possession);
  MODIFIABLE_ACCEPT_VALUE(preemptive);
  MODIFIABLE_ACCEPT_VALUE(saveMessage);
  MODIFIABLE_ACCEPT_VALUE(seVolume);
  MODIFIABLE_ACCEPT_VALUE(substitute);
  MODIFIABLE_ACCEPT_VALUE(surprise);
  MODIFIABLE_ACCEPT_VALUE(useItem);
  MODIFIABLE_ACCEPT_VALUE(victory);
}
nlohmann::ordered_json Messages::serializeOldValues() const {
  return {
      MODIFIABLE_SERIALIZE_VALUE(actionFailure),   MODIFIABLE_SERIALIZE_VALUE(actorDamage),     MODIFIABLE_SERIALIZE_VALUE(actorDrain),
      MODIFIABLE_SERIALIZE_VALUE(actorGain),       MODIFIABLE_SERIALIZE_VALUE(actorLoss),       MODIFIABLE_SERIALIZE_VALUE(actorNoDamage),
      MODIFIABLE_SERIALIZE_VALUE(actorNoHit),      MODIFIABLE_SERIALIZE_VALUE(actorRecovery),   MODIFIABLE_SERIALIZE_VALUE(alwaysDash),
      MODIFIABLE_SERIALIZE_VALUE(bgmVolume),       MODIFIABLE_SERIALIZE_VALUE(bgsVolume),       MODIFIABLE_SERIALIZE_VALUE(buffAdd),
      MODIFIABLE_SERIALIZE_VALUE(buffRemove),      MODIFIABLE_SERIALIZE_VALUE(commandRemember), MODIFIABLE_SERIALIZE_VALUE(counterAttack),
      MODIFIABLE_SERIALIZE_VALUE(criticalToActor), MODIFIABLE_SERIALIZE_VALUE(criticalToEnemy), MODIFIABLE_SERIALIZE_VALUE(debuffAdd),
      MODIFIABLE_SERIALIZE_VALUE(defeat),          MODIFIABLE_SERIALIZE_VALUE(emerge),          MODIFIABLE_SERIALIZE_VALUE(enemyDamage),
      MODIFIABLE_SERIALIZE_VALUE(enemyDrain),      MODIFIABLE_SERIALIZE_VALUE(enemyGain),       MODIFIABLE_SERIALIZE_VALUE(enemyLoss),
      MODIFIABLE_SERIALIZE_VALUE(enemyNoDamage),   MODIFIABLE_SERIALIZE_VALUE(enemyNoHit),      MODIFIABLE_SERIALIZE_VALUE(enemyRecovery),
      MODIFIABLE_SERIALIZE_VALUE(escapeFailure),   MODIFIABLE_SERIALIZE_VALUE(escapeStart),     MODIFIABLE_SERIALIZE_VALUE(evasion),
      MODIFIABLE_SERIALIZE_VALUE(expNext),         MODIFIABLE_SERIALIZE_VALUE(expTotal),        MODIFIABLE_SERIALIZE_VALUE(file),
      MODIFIABLE_SERIALIZE_VALUE(levelUp),         MODIFIABLE_SERIALIZE_VALUE(loadMessage),     MODIFIABLE_SERIALIZE_VALUE(magicEvasion),
      MODIFIABLE_SERIALIZE_VALUE(magicReflection), MODIFIABLE_SERIALIZE_VALUE(meVolume),        MODIFIABLE_SERIALIZE_VALUE(obtainExp),
      MODIFIABLE_SERIALIZE_VALUE(obtainGold),      MODIFIABLE_SERIALIZE_VALUE(obtainItem),      MODIFIABLE_SERIALIZE_VALUE(obtainSkill),
      MODIFIABLE_SERIALIZE_VALUE(partyName),       MODIFIABLE_SERIALIZE_VALUE(possession),      MODIFIABLE_SERIALIZE_VALUE(preemptive),
      MODIFIABLE_SERIALIZE_VALUE(saveMessage),     MODIFIABLE_SERIALIZE_VALUE(seVolume),        MODIFIABLE_SERIALIZE_VALUE(substitute),
      MODIFIABLE_SERIALIZE_VALUE(surprise),        MODIFIABLE_SERIALIZE_VALUE(useItem),         MODIFIABLE_SERIALIZE_VALUE(victory),
  };
}

rpgmutils::signal<void(Messages*, const std::string&)>& Messages::actionFailureModified() {
  if (!m_actionFailureModified) {
    m_actionFailureModified.emplace();
  }
  return *m_actionFailureModified;
}
rpgmutils::signal<void(Messages*, const std::string&)>& Messages::actorDamageModified() {
  if (!m_actorDamageModified) {
    m_actorDamageModified.emplace();
  }
  return *m_actorDamageModified;
}
rpgmutils::signal<void(Messages*, const std::string&)>& Messages::actorDrainModified() {
  if (!m_actorDrainModified) {
    m_actorDrainModified.emplace();
  }
  return *m_actorDrainModified;
}
rpgmutils::signal<void(Messages*, const std::string&)>& Messages::actorGainModified() {
  if (!m_actorGainModified) {
    m_actorGainModified.emplace();
  }
  return *m_actorGainModified;
}
rpgmutils::signal<void(Messages*, const std::string&)>& Messages::actorLossModified() {
  if (!m_actorLossModified) {
    m_actorLossModified.emplace();
  }
  return *m_actorLossModified;
}
rpgmutils::signal<void(Messages*, const std::string&)>& Messages::actorNoDamageModified() {
  if (!m_actorNoDamageModified) {
    m_actorNoDamageModified.emplace();
  }
  return *m_actorNoDamageModified;
}
rpgmutils::signal<void(Messages*, const std::string&)>& Messages::actorNoHitModified() {
  if (!m_actorNoHitModified) {
    m_actorNoHitModified.emplace();
  }
  return *m_actorNoHitModified;
}
rpgmutils::signal<void(Messages*, const std::string&)>& Messages::actorRecoveryModified() {
  if (!m_actorRecoveryModified) {
    m_actorRecoveryModified.emplace();
  }
  return *m_actorRecoveryModified;
}
rpgmutils::signal<void(Messages*, const std::string&)>& Messages::alwaysDashModified() {
  if (!m_alwaysDashModified) {
    m_alwaysDashModified.emplace();
  }
  return *m_alwaysDashModified;
}
rpgmutils::signal<void(Messages*, const std::string&)>& Messages::bgmVolumeModified() {
  if (!m_bgmVolumeModified) {
    m_bgmVolumeModified.emplace();
  }
  return *m_bgmVolumeModified;
}
rpgmutils::signal<void(Messages*, const std::string&)>& Messages::bgsVolumeModified() {
  if (!m_bgsVolumeModified) {
    m_bgsVolumeModified.emplace();
  }
  return *m_bgsVolumeModified;
}
rpgmutils::signal<void(Messages*, const std::string&)>& Messages::buffAddModified() {
  if (!m_buffAddModified) {
    m_buffAddModified.emplace();
  }
  return *m_buffAddModified;
}
rpgmutils::signal<void(Messages*, const std::string&)>& Messages::buffRemoveModified() {
  if (!m_buffRemoveModified) {
    m_buffRemoveModified.emplace();
  }
  return *m_buffRemoveModified;
}
rpgmutils::signal<void(Messages*, const std::string&)>& Messages::commandRememberModified() {
  if (!m_commandRememberModified) {
    m_commandRememberModified.emplace();
  }
  return *m_commandRememberModified;
}
rpgmutils::signal<void(Messages*, const std::string&)>& Messages::counterAttackModified() {
  if (!m_counterAttackModified) {
    m_counterAttackModified.emplace();
  }
  return *m_counterAttackModified;
}
rpgmutils::signal<void(Messages*, const std::string&)>& Messages::criticalToActorModified() {
  if (!m_criticalToActorModified) {
    m_criticalToActorModified.emplace();
  }
  return *m_criticalToActorModified;
}
rpgmutils::signal<void(Messages*, const std::string&)>& Messages::criticalToEnemyModified() {
  if (!m_criticalToEnemyModified) {
    m_criticalToEnemyModified.emplace();
  }
  return *m_criticalToEnemyModified;
}
rpgmutils::signal<void(Messages*, const std::string&)>& Messages::debuffAddModified() {
  if (!m_debuffAddModified) {
    m_debuffAddModified.emplace();
  }
  return *m_debuffAddModified;
}
rpgmutils::signal<void(Messages*, const std::string&)>& Messages::defeatModified() {
  if (!m_defeatModified) {
    m_defeatModified.emplace();
  }
  return *m_defeatModified;
}
rpgmutils::signal<void(Messages*, const std::string&)>& Messages::emergeModified() {
  if (!m_emergeModified) {
    m_emergeModified.emplace();
  }
  return *m_emergeModified;
}
rpgmutils::signal<void(Messages*, const std::string&)>& Messages::enemyDamageModified() {
  if (!m_enemyDamageModified) {
    m_enemyDamageModified.emplace();
  }
  return *m_enemyDamageModified;
}
rpgmutils::signal<void(Messages*, const std::string&)>& Messages::enemyDrainModified() {
  if (!m_enemyDrainModified) {
    m_enemyDrainModified.emplace();
  }
  return *m_enemyDrainModified;
}
rpgmutils::signal<void(Messages*, const std::string&)>& Messages::enemyGainModified() {
  if (!m_enemyGainModified) {
    m_enemyGainModified.emplace();
  }
  return *m_enemyGainModified;
}
rpgmutils::signal<void(Messages*, const std::string&)>& Messages::enemyLossModified() {
  if (!m_enemyLossModified) {
    m_enemyLossModified.emplace();
  }
  return *m_enemyLossModified;
}
rpgmutils::signal<void(Messages*, const std::string&)>& Messages::enemyNoDamageModified() {
  if (!m_enemyNoDamageModified) {
    m_enemyNoDamageModified.emplace();
  }
  return *m_enemyNoDamageModified;
}
rpgmutils::signal<void(Messages*, const std::string&)>& Messages::enemyNoHitModified() {
  if (!m_enemyNoHitModified) {
    m_enemyNoHitModified.emplace();
  }
  return *m_enemyNoHitModified;
}
rpgmutils::signal<void(Messages*, const std::string&)>& Messages::enemyRecoveryModified() {
  if (!m_enemyRecoveryModified) {
    m_enemyRecoveryModified.emplace();
  }
  return *m_enemyRecoveryModified;
}
rpgmutils::signal<void(Messages*, const std::string&)>& Messages::escapeFailureModified() {
  if (!m_escapeFailureModified) {
    m_escapeFailureModified.emplace();
  }
  return *m_escapeFailureModified;
}
rpgmutils::signal<void(Messages*, const std::string&)>& Messages::escapeStartModified() {
  if (!m_escapeStartModified) {
    m_escapeStartModified.emplace();
  }
  return *m_escapeStartModified;
}
rpgmutils::signal<void(Messages*, const std::string&)>& Messages::evasionModified() {
  if (!m_evasionModified) {
    m_evasionModified.emplace();
  }
  return *m_evasionModified;
}
rpgmutils::signal<void(Messages*, const std::string&)>& Messages::expNextModified() {
  if (!m_expNextModified) {
    m_expNextModified.emplace();
  }
  return *m_expNextModified;
}
rpgmutils::signal<void(Messages*, const std::string&)>& Messages::expTotalModified() {
  if (!m_expTotalModified) {
    m_expTotalModified.emplace();
  }
  return *m_expTotalModified;
}
rpgmutils::signal<void(Messages*, const std::string&)>& Messages::fileModified() {
  if (!m_fileModified) {
    m_fileModified.emplace();
  }
  return *m_fileModified;
}
rpgmutils::signal<void(Messages*, const std::string&)>& Messages::levelUpModified() {
  if (!m_levelUpModified) {
    m_levelUpModified.emplace();
  }
  return *m_levelUpModified;
}
rpgmutils::signal<void(Messages*, const std::string&)>& Messages::loadMessageModified() {
  if (!m_loadMessageModified) {
    m_loadMessageModified.emplace();
  }
  return *m_loadMessageModified;
}
rpgmutils::signal<void(Messages*, const std::string&)>& Messages::magicEvasionModified() {
  if (!m_magicEvasionModified) {
    m_magicEvasionModified.emplace();
  }
  return *m_magicEvasionModified;
}
rpgmutils::signal<void(Messages*, const std::string&)>& Messages::magicReflectionModified() {
  if (!m_magicReflectionModified) {
    m_magicReflectionModified.emplace();
  }
  return *m_magicReflectionModified;
}
rpgmutils::signal<void(Messages*, const std::string&)>& Messages::meVolumeModified() {
  if (!m_meVolumeModified) {
    m_meVolumeModified.emplace();
  }
  return *m_meVolumeModified;
}
rpgmutils::signal<void(Messages*, const std::string&)>& Messages::obtainExpModified() {
  if (!m_obtainExpModified) {
    m_obtainExpModified.emplace();
  }
  return *m_obtainExpModified;
}
rpgmutils::signal<void(Messages*, const std::string&)>& Messages::obtainGoldModified() {
  if (!m_obtainGoldModified) {
    m_obtainGoldModified.emplace();
  }
  return *m_obtainGoldModified;
}
rpgmutils::signal<void(Messages*, const std::string&)>& Messages::obtainItemModified() {
  if (!m_obtainItemModified) {
    m_obtainItemModified.emplace();
  }
  return *m_obtainItemModified;
}
rpgmutils::signal<void(Messages*, const std::string&)>& Messages::obtainSkillModified() {
  if (!m_obtainSkillModified) {
    m_obtainSkillModified.emplace();
  }
  return *m_obtainSkillModified;
}
rpgmutils::signal<void(Messages*, const std::string&)>& Messages::partyNameModified() {
  if (!m_partyNameModified) {
    m_partyNameModified.emplace();
  }
  return *m_partyNameModified;
}
rpgmutils::signal<void(Messages*, const std::string&)>& Messages::possessionModified() {
  if (!m_possessionModified) {
    m_possessionModified.emplace();
  }
  return *m_possessionModified;
}
rpgmutils::signal<void(Messages*, const std::string&)>& Messages::preemptiveModified() {
  if (!m_preemptiveModified) {
    m_preemptiveModified.emplace();
  }
  return *m_preemptiveModified;
}
rpgmutils::signal<void(Messages*, const std::string&)>& Messages::saveMessageModified() {
  if (!m_saveMessageModified) {
    m_saveMessageModified.emplace();
  }
  return *m_saveMessageModified;
}
rpgmutils::signal<void(Messages*, const std::string&)>& Messages::seVolumeModified() {
  if (!m_seVolumeModified) {
    m_seVolumeModified.emplace();
  }
  return *m_seVolumeModified;
}
rpgmutils::signal<void(Messages*, const std::string&)>& Messages::substituteModified() {
  if (!m_substituteModified) {
    m_substituteModified.emplace();
  }
  return *m_substituteModified;
}
rpgmutils::signal<void(Messages*, const std::string&)>& Messages::surpriseModified() {
  if (!m_surpriseModified) {
    m_surpriseModified.emplace();
  }
  return *m_surpriseModified;
}
rpgmutils::signal<void(Messages*, const std::string&)>& Messages::useItemModified() {
  if (!m_useItemModified) {
    m_useItemModified.emplace();
  }
  return *m_useItemModified;
}
rpgmutils::signal<void(Messages*, const std::string&)>& Messages::victoryModified() {
  if (!m_victoryModified) {
    m_victoryModified.emplace();
  }
  return *m_victoryModified;
}

void to_json(nlohmann::ordered_json& to, const Messages& messages) {
  to = {
      {"actionFailure", messages.m_actionFailure},
      {"actorDamage", messages.m_actorDamage},
      {"actorDrain", messages.m_actorDrain},
      {"actorGain", messages.m_actorGain},
      {"actorLoss", messages.m_actorLoss},
      {"actorNoDamage", messages.m_actorNoDamage},
      {"actorNoHit", messages.m_actorNoHit},
      {"actorRecovery", messages.m_actorRecovery},
      {"alwaysDash", messages.m_alwaysDash},
      {"bgmVolume", messages.m_bgmVolume},
      {"bgsVolume", messages.m_bgsVolume},
      {"buffAdd", messages.m_buffAdd},
      {"buffRemove", messages.m_buffRemove},
      {"commandRemember", messages.m_commandRemember},
      {"counterAttack", messages.m_counterAttack},
      {"criticalToActor", messages.m_criticalToActor},
      {"criticalToEnemy", messages.m_criticalToEnemy},
      {"debuffAdd", messages.m_debuffAdd},
      {"defeat", messages.m_defeat},
      {"emerge", messages.m_emerge},
      {"enemyDamage", messages.m_enemyDamage},
      {"enemyDrain", messages.m_enemyDrain},
      {"enemyGain", messages.m_enemyGain},
      {"enemyLoss", messages.m_enemyLoss},
      {"enemyNoDamage", messages.m_enemyNoDamage},
      {"enemyNoHit", messages.m_enemyNoHit},
      {"enemyRecovery", messages.m_enemyRecovery},
      {"escapeFailure", messages.m_escapeFailure},
      {"escapeStart", messages.m_escapeStart},
      {"evasion", messages.m_evasion},
      {"expNext", messages.m_expNext},
      {"expTotal", messages.m_expTotal},
      {"file", messages.m_file},
      {"levelUp", messages.m_levelUp},
      {"loadMessage", messages.m_loadMessage},
      {"magicEvasion", messages.m_magicEvasion},
      {"magicReflection", messages.m_magicReflection},
      {"meVolume", messages.m_meVolume},
      {"obtainExp", messages.m_obtainExp},
      {"obtainGold", messages.m_obtainGold},
      {"obtainItem", messages.m_obtainItem},
      {"obtainSkill", messages.m_obtainSkill},
      {"partyName", messages.m_partyName},
      {"possession", messages.m_possession},
      {"preemptive", messages.m_preemptive},
      {"saveMessage", messages.m_saveMessage},
      {"seVolume", messages.m_seVolume},
      {"substitute", messages.m_substitute},
      {"surprise", messages.m_surprise},
      {"useItem", messages.m_useItem},
      {"victory", messages.m_victory},
  };
}
void from_json(const nlohmann::ordered_json& from, Messages& messages) {
  messages.m_actionFailure = from.value("actionFailure", messages.m_actionFailure);
  messages.m_actorDamage = from.value("actorDamage", messages.m_actorDamage);
  messages.m_actorNoHit = from.value("actorNoHit", messages.m_actorNoHit);
  messages.m_actorDrain = from.value("actorDrain", messages.m_actorDrain);
  messages.m_actorGain = from.value("actorGain", messages.m_actorGain);
  messages.m_actorLoss = from.value("actorLoss", messages.m_actorLoss);
  messages.m_actorNoDamage = from.value("actorNoDamage", messages.m_actorNoDamage);
  messages.m_actorRecovery = from.value("actorRecovery", messages.m_actorRecovery);
  messages.m_alwaysDash = from.value("alwaysDash", messages.m_alwaysDash);
  messages.m_bgmVolume = from.value("bgmVolume", messages.m_bgmVolume);
  messages.m_bgsVolume = from.value("bgsVolume", messages.m_bgsVolume);
  messages.m_buffAdd = from.value("buffAdd", messages.m_buffAdd);
  messages.m_buffRemove = from.value("buffRemove", messages.m_buffRemove);
  messages.m_commandRemember = from.value("commandRemember", messages.m_commandRemember);
  messages.m_counterAttack = from.value("counterAttack", messages.m_counterAttack);
  messages.m_criticalToActor = from.value("criticalToActor", messages.m_criticalToActor);
  messages.m_criticalToEnemy = from.value("criticalToEnemy", messages.m_criticalToEnemy);
  messages.m_debuffAdd = from.value("debuffAdd", messages.m_debuffAdd);
  messages.m_defeat = from.value("defeat", messages.m_defeat);
  messages.m_emerge = from.value("emerge", messages.m_emerge);
  messages.m_enemyDamage = from.value("enemyDamage", messages.m_enemyDamage);
  messages.m_enemyDrain = from.value("enemyDrain", messages.m_enemyDrain);
  messages.m_enemyGain = from.value("enemyGain", messages.m_enemyGain);
  messages.m_enemyLoss = from.value("enemyLoss", messages.m_enemyLoss);
  messages.m_enemyNoDamage = from.value("enemyNoDamage", messages.m_enemyNoDamage);
  messages.m_enemyNoHit = from.value("enemyNoHit", messages.m_enemyNoHit);
  messages.m_enemyRecovery = from.value("enemyRecovery", messages.m_enemyRecovery);
  messages.m_escapeFailure = from.value("escapeFailure", messages.m_escapeFailure);
  messages.m_escapeStart = from.value("escapeStart", messages.m_escapeStart);
  messages.m_evasion = from.value("evasion", messages.m_evasion);
  messages.m_expNext = from.value("expNext", messages.m_expNext);
  messages.m_expTotal = from.value("expTotal", messages.m_expTotal);
  messages.m_file = from.value("file", messages.m_file);
  messages.m_levelUp = from.value("levelUp", messages.m_levelUp);
  messages.m_loadMessage = from.value("loadMessage", messages.m_loadMessage);
  messages.m_magicEvasion = from.value("magicEvasion", messages.m_magicEvasion);
  messages.m_magicReflection = from.value("magicReflection", messages.m_magicReflection);
  messages.m_meVolume = from.value("meVolume", messages.m_meVolume);
  messages.m_obtainExp = from.value("obtainExp", messages.m_obtainExp);
  messages.m_obtainGold = from.value("obtainGold", messages.m_obtainGold);
  messages.m_obtainItem = from.value("obtainItem", messages.m_obtainItem);
  messages.m_obtainSkill = from.value("obtainSkill", messages.m_obtainSkill);
  messages.m_partyName = from.value("partyName", messages.m_partyName);
  messages.m_possession = from.value("possession", messages.m_possession);
  messages.m_preemptive = from.value("preemptive", messages.m_preemptive);
  messages.m_saveMessage = from.value("saveMessage", messages.m_saveMessage);
  messages.m_seVolume = from.value("seVolume", messages.m_seVolume);
  messages.m_substitute = from.value("substitute", messages.m_substitute);
  messages.m_surprise = from.value("surprise", messages.m_surprise);
  messages.m_useItem = from.value("useItem", messages.m_useItem);
  messages.m_victory = from.value("victory", messages.m_victory);
}


code:
#pragma once
#include "Database/Globals.hpp"
#include "Database/Trait.hpp"

#include <nlohmann/json.hpp>
#include <string>
#include <vector>

class Messages final : public IModifiable {
  friend void to_json(nlohmann::ordered_json& to, const Messages& messages);
  friend void from_json(const nlohmann::ordered_json& from, Messages& messages);

public:
  Messages() = default;
  Messages(const Messages& other);
  Messages& operator=(const Messages& other);
  Messages(Messages&& other) noexcept;
  Messages& operator=(Messages&& other) noexcept;

  const std::string& actionFailure();
  void setActionFailure(const std::string&);
  const std::string& actorDamage();
  void setActorDamage(const std::string&);
  const std::string& actorDrain();
  void setActorDrain(const std::string&);
  const std::string& actorGain();
  void setActorGain(const std::string&);
  const std::string& actorLoss();
  void setActorLoss(const std::string&);
  const std::string& actorNoDamage();
  void setActorNoDamage(const std::string&);
  const std::string& actorNoHit();
  void setActorNoHit(const std::string&);
  const std::string& actorRecovery();
  void setActorRecovery(const std::string&);
  const std::string& alwaysDash();
  void setAlwaysDash(const std::string&);
  const std::string& bgmVolume();
  void setBgmVolume(const std::string&);
  const std::string& bgsVolume();
  void setBgsVolume(const std::string&);
  const std::string& buffAdd();
  void setBuffAdd(const std::string&);
  const std::string& buffRemove();
  void setBuffRemove(const std::string&);
  const std::string& commandRemember();
  void setCommandRemember(const std::string&);
  const std::string& counterAttack();
  void setCounterAttack(const std::string&);
  const std::string& criticalToActor();
  void setCriticalToActor(const std::string&);
  const std::string& criticalToEnemy();
  void setCriticalToEnemy(const std::string&);
  const std::string& debuffAdd();
  void setDebuffAdd(const std::string&);
  const std::string& defeat();
  void setDefeat(const std::string&);
  const std::string& emerge();
  void setEmerge(const std::string&);
  const std::string& enemyDamage();
  void setEnemyDamage(const std::string&);
  const std::string& enemyDrain();
  void setEnemyDrain(const std::string&);
  const std::string& enemyGain();
  void setEnemyGain(const std::string&);
  const std::string& enemyLoss();
  void setEnemyLoss(const std::string&);
  const std::string& enemyNoDamage();
  void setEnemyNoDamage(const std::string&);
  const std::string& enemyNoHit();
  void setEnemyNoHit(const std::string&);
  const std::string& enemyRecovery();
  void setEnemyRecovery(const std::string&);
  const std::string& escapeFailure();
  void setEscapeFailure(const std::string&);
  const std::string& escapeStart();
  void setEscapeStart(const std::string&);
  const std::string& evasion();
  void setEvasion(const std::string&);
  const std::string& expNext();
  void setExpNext(const std::string&);
  const std::string& expTotal();
  void setExpTotal(const std::string&);
  const std::string& file();
  void setFile(const std::string&);
  const std::string& levelUp();
  void setLevelUp(const std::string&);
  const std::string& loadMessage();
  void setLoadMessage(const std::string&);
  const std::string& magicEvasion();
  void setMagicEvasion(const std::string&);
  const std::string& magicReflection();
  void setMagicReflection(const std::string&);
  const std::string& meVolume();
  void setMeVolume(const std::string&);
  const std::string& obtainExp();
  void setObtainExp(const std::string&);
  const std::string& obtainGold();
  void setObtainGold(const std::string&);
  const std::string& obtainItem();
  void setObtainItem(const std::string&);
  const std::string& obtainSkill();
  void setObtainSkill(const std::string&);
  const std::string& partyName();
  void setPartyName(const std::string&);
  const std::string& possession();
  void setPossession(const std::string&);
  const std::string& preemptive();
  void setPreemptive(const std::string&);
  const std::string& saveMessage();
  void setSaveMessage(const std::string&);
  const std::string& seVolume();
  void setSeVolume(const std::string&);
  const std::string& substitute();
  void setSubstitute(const std::string&);
  const std::string& surprise();
  void setSurprise(const std::string&);
  const std::string& useItem();
  void setUseItem(const std::string&);
  const std::string& victory();
  void setVictory(const std::string&);

  void restoreOriginal() override;
  void acceptChanges() override;
  nlohmann::ordered_json serializeOldValues() const override;

  rpgmutils::signal<void(Messages*, const std::string&)>& actionFailureModified();
  rpgmutils::signal<void(Messages*, const std::string&)>& actorDamageModified();
  rpgmutils::signal<void(Messages*, const std::string&)>& actorDrainModified();
  rpgmutils::signal<void(Messages*, const std::string&)>& actorGainModified();
  rpgmutils::signal<void(Messages*, const std::string&)>& actorLossModified();
  rpgmutils::signal<void(Messages*, const std::string&)>& actorNoDamageModified();
  rpgmutils::signal<void(Messages*, const std::string&)>& actorNoHitModified();
  rpgmutils::signal<void(Messages*, const std::string&)>& actorRecoveryModified();
  rpgmutils::signal<void(Messages*, const std::string&)>& alwaysDashModified();
  rpgmutils::signal<void(Messages*, const std::string&)>& bgmVolumeModified();
  rpgmutils::signal<void(Messages*, const std::string&)>& bgsVolumeModified();
  rpgmutils::signal<void(Messages*, const std::string&)>& buffAddModified();
  rpgmutils::signal<void(Messages*, const std::string&)>& buffRemoveModified();
  rpgmutils::signal<void(Messages*, const std::string&)>& commandRememberModified();
  rpgmutils::signal<void(Messages*, const std::string&)>& counterAttackModified();
  rpgmutils::signal<void(Messages*, const std::string&)>& criticalToActorModified();
  rpgmutils::signal<void(Messages*, const std::string&)>& criticalToEnemyModified();
  rpgmutils::signal<void(Messages*, const std::string&)>& debuffAddModified();
  rpgmutils::signal<void(Messages*, const std::string&)>& defeatModified();
  rpgmutils::signal<void(Messages*, const std::string&)>& emergeModified();
  rpgmutils::signal<void(Messages*, const std::string&)>& enemyDamageModified();
  rpgmutils::signal<void(Messages*, const std::string&)>& enemyDrainModified();
  rpgmutils::signal<void(Messages*, const std::string&)>& enemyGainModified();
  rpgmutils::signal<void(Messages*, const std::string&)>& enemyLossModified();
  rpgmutils::signal<void(Messages*, const std::string&)>& enemyNoDamageModified();
  rpgmutils::signal<void(Messages*, const std::string&)>& enemyNoHitModified();
  rpgmutils::signal<void(Messages*, const std::string&)>& enemyRecoveryModified();
  rpgmutils::signal<void(Messages*, const std::string&)>& escapeFailureModified();
  rpgmutils::signal<void(Messages*, const std::string&)>& escapeStartModified();
  rpgmutils::signal<void(Messages*, const std::string&)>& evasionModified();
  rpgmutils::signal<void(Messages*, const std::string&)>& expNextModified();
  rpgmutils::signal<void(Messages*, const std::string&)>& expTotalModified();
  rpgmutils::signal<void(Messages*, const std::string&)>& fileModified();
  rpgmutils::signal<void(Messages*, const std::string&)>& levelUpModified();
  rpgmutils::signal<void(Messages*, const std::string&)>& loadMessageModified();
  rpgmutils::signal<void(Messages*, const std::string&)>& magicEvasionModified();
  rpgmutils::signal<void(Messages*, const std::string&)>& magicReflectionModified();
  rpgmutils::signal<void(Messages*, const std::string&)>& meVolumeModified();
  rpgmutils::signal<void(Messages*, const std::string&)>& obtainExpModified();
  rpgmutils::signal<void(Messages*, const std::string&)>& obtainGoldModified();
  rpgmutils::signal<void(Messages*, const std::string&)>& obtainItemModified();
  rpgmutils::signal<void(Messages*, const std::string&)>& obtainSkillModified();
  rpgmutils::signal<void(Messages*, const std::string&)>& partyNameModified();
  rpgmutils::signal<void(Messages*, const std::string&)>& possessionModified();
  rpgmutils::signal<void(Messages*, const std::string&)>& preemptiveModified();
  rpgmutils::signal<void(Messages*, const std::string&)>& saveMessageModified();
  rpgmutils::signal<void(Messages*, const std::string&)>& seVolumeModified();
  rpgmutils::signal<void(Messages*, const std::string&)>& substituteModified();
  rpgmutils::signal<void(Messages*, const std::string&)>& surpriseModified();
  rpgmutils::signal<void(Messages*, const std::string&)>& useItemModified();
  rpgmutils::signal<void(Messages*, const std::string&)>& victoryModified();

  bool operator==(const Messages& other) const {
    return m_actionFailure == other.m_actionFailure && m_actorDamage == other.m_actorDamage && m_actorDrain == other.m_actorDrain && m_actorGain == other.m_actorGain &&
           m_actorLoss == other.m_actorLoss && m_actorNoDamage == other.m_actorNoDamage && m_actorNoHit == other.m_actorNoHit && m_actorRecovery == other.m_actorRecovery &&
           m_alwaysDash == other.m_alwaysDash && m_bgmVolume == other.m_bgmVolume && m_bgsVolume == other.m_bgsVolume && m_buffAdd == other.m_buffAdd && m_buffRemove == other.m_buffRemove &&
           m_commandRemember == other.m_commandRemember && m_counterAttack == other.m_counterAttack && m_criticalToActor == other.m_criticalToActor && m_criticalToEnemy == other.m_criticalToEnemy &&
           m_debuffAdd == other.m_debuffAdd && m_defeat == other.m_defeat && m_emerge == other.m_emerge && m_enemyDamage == other.m_enemyDamage && m_enemyDrain == other.m_enemyDrain &&
           m_enemyGain == other.m_enemyGain && m_enemyLoss == other.m_enemyLoss && m_enemyNoDamage == other.m_enemyNoDamage && m_enemyNoHit == other.m_enemyNoHit &&
           m_enemyRecovery == other.m_enemyRecovery && m_escapeFailure == other.m_escapeFailure && m_escapeStart == other.m_escapeStart && m_evasion == other.m_evasion &&
           m_expNext == other.m_expNext && m_expTotal == other.m_expTotal && m_file == other.m_file && m_levelUp == other.m_levelUp && m_loadMessage == other.m_loadMessage &&
           m_magicEvasion == other.m_magicEvasion && m_magicReflection == other.m_magicReflection && m_meVolume == other.m_meVolume && m_obtainExp == other.m_obtainExp &&
           m_obtainGold == other.m_obtainGold && m_obtainItem == other.m_obtainItem && m_obtainSkill == other.m_obtainSkill && m_partyName == other.m_partyName && m_possession == other.m_possession &&
           m_preemptive == other.m_preemptive && m_saveMessage == other.m_saveMessage && m_seVolume == other.m_seVolume && m_substitute == other.m_substitute && m_surprise == other.m_surprise &&
           m_useItem == other.m_useItem && m_victory == other.m_victory;
  }

private:
  std::string m_actionFailure;
  std::string m_actorDamage;
  std::string m_actorDrain;
  std::string m_actorGain;
  std::string m_actorLoss;
  std::string m_actorNoDamage;
  std::string m_actorNoHit;
  std::string m_actorRecovery;
  std::string m_alwaysDash;
  std::string m_bgmVolume;
  std::string m_bgsVolume;
  std::string m_buffAdd;
  std::string m_buffRemove;
  std::string m_commandRemember;
  std::string m_counterAttack;
  std::string m_criticalToActor;
  std::string m_criticalToEnemy;
  std::string m_debuffAdd;
  std::string m_defeat;
  std::string m_emerge;
  std::string m_enemyDamage;
  std::string m_enemyDrain;
  std::string m_enemyGain;
  std::string m_enemyLoss;
  std::string m_enemyNoDamage;
  std::string m_enemyNoHit;
  std::string m_enemyRecovery;
  std::string m_escapeFailure;
  std::string m_escapeStart;
  std::string m_evasion;
  std::string m_expNext;
  std::string m_expTotal;
  std::string m_file;
  std::string m_levelUp;
  std::string m_loadMessage;
  std::string m_magicEvasion;
  std::string m_magicReflection;
  std::string m_meVolume;
  std::string m_obtainExp;
  std::string m_obtainGold;
  std::string m_obtainItem;
  std::string m_obtainSkill;
  std::string m_partyName;
  std::string m_possession;
  std::string m_preemptive;
  std::string m_saveMessage;
  std::string m_seVolume;
  std::string m_substitute;
  std::string m_surprise;
  std::string m_useItem;
  std::string m_victory;

  std::optional<std::string> m_oldactionFailure;
  std::optional<std::string> m_oldactorDamage;
  std::optional<std::string> m_oldactorDrain;
  std::optional<std::string> m_oldactorGain;
  std::optional<std::string> m_oldactorLoss;
  std::optional<std::string> m_oldactorNoDamage;
  std::optional<std::string> m_oldactorNoHit;
  std::optional<std::string> m_oldactorRecovery;
  std::optional<std::string> m_oldalwaysDash;
  std::optional<std::string> m_oldbgmVolume;
  std::optional<std::string> m_oldbgsVolume;
  std::optional<std::string> m_oldbuffAdd;
  std::optional<std::string> m_oldbuffRemove;
  std::optional<std::string> m_oldcommandRemember;
  std::optional<std::string> m_oldcounterAttack;
  std::optional<std::string> m_oldcriticalToActor;
  std::optional<std::string> m_oldcriticalToEnemy;
  std::optional<std::string> m_olddebuffAdd;
  std::optional<std::string> m_olddefeat;
  std::optional<std::string> m_oldemerge;
  std::optional<std::string> m_oldenemyDamage;
  std::optional<std::string> m_oldenemyDrain;
  std::optional<std::string> m_oldenemyGain;
  std::optional<std::string> m_oldenemyLoss;
  std::optional<std::string> m_oldenemyNoDamage;
  std::optional<std::string> m_oldenemyNoHit;
  std::optional<std::string> m_oldenemyRecovery;
  std::optional<std::string> m_oldescapeFailure;
  std::optional<std::string> m_oldescapeStart;
  std::optional<std::string> m_oldevasion;
  std::optional<std::string> m_oldexpNext;
  std::optional<std::string> m_oldexpTotal;
  std::optional<std::string> m_oldfile;
  std::optional<std::string> m_oldlevelUp;
  std::optional<std::string> m_oldloadMessage;
  std::optional<std::string> m_oldmagicEvasion;
  std::optional<std::string> m_oldmagicReflection;
  std::optional<std::string> m_oldmeVolume;
  std::optional<std::string> m_oldobtainExp;
  std::optional<std::string> m_oldobtainGold;
  std::optional<std::string> m_oldobtainItem;
  std::optional<std::string> m_oldobtainSkill;
  std::optional<std::string> m_oldpartyName;
  std::optional<std::string> m_oldpossession;
  std::optional<std::string> m_oldpreemptive;
  std::optional<std::string> m_oldsaveMessage;
  std::optional<std::string> m_oldseVolume;
  std::optional<std::string> m_oldsubstitute;
  std::optional<std::string> m_oldsurprise;
  std::optional<std::string> m_olduseItem;
  std::optional<std::string> m_oldvictory;

  std::optional<rpgmutils::signal<void(Messages*, const std::string&)>> m_actionFailureModified;
  std::optional<rpgmutils::signal<void(Messages*, const std::string&)>> m_actorDamageModified;
  std::optional<rpgmutils::signal<void(Messages*, const std::string&)>> m_actorDrainModified;
  std::optional<rpgmutils::signal<void(Messages*, const std::string&)>> m_actorGainModified;
  std::optional<rpgmutils::signal<void(Messages*, const std::string&)>> m_actorLossModified;
  std::optional<rpgmutils::signal<void(Messages*, const std::string&)>> m_actorNoDamageModified;
  std::optional<rpgmutils::signal<void(Messages*, const std::string&)>> m_actorNoHitModified;
  std::optional<rpgmutils::signal<void(Messages*, const std::string&)>> m_actorRecoveryModified;
  std::optional<rpgmutils::signal<void(Messages*, const std::string&)>> m_alwaysDashModified;
  std::optional<rpgmutils::signal<void(Messages*, const std::string&)>> m_bgmVolumeModified;
  std::optional<rpgmutils::signal<void(Messages*, const std::string&)>> m_bgsVolumeModified;
  std::optional<rpgmutils::signal<void(Messages*, const std::string&)>> m_buffAddModified;
  std::optional<rpgmutils::signal<void(Messages*, const std::string&)>> m_buffRemoveModified;
  std::optional<rpgmutils::signal<void(Messages*, const std::string&)>> m_commandRememberModified;
  std::optional<rpgmutils::signal<void(Messages*, const std::string&)>> m_counterAttackModified;
  std::optional<rpgmutils::signal<void(Messages*, const std::string&)>> m_criticalToActorModified;
  std::optional<rpgmutils::signal<void(Messages*, const std::string&)>> m_criticalToEnemyModified;
  std::optional<rpgmutils::signal<void(Messages*, const std::string&)>> m_debuffAddModified;
  std::optional<rpgmutils::signal<void(Messages*, const std::string&)>> m_defeatModified;
  std::optional<rpgmutils::signal<void(Messages*, const std::string&)>> m_emergeModified;
  std::optional<rpgmutils::signal<void(Messages*, const std::string&)>> m_enemyDamageModified;
  std::optional<rpgmutils::signal<void(Messages*, const std::string&)>> m_enemyDrainModified;
  std::optional<rpgmutils::signal<void(Messages*, const std::string&)>> m_enemyGainModified;
  std::optional<rpgmutils::signal<void(Messages*, const std::string&)>> m_enemyLossModified;
  std::optional<rpgmutils::signal<void(Messages*, const std::string&)>> m_enemyNoDamageModified;
  std::optional<rpgmutils::signal<void(Messages*, const std::string&)>> m_enemyNoHitModified;
  std::optional<rpgmutils::signal<void(Messages*, const std::string&)>> m_enemyRecoveryModified;
  std::optional<rpgmutils::signal<void(Messages*, const std::string&)>> m_escapeFailureModified;
  std::optional<rpgmutils::signal<void(Messages*, const std::string&)>> m_escapeStartModified;
  std::optional<rpgmutils::signal<void(Messages*, const std::string&)>> m_evasionModified;
  std::optional<rpgmutils::signal<void(Messages*, const std::string&)>> m_expNextModified;
  std::optional<rpgmutils::signal<void(Messages*, const std::string&)>> m_expTotalModified;
  std::optional<rpgmutils::signal<void(Messages*, const std::string&)>> m_fileModified;
  std::optional<rpgmutils::signal<void(Messages*, const std::string&)>> m_levelUpModified;
  std::optional<rpgmutils::signal<void(Messages*, const std::string&)>> m_loadMessageModified;
  std::optional<rpgmutils::signal<void(Messages*, const std::string&)>> m_magicEvasionModified;
  std::optional<rpgmutils::signal<void(Messages*, const std::string&)>> m_magicReflectionModified;
  std::optional<rpgmutils::signal<void(Messages*, const std::string&)>> m_meVolumeModified;
  std::optional<rpgmutils::signal<void(Messages*, const std::string&)>> m_obtainExpModified;
  std::optional<rpgmutils::signal<void(Messages*, const std::string&)>> m_obtainGoldModified;
  std::optional<rpgmutils::signal<void(Messages*, const std::string&)>> m_obtainItemModified;
  std::optional<rpgmutils::signal<void(Messages*, const std::string&)>> m_obtainSkillModified;
  std::optional<rpgmutils::signal<void(Messages*, const std::string&)>> m_partyNameModified;
  std::optional<rpgmutils::signal<void(Messages*, const std::string&)>> m_possessionModified;
  std::optional<rpgmutils::signal<void(Messages*, const std::string&)>> m_preemptiveModified;
  std::optional<rpgmutils::signal<void(Messages*, const std::string&)>> m_saveMessageModified;
  std::optional<rpgmutils::signal<void(Messages*, const std::string&)>> m_seVolumeModified;
  std::optional<rpgmutils::signal<void(Messages*, const std::string&)>> m_substituteModified;
  std::optional<rpgmutils::signal<void(Messages*, const std::string&)>> m_surpriseModified;
  std::optional<rpgmutils::signal<void(Messages*, const std::string&)>> m_useItemModified;
  std::optional<rpgmutils::signal<void(Messages*, const std::string&)>> m_victoryModified;
};

void to_json(nlohmann::ordered_json& to, const Messages& messages);
void from_json(const nlohmann::ordered_json& from, Messages& messages);

repo_name: Antidote/openrpgeditor

license: mit


code:
#include "MovementRoute.hpp"
#include "Database/CommandParser.hpp"

MovementRoute::MovementRoute(const MovementRoute& other)
: IModifiable(other)
, m_list(other.m_list)
, m_repeat(other.m_repeat)
, m_skippable(other.m_skippable)
, m_wait(other.m_wait)
, m_oldlist(other.m_oldlist)
, m_oldrepeat(other.m_oldrepeat)
, m_oldskippable(other.m_oldskippable)
, m_oldwait(other.m_oldwait) {}

MovementRoute& MovementRoute::operator=(const MovementRoute& other) {
  IModifiable::operator=(other);
  m_list = other.m_list;
  m_repeat = other.m_repeat;
  m_skippable = other.m_skippable;
  m_wait = other.m_wait;
  m_oldlist = other.m_oldlist;
  m_oldrepeat = other.m_oldrepeat;
  m_oldskippable = other.m_oldskippable;
  m_oldwait = other.m_oldwait;
  return *this;
}
MovementRoute::MovementRoute(MovementRoute&& other) noexcept
: IModifiable(std::move(other))
, m_list(std::move(other.m_list))
, m_repeat(other.m_repeat)
, m_skippable(other.m_skippable)
, m_wait(other.m_wait)
, m_oldlist(std::move(other.m_oldlist))
, m_oldrepeat(other.m_oldrepeat)
, m_oldskippable(other.m_oldskippable)
, m_oldwait(other.m_oldwait) {}

MovementRoute& MovementRoute::operator=(MovementRoute&& other) noexcept {
  IModifiable::operator=(std::move(other));
  m_list = std::move(other.m_list);
  m_repeat = other.m_repeat;
  m_skippable = other.m_skippable;
  m_wait = other.m_wait;
  m_oldlist = std::move(other.m_oldlist);
  m_oldrepeat = other.m_oldrepeat;
  m_oldskippable = other.m_oldskippable;
  m_oldwait = other.m_oldwait;
  return *this;
}

std::vector<std::shared_ptr<IEventCommand>>& MovementRoute::list() { return m_list; }
const std::vector<std::shared_ptr<IEventCommand>>& MovementRoute::list() const { return m_list; }
void MovementRoute::setList(const std::vector<std::shared_ptr<IEventCommand>>& list) {
  if (m_list == list) {
    return;
  }
  MODIFIABLE_SET_OLD_VALUE(list);
  m_list = list;
  if (!signalsDisabled()) {
  emit_signal(listModified(), this, list);
  }
  setModified();
}

bool MovementRoute::repeat() const { return m_repeat; }

void MovementRoute::setRepeat(bool repeat) {
  if (repeat == m_repeat) {
    return;
  }
  MODIFIABLE_SET_OLD_VALUE(repeat);
  m_repeat = repeat;
  if (!signalsDisabled()) {
  emit_signal(repeatModified(), this, repeat);
  }
  setModified();
}

bool MovementRoute::skippable() const { return m_skippable; }

void MovementRoute::setSkippable(bool skippable) {
  if (skippable == m_skippable) {
    return;
  }
  MODIFIABLE_SET_OLD_VALUE(skippable);
  m_skippable = skippable;
  if (!signalsDisabled()) {
  emit_signal(skippableModified(), this, skippable);
  }
  setModified();
}
bool MovementRoute::wait() const { return m_wait; }
void MovementRoute::setWait(bool wait) {
  if (wait == m_wait) {
    return;
  }
  MODIFIABLE_SET_OLD_VALUE(wait);
  m_wait = wait;
  if (!signalsDisabled()) {
  emit_signal(waitModified(), this, wait);
  }
  setModified();
}

int MovementRoute::addCommand(const std::shared_ptr<IEventCommand>& command, int position) {
  MODIFIABLE_SET_OLD_VALUE(list);
  if (m_list.size() == 1) {
    position = 0;
  }
  if (position < 0)
    position = 0;
  auto select = m_list.insert(m_list.begin() + position, command);
emit_signal(listModified(), this, m_list);
  setModified(true);
  return select - m_list.begin() + 1;
}

void MovementRoute::restoreOriginal() {
  IModifiable::restoreOriginal();
  MODIFIABLE_RESTORE_ORIGINAL_VALUE(list);
  MODIFIABLE_RESTORE_ORIGINAL_VALUE(skippable);
  MODIFIABLE_RESTORE_ORIGINAL_VALUE(wait);
  for (const auto& e : m_list) {
    if (e) {
      e->restoreOriginal();
    }
  }
}
void MovementRoute::acceptChanges() {
  IModifiable::acceptChanges();
  MODIFIABLE_ACCEPT_VALUE(list);
  MODIFIABLE_ACCEPT_VALUE(skippable);
  MODIFIABLE_ACCEPT_VALUE(wait);
  for (const auto& e : m_list) {
    if (e) {
      e->acceptChanges();
    }
  }
}
nlohmann::ordered_json MovementRoute::serializeOldValues() const {
  nlohmann::ordered_json json;
  CommandParser::serialize(json["list"], m_oldlist ? *m_oldlist : m_list, true, true);
  json["repeat"] = m_repeat;
  json["skippable"] = m_skippable;
  json["wait"] = m_wait;
  return json;
}

rpgmutils::signal<void(MovementRoute*, const std::vector<std::shared_ptr<IEventCommand>>&)>& MovementRoute::listModified() {
  if (!m_listModified) {
    m_listModified.emplace();
  }
  return *m_listModified;
}

rpgmutils::signal<void(MovementRoute*, bool)>& MovementRoute::repeatModified() {
  if (!m_repeatModified) {
    m_repeatModified.emplace();
  }
  return *m_repeatModified;
}

rpgmutils::signal<void(MovementRoute*, bool)>& MovementRoute::skippableModified() {
  if (!m_skippableModified) {
    m_skippableModified.emplace();
  }
  return *m_skippableModified;
}

rpgmutils::signal<void(MovementRoute*, bool)>& MovementRoute::waitModified() {
  if (!m_waitModified) {
    m_waitModified.emplace();
  }
  return *m_waitModified;
}

void to_json(nlohmann::ordered_json& json, const MovementRoute& route) {
  CommandParser::serialize(json["list"], route.m_list, true);
  json["repeat"] = route.m_repeat;
  json["skippable"] = route.m_skippable;
  json["wait"] = route.m_wait;
}

void from_json(const nlohmann::ordered_json& json, MovementRoute& route) {
  CommandParser parser;
  route.m_list = parser.parse(json["list"]);
  route.m_repeat = json.value("repeat", route.m_repeat);
  route.m_skippable = json.value("skippable", route.m_skippable);
  route.m_wait = json.value("wait", route.m_wait);
}


code:
#pragma once

#include "nlohmann/json.hpp"
#include <Database/EventCommands/IEventCommand.hpp>
#include <memory>

struct IEventCommand;
class MovementRoute final : public IModifiable {
public:
  friend void to_json(nlohmann::ordered_json& to, const MovementRoute& route);
  friend void from_json(const nlohmann::ordered_json& to, MovementRoute& route);
  MovementRoute() = default;
  MovementRoute(const MovementRoute&);
  MovementRoute& operator=(const MovementRoute&);
  MovementRoute(MovementRoute&&) noexcept;
  MovementRoute& operator=(MovementRoute&&) noexcept;

  std::vector<std::shared_ptr<IEventCommand>>& list();
  const std::vector<std::shared_ptr<IEventCommand>>& list() const;
  void setList(const std::vector<std::shared_ptr<IEventCommand>>& list);
  bool repeat() const;
  void setRepeat(bool repeat);
  bool skippable() const;
  void setSkippable(bool skippable);
  bool wait() const;
  void setWait(bool wait);

  void restoreOriginal() override;
  void acceptChanges() override;
  nlohmann::ordered_json serializeOldValues() const override;

  [[nodiscard]] bool isModified() const override {
    return IModifiable::isModified() | std::ranges::any_of(m_list, [](const auto& cmd) { return cmd && cmd->isModified(); });
  }
  int addCommand(const std::shared_ptr<IEventCommand>& command, int position);

  MovementRoute clone() const { return MovementRoute(*this, 1); }
  bool operator==(const MovementRoute& other) const { return m_list == other.m_list && m_repeat == other.m_repeat && m_skippable == other.m_skippable && m_wait == other.m_wait; }

  rpgmutils::signal<void(MovementRoute*, const std::vector<std::shared_ptr<IEventCommand>>&)>& listModified();
  rpgmutils::signal<void(MovementRoute*, bool)>& repeatModified();
  rpgmutils::signal<void(MovementRoute*, bool)>& skippableModified();
  rpgmutils::signal<void(MovementRoute*, bool)>& waitModified();

private:
  MovementRoute(const MovementRoute& other, int)
  : IModifiable(other)
  , m_repeat(other.m_repeat)
  , m_skippable(other.m_skippable)
  , m_wait(other.m_wait) {
    for (const auto& cmd : other.m_list) {
      m_list.emplace_back(cmd->clone());
    }
  }

  std::vector<std::shared_ptr<IEventCommand>> m_list;
  bool m_repeat;
  bool m_skippable;
  bool m_wait;

  std::optional<std::vector<std::shared_ptr<IEventCommand>>> m_oldlist;
  std::optional<bool> m_oldrepeat;
  std::optional<bool> m_oldskippable;
  std::optional<bool> m_oldwait;

  std::optional<rpgmutils::signal<void(MovementRoute*, const std::vector<std::shared_ptr<IEventCommand>>&)>> m_listModified;
  std::optional<rpgmutils::signal<void(MovementRoute*, bool)>> m_repeatModified;
  std::optional<rpgmutils::signal<void(MovementRoute*, bool)>> m_skippableModified;
  std::optional<rpgmutils::signal<void(MovementRoute*, bool)>> m_waitModified;
};


code:
#include "Database/Plugins.hpp"
#include <fstream>

void to_json(nlohmann::ordered_json& to, const Plugin& plugin) {
  to = {{"name", plugin.name}, {"status", plugin.status}, {"description", plugin.description}, {"parameters", nlohmann::json{}}};

  if (!plugin.parameters.empty()) {
    for (const auto& parameter : plugin.parameters) {
      to["parameters"][parameter.first] = parameter.second;
    }
  } else {
    to["parameters"] = nlohmann::ordered_json({});
  }
}

void from_json(const nlohmann::ordered_json& from, Plugin& plugin) {
  plugin.name = from["name"].get<std::string>();
  plugin.status = from["status"].get<bool>();
  plugin.description = from["description"].get<std::string>();
  if (from.contains("parameters")) {
    nlohmann::ordered_json parameters = from["parameters"];
    for (const auto& [name, value] : parameters.items()) {
      plugin.parameters.emplace_back(name, value);
    }
  }
}

Plugins Plugins::load(std::string_view path) {
  std::ifstream file(path.data());
  Plugins ret;
  if (file.is_open()) {
    std::string line;
    std::string content;
    bool found = false;
    while (std::getline(file, line)) {
      if (line.compare("var $plugins =") == 0) {
        found = true;
        continue;
      }

      if (found) {
        content += "\n" + line;
      }
    }
    if (content.back() == ';') {
      content.back() = ' ';
    }
    nlohmann::ordered_json data = nlohmann::ordered_json::parse(content);

    for (auto [_, value] : data.items()) {
      auto& plugin = ret.plugins.emplace_back();
      value.get_to(plugin);
    }
  }

  return ret;
}

bool Plugins::serialize(std::string_view path) {
  std::ofstream file(path.data());

  if (file.is_open()) {
    file << "// Generated by Open RPG Editor.\n";
    file << "// Do not edit this file directly.\n";
    file << "var $plugins =\n";
    file << "[\n";

    for (const auto& plugin : plugins) {
      nlohmann::ordered_json data = plugin;
      file << data.dump(4) << (&plugin != &plugins.back() ? ",\n" : "\n");
    }

    file << "];\n";
    return true;
  }

  return false;
}


code:
#pragma once

#include <string>

#include "nlohmann/json.hpp"

struct Plugin {
  friend void to_json(nlohmann::ordered_json& to, const Plugin& plugin);
  friend void from_json(const nlohmann::ordered_json& from, Plugin& plugin);

  std::string name;
  bool status{true};
  std::string description;
  std::vector<std::pair<std::string, std::string>> parameters;
};

struct Plugins {
  static Plugins load(std::string_view path);
  bool serialize(std::string_view path);

  std::vector<Plugin> plugins;
};


code:
#include "Database/ProjectConfig.hpp"

#include <fstream>

ProjectConfig* ProjectConfig::m_instance = nullptr;

ProjectConfig::ProjectConfig() { m_instance = this; }
bool ProjectConfig::load(std::string_view path) {
  try {
    if (std::ifstream f(path.data()); f.is_open()) {
      return loadFromJson(nlohmann::ordered_json::parse(f));
    }
  } catch (...) {
    // scream into the void, we don't care
  }
  return false;
}

bool ProjectConfig::loadFromJson(const nlohmann::ordered_json& parser) {
  try {
    mapStateList = parser.value("mapStateList", mapStateList);
    return true;
  } catch (...) {}

  return false;
}
void ProjectConfig::serialize(const std::string_view path) {
  if (!exists(std::filesystem::path(path).parent_path())) {
    create_directories(std::filesystem::path(path).parent_path());
  }

  if (std::ofstream f(path.data()); f.is_open()) {
    f << serializeToJson().dump(4);
  }
}

nlohmann::ordered_json ProjectConfig::serializeToJson() {
  return {
      {"mapStateList", mapStateList}, //
  };
}

TransientConfig* TransientConfig::m_instance = nullptr;

TransientConfig::TransientConfig() { m_instance = this; }
bool TransientConfig::load(std::string_view path) {
  try {
    if (std::ifstream f(path.data()); f.is_open()) {
      return loadFromJson(nlohmann::ordered_json::parse(f));
    }
  } catch (...) {
    // scream into the void, we don't care
  }
  return false;
}

bool TransientConfig::loadFromJson(const nlohmann::ordered_json& parser) {
  try {
    imguiState = parser.value("imguiState", imguiState);
    return true;
  } catch (...) {}

  return false;
}
void TransientConfig::serialize(const std::string_view path) {
  if (!exists(std::filesystem::path(path).parent_path())) {
    create_directories(std::filesystem::path(path).parent_path());
  }

  if (std::ofstream f(path.data()); f.is_open()) {
    f << serializeToJson().dump(4);
  }
}

nlohmann::ordered_json TransientConfig::serializeToJson() {
  return {
      {"imguiState", imguiState},
  };
}


code:
#pragma once

#include "Database/Globals.hpp"
#include "nlohmann/json.hpp"

#include <deque>

struct ProjectConfig {

  ProjectConfig();
  bool load(std::string_view path);
  bool loadFromJson(const nlohmann::ordered_json& parser);
  void serialize(std::string_view path);
  nlohmann::ordered_json serializeToJson();
  std::map<int, MapStateType> mapStateList;

  [[nodiscard]] static ProjectConfig* instance() { return m_instance; }

private:
  static ProjectConfig* m_instance;
};

struct TransientConfig {
  TransientConfig();
  bool load(std::string_view path);
  bool loadFromJson(const nlohmann::ordered_json& parser);
  void serialize(std::string_view path);
  nlohmann::ordered_json serializeToJson();
  std::string imguiState;

  [[nodiscard]] static TransientConfig* instance() { return m_instance; }

private:
  static TransientConfig* m_instance;
};


code:
#include "Database/RPGEquations.hpp"
#include <cmath>

namespace rpg::equations {
uint32_t experienceForLevel(const int level, const int basis, const int extra, const int accelA, const int accelB) {
  double result = static_cast<double>(basis) * (pow(level - 1, 0.9 + static_cast<double>(accelA) / 250));
  result *= level * (level + 1) / (6 + pow(level, 2) / 50 / static_cast<double>(accelB));
  result += (level - 1) * extra;

  return round(result);
}
void generateParameters(const int value1, const int value2, const int growth, std::array<int, 99>& parameters) {
  const double a = value1;
  const double b = value2;
  const double c = growth - 10;

  for (int i = 1; i <= 99; i++) {
    const double n1 = a + ((b - a) * (i - 1) / 98);
    const double n2 = a + ((b - a) * (i - 1) * (i - 1) / 98 / 98);
    const double x = ceil((n2 * c + n1 * (10 - c)) / 10);
    parameters[i] = static_cast<int>(x);
  }
}

void quickGenerateParameters(const int rank, const int paramId, const int maxValue, std::array<int, 99>& parameters) {
  int value1 = 200 + rank * 100 + rand() * 100;
  int value2 = 4000 + rank * 1000 + rand() * 1000;

  value1 *= maxValue / 10000;
  value2 *= maxValue / 10000;

  if (paramId >= 2) {
    value1 += 5;
  }

  value1 = round(value1);
  value2 = round(value2);
  generateParameters(value1, value2, 10, parameters);
}

} // namespace rpg::equations


code:
#pragma once
#include <cinttypes>

#include <array>
namespace rpg::equations {
uint32_t experienceForLevel(int level, int basis, int extra, int accelA, int accelB);
void generateParameters(int value1, int value2, int growth, std::array<int, 99>& parameters);
void quickGenerateParameters(int rank, int maxValue, std::array<int, 99>& parameters);
} // namespace rpg::equations


code:
#include "SearchResult.hpp"
SearchResult::SearchResult(int commonId, int step) {
  m_commonEventId = commonId;
  m_step = step;
  m_resultSource = ResultSource::CommonEvent;
}
SearchResult::SearchResult(const int mapId, const int eventId, const int pageIndex) {
  m_eventId = eventId;
  m_mapId = mapId;
  m_page = pageIndex;
  m_resultSource = ResultSource::Event;
}
SearchResult::SearchResult(const int commonEventId, const std::shared_ptr<IEventCommand>& cmd, const int step)
: m_command(cmd) {
  m_commonEventId = commonEventId;
  m_step = step;
  m_resultSource = ResultSource::CommonEvent;
}
SearchResult::SearchResult(const int mapId, const int eventId, const std::shared_ptr<IEventCommand>& cmd, const int pageIndex, const int step)
: m_command(cmd) {
  m_eventId = eventId;
  m_mapId = mapId;
  m_page = pageIndex;
  m_step = step;
  m_resultSource = ResultSource::Event;
}
SearchResult::SearchResult(SpecialDataParent type, int parentId, int dataId) {
  m_type = type;
  m_parentId = parentId;
  m_dataId = dataId;
  m_resultSource = ResultSource::Special;
}


code:
#pragma once
#include "Database/CommonEvent.hpp"
#include "Database/Database.hpp"
#include "Database/Event.hpp"
#include "Database/Globals.hpp"

#include <map>
#include <string>
#include <vector>

class SearchResult {
public:
  enum class ResultSource {
    Event,
    CommonEvent,
    Special,
  };

  explicit SearchResult(int commonId, int step);
  explicit SearchResult(int mapId, int eventId, int pageIndex);
  explicit SearchResult(int commonEventId, const std::shared_ptr<IEventCommand>& cmd, int step);
  explicit SearchResult(int mapId, int eventId, const std::shared_ptr<IEventCommand>& cmd, int pageIndex, int step);
  explicit SearchResult(SpecialDataParent type, int parentId, int dataId); // For effects and traits

  [[nodiscard]] Event& getEvent() const { return *Database::instance()->mapInfos.map(m_mapId)->event(m_eventId); }
  [[nodiscard]] CommonEvent& getCommonEvent() const { return *Database::instance()->commonEvents.event(m_commonEventId); }
  [[nodiscard]] int getEventId() const { return m_eventId; }
  [[nodiscard]] int getCommonEventId() const { return m_commonEventId; }
  [[nodiscard]] const std::shared_ptr<IEventCommand>& getCommand() const { return m_command; }
  [[nodiscard]] int getMapId() const { return m_mapId; }
  [[nodiscard]] int getTile() const { return 0; } // TODO
  [[nodiscard]] int getPage() const { return m_page; }
  [[nodiscard]] int getStep() const { return m_step; }
  [[nodiscard]] ResultSource resultSource() const { return m_resultSource; }

private:
  ResultSource m_resultSource = ResultSource::Special;
  int m_eventId{-1};
  std::shared_ptr<IEventCommand> m_command;
  int m_commonEventId{-1};
  int m_mapId{-1};
  int m_step{-1};
  int m_page{0};
  SpecialDataParent m_type{};
  int m_parentId{0}; // Parent id
  int m_dataId{0};   // Effect/Trait id
};


code:
#include "Database/Serializable/ActorsSerializer.hpp"

void ActorsSerializer::serialize(std::ofstream& os) const {
  try {
    nlohmann::ordered_json data;

    if (m_data.actorList().empty()) {
      data.push_back(nullptr);
      os << data.dump(4);
      return;
    }

    for (const Actor& actor : m_data.actorList()) {
      if (actor.isValid()) {
        data.push_back(actor);
      } else {
        data.push_back(nullptr);
      }
    }

    os << data.dump(4);
  } catch (...) {}
}

void ActorsSerializer::deserialize(std::ifstream& is) {
  try {
    nlohmann::ordered_json data = nlohmann::ordered_json::parse(is);
    m_data.disableSignals();
    m_data.actorList().reserve(data.size());

    int i = 0;
    for (const auto& [_, value] : data.items()) {
      Actor& actor = m_data.actorList().emplace_back();
      actor.disableSignals();
      actor.setValid(value != nullptr);
      if (actor.isValid()) {
        value.get_to(actor);
      } else {
        actor.setId(i);
      }
      actor.enableSignals();
      ++i;
    }
    m_data.enableSignals();
  } catch (...) {}
}


code:
#pragma once

#include "Database/Actors.hpp"
#include "Database/Serializable/ISerializable.hpp"

class ActorsSerializer final : public ITypedSerializable<Actors> {
public:
  explicit ActorsSerializer(const std::string_view filepath)
  : ITypedSerializable(filepath) {}
  ActorsSerializer(const Actors& actors, const std::string_view filepath)
  : ITypedSerializable(actors, filepath) {}
  void serialize(std::ofstream& os) const override;
  void deserialize(std::ifstream& is) override;
};


code:
#include "Database/Serializable/AnimationsSerializer.hpp"

void AnimationsSerializer::serialize(std::ofstream& os) const {
  try {
    nlohmann::ordered_json data;

    if (m_data.animations().empty()) {
      data.push_back(nullptr);
      os << data.dump(4);
      return;
    }

    for (const Animation& animation : m_data.animations()) {
      if (animation.m_isValid) {
        data.push_back(animation);
      } else {
        data.push_back(nullptr);
      }
    }

    os << data.dump(4);
  } catch (...) {}
}

void AnimationsSerializer::deserialize(std::ifstream& is) {
  try {
    nlohmann::ordered_json data = nlohmann::ordered_json::parse(is);
    m_data.animations().reserve(data.size());
    m_data.disableSignals();

    int i = 0;
    for (const auto& [_, value] : data.items()) {
      Animation& animation = m_data.animations().emplace_back();
      animation.m_isValid = value != nullptr;
      if (animation.m_isValid) {
        value.get_to(animation);
      } else {
        animation.m_id = i;
      }
      ++i;
    }
    m_data.enableSignals();
  } catch (...) {}
}


code:
#pragma once
#include "Database/Animations.hpp"
#include "Database/Serializable/ISerializable.hpp"

class AnimationsSerializer final : public ITypedSerializable<Animations> {
public:
  explicit AnimationsSerializer(const std::string_view filepath)
  : ITypedSerializable(filepath) {}
  AnimationsSerializer(const Animations& animations, const std::string_view filepath)
  : ITypedSerializable(animations, filepath) {}
  void serialize(std::ofstream& os) const override;
  void deserialize(std::ifstream& is) override;
};