Esempio 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();
                }
            }
        }
 public SpellSelectView()
     : base(55, 12)
 {
     _drawer      = new MenuDrawer();
     _spellDrawer = new SpellDescriptionDrawer();
     _spellDrawer.SetPosition(80, 35);
 }
Esempio n. 3
0
 public MainMenuView()
 {
     _rootConsole = RConsole.RootConsole;
     _rootWidth   = _rootConsole.Width;
     _rootHeight  = _rootConsole.Height;
     _menuConsole = new RConsole(9, 4);
     _menuDrawer  = new MenuDrawer();
 }
Esempio n. 4
0
        public PreGameView()
        {
            _console          = new RConsole(39, 61);
            _menuDrawer       = new MenuDrawer();
            _charDescDrawer   = new CharDescriptionDrawer();
            _statScreenDrawer = new StatScreenDrawer();
            _normAttackDrawer = new SpellDescriptionDrawer();
            _afflictionLister = new AfflictionLister();
            _spell1Drawer     = new SpellDescriptionDrawer();
            _spell2Drawer     = new SpellDescriptionDrawer();
            _spell3Drawer     = new SpellDescriptionDrawer();
            _spell4Drawer     = new SpellDescriptionDrawer();

            _charDescDrawer.SetPosition(43, 3);
            _statScreenDrawer.SetPosition(80, 3);
            _normAttackDrawer.SetPosition(43, 35);
            _afflictionLister.SetPosition(80, 35);

            _spell1Drawer.SetPosition(43, 3);
            _spell2Drawer.SetPosition(80, 3);
            _spell3Drawer.SetPosition(43, 35);
            _spell4Drawer.SetPosition(80, 35);
        }
Esempio n. 5
0
        /// <summary>
        /// Builds a menu based on the parameters given
        /// </summary>
        /// <typeparam name="T">The type of data the menu should hold</typeparam>
        /// <param name="parentControl">The parent control this menu resides in</param>
        /// <param name="appearance">The appearance of the menu<para>Leave null for default values</para></param>
        /// <param name="menuDrawer">The menu drawer to use when the menu needs to be drawn</param>
        /// <param name="tabDrawer">The tab drawer to use when a tab needs to be drawn</param>
        /// <param name="clickHandler">The click handler to use with the menu</param>
        /// <param name="locationDrawer">The location drawer the tab uses to finalize location dependent tab visuals</param>
        /// <param name="eventFunction">The function to execute when the tab changes</param>
        /// <returns>A Menu that conforms to the given parameters</returns>
        public static IMenu <T> Build <T>(Control parentControl, MenuAppearance appearance = null, IMenuDrawer menuDrawer = null, ITabDrawer tabDrawer = null, IClickHandler clickHandler = null, ITabLocationDrawer locationDrawer = null, EventHandler <TabChangedEventArgs <T> > eventFunction = null)
        {
            var menu = new Menu <T> {
                appearance       = appearance ?? MenuAppearance.GetDefaultAppearance(),
                allowRightClick  = false,
                parentControl    = parentControl,
                currentTabIndex  = -1,
                currentMouseMode = MouseModes.mouseClick,
                menuDrawer       = menuDrawer ?? new VerticalMenuDrawer(),
                tabDrawer        = tabDrawer ?? new VerticalTabDrawer(),
                clickHandler     = clickHandler ?? new VerticalClickHandler(),
            };

            parentControl.Paint      += menu.OnDraw;
            parentControl.MouseClick += menu.OnClick;

            if (locationDrawer != null)
            {
                menu.tabDrawer.tabLocationDrawer = locationDrawer;
            }

            if (eventFunction != null)
            {
                menu.tabChanged += eventFunction;
            }

            return(menu);
        }
Esempio n. 6
0
 public ActionSelectView()
 {
     _drawer     = new MenuDrawer();
     _statDrawer = new StatScreenDrawer();
 }