Synced Context: defined static members inline

This commit is contained in:
Charles Dang 2021-01-17 11:45:51 +11:00
parent 3176c7a5a5
commit 8037076e5d
2 changed files with 5 additions and 10 deletions

View file

@ -46,11 +46,6 @@ static lg::log_domain log_replay("replay");
#define WRN_REPLAY LOG_STREAM(warn, log_replay)
#define ERR_REPLAY LOG_STREAM(err, log_replay)
synced_context::synced_state synced_context::state_ = synced_context::UNSYNCED;
int synced_context::last_unit_id_ = 0;
synced_context::event_list synced_context::undo_commands_;
bool synced_context::is_simultaneous_ = false;
bool synced_context::run(const std::string& commandname,
const config& data,
bool use_undo,

View file

@ -52,7 +52,7 @@ public:
* @param commandname The command to run.
* @param data The data to use with the command.
* @param use_undo This parameter is used to ignore undos during an ai move to optimize.
* @param show
* @param show
* @param error_handler An error handler for the case that data contains invalid data.
*
* @return True if the action was successful.
@ -202,7 +202,7 @@ public:
private:
/** Weather we are in a synced move, in a user_choice, or none of them. */
static synced_state state_;
static inline synced_state state_ = synced_context::UNSYNCED;
/**
* As soon as get_user_choice is used with side != current_side (for example in generate_random_seed) other sides
@ -213,13 +213,13 @@ private:
*
* TODO: it would be better if the following variable were not static.
*/
static bool is_simultaneous_;
static inline bool is_simultaneous_ = false;
/** Used to restore the unit id manager when undoing. */
static int last_unit_id_;
static inline int last_unit_id_ = 0;
/** Actions wml to be executed when the current action is undone. */
static event_list undo_commands_;
static inline event_list undo_commands_ {};
};
class set_scontext_synced_base