コード例 #1
0
        public Level(EventListener sysCall, StaticData sdb, ViewDB vdb, Viewport view)
        {
            disp = new EventDispatcher();

            state = new State(sdb);
            op    = new Operator();
            gui   = new GUI(vdb, view, op.OnSelect, disp);

            disp.MapInput(InputType.MouseLeft_Up, EventType.Select);
            disp.MapInput(InputType.MouseRight_Up, EventType.Action);

            disp.MapInput(InputType.RightShift_Down, EventType.Waypoint);
            disp.MapInput(InputType.RightShift_Up, EventType.WaypointOff);
            disp.MapInput(InputType.LeftShift_Down, EventType.Waypoint);
            disp.MapInput(InputType.LeftShift_Up, EventType.WaypointOff);

            disp.MapInput(InputType.Up_Down, EventType.CameraUp);
            disp.MapInput(InputType.Right_Down, EventType.CameraRight);
            disp.MapInput(InputType.Down_Down, EventType.CameraDown);
            disp.MapInput(InputType.Left_Down, EventType.CameraLeft);
            disp.MapInput(InputType.Up_Up, EventType.CameraUpEnd);
            disp.MapInput(InputType.Right_Up, EventType.CameraRightEnd);
            disp.MapInput(InputType.Down_Up, EventType.CameraDownEnd);
            disp.MapInput(InputType.Left_Up, EventType.CameraLeftEnd);

            disp.MapInput(InputType.Escape_Up, EventType.End);

            disp.AddListener(this, EventType.Game);
            disp.AddListener(sysCall, EventType.System);
        }
コード例 #2
0
        public Level CreateLevel(InGameScreen screen)
        {
            StaticData sdb = screen.Load <StaticData>("Entities/entities");
            ViewDB     vdb = new ViewDB();

            vdb.Put("red", screen.Load <Texture2D>("Image/red"));
            vdb.Put("blue", screen.Load <Texture2D>("Image/blue"));
            vdb.Put("bg", screen.Load <Texture2D>("Image/bg"));
            vdb.Put("anim", screen.Load <AnimatedTexture2D>("Image/test"));
            vdb.Put("animSelect", screen.Load <AnimatedTexture2D>("Image/testSelect"));
            return(new Level(screen, sdb, vdb, new Viewport(0, 0, 800, 400)));
        }
コード例 #3
0
 private void bViewFoodItem_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         Button b      = sender as Button;
         ViewDB viewDB = new ViewDB();
         viewDB.Show();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.ToString());
     }
 }
コード例 #4
0
        static public void Destroy()
        {
            for (int i = 0; i < 4; i++)
            {
                if (TestDB[i] != null)
                {
                    TestDB[i].Close();
                }
            }

            if (ViewDB != null)
            {
                ViewDB.Close();
            }

            if (ConfigDB != null)
            {
                ConfigDB.Close();
            }
        }
コード例 #5
0
ファイル: Program.cs プロジェクト: esim7/homewWork8
        static void Main(string[] args)
        {
            string connectionString = "Server=DESKTOP-RM1NBDJ;Database=Teams;Trusted_Connection=True;";

            int         pageSize   = 3;
            int         pageNumber = 0;
            MiniContext context    = new MiniContext(connectionString);
            ViewDB      viewer     = new ViewDB(context);
            bool        isExit     = false;

            while (!isExit)
            {
                Console.Clear();
                try
                {
                    viewer.PaginationShow(pageSize, pageNumber);
                }
                catch (ArgumentOutOfRangeException excepton)
                {
                    Console.WriteLine("Ошибка, что продолжить просмотр листай страницу вперед");
                }
                Console.WriteLine("\n\n1. Следущая страница \n2. Предыдущая страница \n3. Выход");
                string action = Console.ReadLine();
                if (action == "1")
                {
                    ++pageNumber;
                }
                else if (action == "2")
                {
                    --pageNumber;
                }
                else if (action == "3")
                {
                    isExit = true;
                }
            }
        }