Exemplo n.º 1
0
        public void StartGame()
        {
            ClientServer.MyServer.Run();
            //Process.Start("Z:\\!Ivasuk\\!SE\\PZ24\\MAPZ\\mapz\\Patterns\\GAME\\Server\\bin\\Debug\\Server.exe");
            SoundPlayerSingletone.GetPlayerIstanse().PlayByRelPath("\\Sound\\MenuOST.wav");
            CreateWorld();
            Console.CursorVisible = false;
            menuDrawer            = new StartMenuDrawer();
            CurrentMenu           = ((StartMenuDrawer)menuDrawer).StartMenu;
            ReservHandlers();
            questsManeger.CreateStartQuests();

            MyRaceiver = new CommandPattern.Receiver(this.GameUI, this.player, this.CurrentMenu);
            KListener  = new KeyListener();
            KListener.SetReceiver(MyRaceiver);
            KListener.StartListen();

            while (true)
            {
                string selectedMenuItem = menuDrawer.DrawMenu(CurrentMenu).ToLower();
                if (!menuHandler.HandleItem(selectedMenuItem))
                {
                    Console.Clear();
                }
            }
        }
Exemplo n.º 2
0
        public override void Run()
        {
            Initialize();

            var battleMenu = _menuModel.BattleMenu;

            if (battleMenu != null)
            {
                _drawer.DrawMenu(battleMenu, 4, 54, 1);
            }

            _root.SetForegroundColour(TCODColor.white);
            _root.PrintString(3, 52, "Action Select:");
            _root.DrawVerticalLine(19, 52, 12);
            _statDrawer.DrawStats(Model.BattleModel.CurrentAttacker);
        }
Exemplo n.º 3
0
        public override void Run()
        {
            var menu = Model.MenuModel.SpellSelectMenu;

            Clear();
            PrintString(0, 0, "Spell select:");
            PrintString(39, 0, "Cost:  Delay:");

            _drawer.DrawMenu(menu, this, 3, 2, 1);

            var redControl   = GetColorControlString(TCODColor.red);
            var whiteControl = GetColorControlString(TCODColor.white);
            var greyControl  = GetColorControlString(TCODColor.grey);

            for (var i = 0; i < menu.GetStateCount(); ++i)
            {
                var item  = menu.GetMenuItem(i);
                var spell = Model.SpellFactory.GetSpell(item.Label);

                PrintString(CostX, StartY + OffSetY * i, CostFormat, TCODAlignment.RightAlignment,
                            item.IsSelected ? redControl : item.IsDisabled?greyControl: whiteControl,
                            (int)spell.MPCost, GetStopControl());

                PrintString(DelayX, StartY + OffSetY * i, DelayFormat, TCODAlignment.RightAlignment,
                            item.IsSelected ? redControl : item.IsDisabled?greyControl: whiteControl,
                            (int)(100 - spell.Delay * 100d),
                            GetStopControl());
            }

            RConsole.RootConsole.Blit(this, Bounds, 22, 52);
            var currentItem = menu.CurrentState as IMenuItem;

            Debug.Assert(currentItem != null, "item != null");
            var currentSpell = Model.SpellFactory.GetSpell(currentItem.Label);

            _spellDrawer.DrawSpellDescription(currentSpell);
        }
Exemplo n.º 4
0
 public override void Run()
 {
     _menuDrawer.DrawMenu(Model.MenuModel.ActiveMenu, 0, 0, 0, _menuConsole, 0,
                          Model.MenuModel.ActiveMenu.GetStateCount() - 1);
     _rootConsole.Blit(_menuConsole, _menuConsole.Bounds, 5, _rootHeight - 9);
 }