コード例 #1
0
 public State()
 {
     details       = new StateDetails();
     tempEffects   = new List <TemporaryEnhancementAbility>();
     step          = 1;
     previousState = null;
     leadingAction = null;
 }
コード例 #2
0
        // Makes a new state which was arrived at by performing an action from a
        // previous state.
        public State(State oldState, Ability leadingAction)
        {
            this.details = oldState.details;

            this.previousState = oldState; // do we need to clone here?
            this.leadingAction = leadingAction;

            this.step   = oldState.step + 1;
            tempEffects = new List <TemporaryEnhancementAbility>(oldState.tempEffects);
        }
コード例 #3
0
        // Makes an exact copy of the original state
        public State(State oldState)
        {
            Debug.Assert(oldState != null);

            this.details = oldState.details;

            this.previousState = oldState.previousState; // do we need to clone here?
            this.leadingAction = oldState.leadingAction;
            this.step          = oldState.step;
            tempEffects        = new List <TemporaryEnhancementAbility>(oldState.tempEffects);
        }