コード例 #1
0
 public ModelChangeEvent(PlayerModelTrainingDump stateBefore, PlayerModelTrainingDump stateAfter, ModelChangeType type)
 {
     this.Type        = type;
     this.StateBefore = stateBefore;
     this.StateAfter  = stateAfter;
     UpdateDelta();
 }
コード例 #2
0
    public PlayerModelTrainingDump Clone()
    {
        PlayerModelTrainingDump clone = new PlayerModelTrainingDump();

        foreach (var item in Resources)
        {
            clone.Resources[item.Key] = item.Value;
        }
        return(clone);
    }
コード例 #3
0
    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);
    }
コード例 #4
0
 public GameProxyEvent(ModelChangeEvent cause, PlayerModelTrainingDump stateBefore, PlayerModelTrainingDump stateAfter, ModelChangeType type) :
     base(stateBefore, stateAfter, type)
 {
     this.Cause = cause;
 }
コード例 #5
0
 public GameDecizionEvent(TrainingDecisionModel decisionTraining, PlayerModelTrainingDump stateBefore, PlayerModelTrainingDump stateAfter, ModelChangeType type) :
     base(stateBefore, stateAfter, type)
 {
     this.DecisionTraining = decisionTraining;
 }
コード例 #6
0
 public void UpdateDelta()
 {
     Delta = GetDelta(StateBefore, StateAfter);
 }