예제 #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 UI(ViewDB db_, Camera c_, SelectionCallback onSelect_)
        {
            db = db_;
            c = c_;

            newSel = new Point(-1, -1);

            onSelect = onSelect_;
        }
예제 #3
0
        public UI(ViewDB db_, Camera c_, SelectionCallback onSelect_)
        {
            db = db_;
            c  = c_;

            newSel = new Point(-1, -1);

            onSelect = onSelect_;
        }
예제 #4
0
        public GUI(ViewDB db_, Viewport v, SelectionCallback onSelect, EventDispatcher disp)
        {
            db = db_;
            c  = new Camera(0, 0, v);

            r  = new Renderer(db, c);
            ui = new UI(db, c, onSelect);

            disp.AddListener(r, EventType.View);
            disp.AddListener(ui, EventType.UI);
        }
예제 #5
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));
 }
예제 #6
0
        public GUI(ViewDB db_, Viewport v, SelectionCallback onSelect, EventDispatcher disp)
        {
            db = db_;
            c = new Camera(0, 0, v);

            r = new Renderer(db, c);
            ui = new UI(db, c, onSelect);

            disp.AddListener(r, EventType.View);
            disp.AddListener(ui, EventType.UI);
        }
예제 #7
0
 public Renderer(ViewDB db_, Camera c_)
 {
     db = db_;
     c = c_;
     xPan = yPan = 0;
 }
예제 #8
0
 public Renderer(ViewDB db_, Camera c_)
 {
     db   = db_;
     c    = c_;
     xPan = yPan = 0;
 }