Esempio n. 1
0
 public object Clone()
 {
     State clone = new State();
     clone.Units = new List<Unit>(this.Units);
     clone.OldMoves = new List<UnitMove>(this.OldMoves);
     return clone;
 }
Esempio n. 2
0
        void Move(int sub, string comment)
        {
            State state = CurrentState;

            state.Move(sub, comment);

            CurrentState = state;
        }
Esempio n. 3
0
        //прогнать по шкале до хода первого юнита
        public void Top()
        {
            State state = CurrentState;

            state.Top();

            CurrentState = state;
        }
Esempio n. 4
0
        //удалить стек из набора отрядов
        public void Remove(int id)
        {
            State state = CurrentState;

            for (int i = state.Units.Count - 1; i >= 0; i--)
                if (state.Units[i].id == id)
                    state.Units.RemoveAt(i);

            CurrentState = state;
        }
Esempio n. 5
0
        //добавить стек к набору отрядов
        public void AddAfterFirst(Unit unit, int delta)
        {
            State state = CurrentState;
            unit = (Unit)unit.Clone();

            if (state.Units.Count > 0)
            {
                state.Top();

                Unit first = state.Units[state.FirstIndex()];
                unit.curATB = first.curATB - delta;
            }

            state.Units.Add(unit);

            CurrentState = state;
        }
Esempio n. 6
0
        //добавить стек к набору отрядов
        public void Add(Unit unit)
        {
            State state = CurrentState;

            state.Units.Add((Unit)unit.Clone());

            CurrentState = state;
        }