예제 #1
0
        //private Core core;

        // private Core()

        public static void Init()
        {
            uint[] size = null;
            while (true)
            {
                PrintOut.PrintMenu();

                try
                {
                    string initAns = Console.ReadLine();

                    user = new UserInputController();

                    FieldType = (FieldType)(user.ChooseFieldType(initAns));
                    break;
                }
                catch (InvalidInputException e)
                {
                    CatchActions(e);
                }
            }

            while (size == null)
            {
                try
                {
                    PrintOut.CustomizeSizeW();
                    string w = Console.ReadLine();
                    PrintOut.CustomizeSizeL();
                    string l = Console.ReadLine();

                    size = user.ChooseFieldSize(w, l);
                }
                catch (Exception e)
                {
                    CatchActions(e);
                }
            }

            Switch(FieldType, size[0], size[1]);

            history = new HistoryCareTaker();

            undoCommand = new UndoCommand(history);

            Console.Clear();
        }
예제 #2
0
 public UndoCommand(HistoryCareTaker _history)
 {
     history = _history;
 }
예제 #3
0
 public MoveTagCommand(FromToCoords _fromTo, Field _field, HistoryCareTaker _history)
 {
     field   = _field;
     history = _history;
     fromTo  = _fromTo;
 }