/// <summary> /// Reload the configuration of RockEngine. /// Warning: not thread safe. /// </summary> public void Reload() { var configurationString = File.ReadAllText(RockEngineConstants.ConfigurationFilePath); this.configuration = RockJsonSerializer.Deserialize <RockConfiguration>(configurationString); this.tracer = new RockTracer(this.configuration); this.bot = new RockEngineBot(this.configuration, this.tracer); this.pegasus = RockPegasusFactory.CreatePegasus(this.tracer); }
/// <summary> /// Initializes a new instance of the <see cref="RockEngineAction" /> class. /// </summary> /// <param name="pegasus">The IRockPegasus.</param> /// <param name="action">The RockIds of the action.</param> /// <param name="slot">The target slot when apply the action.</param> public RockEngineAction(IRockPegasus pegasus, List <int> action, int slot) { if (action == null) { this.actions = new List <int>(); } else { this.actions = action; } this.slot = slot; this.pegasus = pegasus; this.step = 0; this.Interpretation = this.GetInterpretation(); }