public ModelChangeEvent(PlayerModelTrainingDump stateBefore, PlayerModelTrainingDump stateAfter, ModelChangeType type) { this.Type = type; this.StateBefore = stateBefore; this.StateAfter = stateAfter; UpdateDelta(); }
public PlayerModelTrainingDump Clone() { PlayerModelTrainingDump clone = new PlayerModelTrainingDump(); foreach (var item in Resources) { clone.Resources[item.Key] = item.Value; } return(clone); }
public static PlayerModelTrainingDump GetDelta(PlayerModelTrainingDump stateBefore, PlayerModelTrainingDump stateAfter) { PlayerModelTrainingDump delta = new PlayerModelTrainingDump(); foreach (ResourceType res in Enum.GetValues(typeof(ResourceType))) { int deltaRes = stateAfter.GetCount(res) - stateBefore.GetCount(res); delta.Add(res, deltaRes); } return(delta); }
public GameProxyEvent(ModelChangeEvent cause, PlayerModelTrainingDump stateBefore, PlayerModelTrainingDump stateAfter, ModelChangeType type) : base(stateBefore, stateAfter, type) { this.Cause = cause; }
public GameDecizionEvent(TrainingDecisionModel decisionTraining, PlayerModelTrainingDump stateBefore, PlayerModelTrainingDump stateAfter, ModelChangeType type) : base(stateBefore, stateAfter, type) { this.DecisionTraining = decisionTraining; }
public void UpdateDelta() { Delta = GetDelta(StateBefore, StateAfter); }