/// <summary> /// Ack() will be called when the transaction is committed. /// </summary> /// <param name="seqId">Sequence Id of the tuple which is acked.</param> /// <param name="parms"></param> public void Ack(long seqId, Dictionary <string, Object> parms) { Context.Logger.Info("Ack, seqId: {0}", seqId); State state = stateStore.GetState(seqId); state.Commit(true); }
public void ItWorksWithoutUnregisteredController() { var store = new StateStore(); Assert.Throws <KeyNotFoundException>(() => { store.GetState <float>("NonExistingController"); }); }
public void Ack(long seqId, Dictionary <string, Object> parms) { Context.Logger.Info("Ack, seqId: {0}", seqId); if (Context.pluginType != SCPPluginType.SCP_NET_LOCAL) { State state = stateStore.GetState(seqId); state.Commit(true); } }
public void ItRegistersStateControllers() { var store = new StateStore(); var controller = new CurrentHealthController(); store.AddController("CurrentHealth", controller); var currentHealth = store.GetState <float>("CurrentHealth"); Assert.AreEqual(currentHealth, controller.GetState()); }
public void AllIsWell() { var store = new StateStore(); store.AddController("CurrentHealth", new CurrentHealthController()); store.Dispatch(new StoreAction { Type = "UpdateCurrentHealth", Payload = 20f }); Assert.AreEqual(store.GetState <float>("CurrentHealth"), 20f); }