// Возвращает скопированый стэк для нового клона
        public object Clone()
        {
            var newCloneStack = new LinkedStack <T>();

            newCloneStack.head = head;
            return(newCloneStack);
        }
 public Clone(int id)
 {
     learned      = new LinkedStack <string>();
     history      = new LinkedStack <string>();
     isRollbacked = false;
     Id           = id;
 }
示例#3
0
 public void Add(string str)
 {
     if (progsUndo.Head != null)
     {
         progsUndo = new LinkedStack <string>();
     }
     progs.Push(str);
 }
 public CloneCharacter()
 {
     programs  = new LinkedStack <string>();
     rollbacks = new LinkedStack <string>();
 }
示例#5
0
 public Clone()
 {
     LearnedProgramms.CreateLinkedStack("basic");
     RolledBackProgramms = new LinkedStack <string>();
 }
示例#6
0
 public void Clone(LinkedStack <Type> clone)
 {
     head = clone.head;
     tail = clone.tail;
 }
 public void Learn(int program)
 {
     programs.Push(program);
     rollbacks = new LinkedStack <int>();
 }
 public Clone CloneCmd(int newId) => new Clone(newId)
 {
     isRollbacked = isRollbacked,
     learned      = LinkedStack <string> .Clone(learned),
     history      = LinkedStack <string> .Clone(history)
 };
示例#9
0
 public Clone(LinkedStack <string> progs, LinkedStack <string> progsUndo)
 {
     this.progs     = progs;
     this.progsUndo = progsUndo;
 }