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); }
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))); }
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()); } }
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(); } }
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; } } }