public static FieldStateForest GetInstance()
        {
            if (FieldStateForest.Instance == null)
            {
                FieldStateForest.Instance = new FieldStateForest();
            }

            return(FieldStateForest.Instance);
        }
Пример #2
0
        static void Main(string[] args)
        {
            Field[][] Fields = new Field[5][];
            for (int i = 0; i < Fields.Length; i++)
            {
                Fields[i] = new Field[5];
                for (int j = 0; j < Fields[i].Length; j++)
                {
                    Fields[i][j] = new Field(i, j);
                }
            }

            Fields[0][1].SetStateNew(FieldStateForest.GetInstance());
            Fields[0][3].SetStateNew(FieldStateImpassable.GetInstance());

            Fields[2][2].SetStateNew(FieldStateImpassable.GetInstance());
            Fields[2][3].SetStateNew(FieldStateImpassable.GetInstance());
            Fields[3][2].SetStateNew(FieldStateImpassable.GetInstance());
            Fields[3][3].SetStateNew(FieldStateImpassable.GetInstance());

            Fields[1][3].SetStateNew(FieldStateNormal.GetInstance());
            Fields[1][4].SetStateNew(FieldStateNormal.GetInstance());

            Battlefield           bf = new Battlefield(Fields.Select(x => x.ToList()).ToList());
            BattleController      bc = new BattleController(bf);
            MarketplaceController mc = new MarketplaceController();
            Menu menu = new Menu();

            PrepareHeroes(bf);

            ControllerMediator mediator = new ControllerMediator(bc, mc, menu);

            mediator.SwitchMode(Controller.ControllerType.Menu);


            /*bc.ReceiveCommands();
             * Console.ReadLine();
             */
            System.Environment.Exit(0);
        }