public AvailableMapsScrollController(AvailableMapsView mapsView) { this.mapsView = mapsView; lastMouse = Mouse.GetState(); ControllerGroupId = new HashSet <int>(); Enabled = true; }
public SelectMapScreen() { //MapManager.LoadMap(MapManager.CreateMap(MapManager.Maps[0], Game1.Graphics)); AvailableMapsView mapsView = new AvailableMapsView(); ButtonManager buttonManager = new ButtonManager(); // Controllers. controllers.Add(new AvailableMapsScrollController(mapsView)); controllers.Add(new SelectMapController(mapsView, buttonManager)); controllers.Add(buttonManager); // Views. views.Add(mapsView); views.Add(buttonManager); }
public SelectMapController(AvailableMapsView mapsView, ButtonManager buttonManager) { this.mapsView = mapsView; this.buttonManager = buttonManager; buttons = new List <Button>(); for (int i = 0; i < MapManager.TotalLoadedMaps; i++) { buttons.Add(new Button(Vector2.Zero, mapsView.ThumbnailSize.ToVector2()) { AttachedObject = i, Visible = false }); buttons[i].OnClicked += OnButtonClicked; } buttonManager.AddButtons(buttons); ControllerGroupId = new HashSet <int>(); Enabled = true; }