Esempio n. 1
0
//        public GameObject GetClearZone(Direction dir)
//        {
//            GameObject clearZone = new GameObject();
//            clearZone.teg = Tegs.Zone;

//            switch (dir)
//            {
//                case Direction.Top:
//                    clearZone.area = new Area().SetArea(40, 0, 5, 10);
//                    break;
//                case Direction.Down:
//                    clearZone.area = new Area().SetArea(50, 35, 5, 10);
//                    break;
//                case Direction.Left:
//                    clearZone.area = new Area().SetArea(0, 15, 5, 10);
//                    break;
//                case Direction.Right:
//                    clearZone.area = new Area().SetArea(70, 20, 5, 10);
//                    break;
//                default:
//                case Direction.None:

//#if DEBUG
//                    GameLogger.AddLog(ref Program.log, "В методе GameMap.GetDoor свич попал в default иил None");

//#endif
//                    break;
//            }

//            return clearZone;
//        }

        public GameObject GetDoorZone(Direction dir)
        {
            GameObject doorZone = new GameObject();

            doorZone.ObjTag = Tags.Zone;

            switch (dir)
            {
            case Direction.Top:
                doorZone.ObjArea = new Area().SetArea(40, 0, 2, 10);
                break;

            case Direction.Down:
                doorZone.ObjArea = new Area().SetArea(50, 38, 2, 10);
                break;

            case Direction.Left:
                doorZone.ObjArea = new Area().SetArea(0, 15, 5, 2);
                break;

            case Direction.Right:
                doorZone.ObjArea = new Area().SetArea(78, 20, 5, 2);
                break;

            default:
            case Direction.None:

#if DEBUG
                GameLogger.AddLog(ref Program.log, "В методе GameMap.GetDoor свич попал в default иил None");
#endif
                break;
            }

            return(doorZone);
        }
Esempio n. 2
0
        public static void ConsoleSetings()
        {
            Console.Title         = "The best Game!!!!";
            Console.CursorVisible = false;

            Console.SetWindowSize(Width, Height);
            Console.SetBufferSize(Width, Height);
#if DEBUG
            Console.SetWindowSize(Width + 50, Console.LargestWindowHeight);
            Console.SetBufferSize(Width + 50, Console.LargestWindowHeight);
#endif

#if DEBUG
            GameLogger.AddLog(ref Program.log, "Настройки консоли установлены");
#endif
        }
Esempio n. 3
0
        public static void PrintBracket()
        {
            Console.SetCursorPosition(0, 0);
            Console.BackgroundColor = ConsoleColor.Red;

            for (int i = 0; i < Settings.Width - 1; i++)
            {
                Console.SetCursorPosition(i, 0);                                      // верхняя линия
                Console.Write(" ");
                Console.SetCursorPosition(i, Settings.GetGameArea().To.newPos.y - 1); // нижняя линия
                Console.Write(" ");
            }
            for (int i = 0; i < Settings.Height - 1; i++)
            {
                Console.SetCursorPosition(0, i);                  // левая линия
                Console.Write(" ");
                Console.SetCursorPosition(Settings.Width - 1, i); // правая линия
                Console.Write(" ");
            }

            for (int i = 0; i <= Settings.GetGameArea().To.newPos.y - 1; i++)
            {
                Console.SetCursorPosition(Settings.GetGameArea().To.newPos.x - 1, i); // левая линия
                Console.Write(" ");
            }

            for (int i = Settings.GetGameArea().To.newPos.x - 1; i < Settings.Width; i++)
            {
                Console.SetCursorPosition(i, 4);
                Console.Write(" ");
            }

            Console.SetCursorPosition(Settings.GetGameArea().To.newPos.x + 3, 6);
            Console.Write(" ");

            Console.ResetColor();

#if DEBUG
            GameLogger.AddLog(ref Program.log, "Статичная рамка игры нарисована");
#endif
        }