/// <summary> /// Constructor: Create a Row of a specified number of tiles /// </summary> /// <param name="width">Number of tiles to create</param> public Row(Map parent, int width) { _cols = new List<Tile>(); for (int count = 0; count < width; count++) { _cols.Add(new Tile(this)); } _parent = parent; }
public Dispatcher(MainWindow opener) { // References to Frontend and Backend objects _opener = opener; _input = new Input(this); _timer = new EventLoop(this); _output = new Draw(this); _toolbox = new Toolbox(this, "images/terrain_atlas.png", new System.Drawing.Rectangle(_opener.ClientRectangle.Width - 325, 60, 320, _opener.ClientRectangle.Height - 130)); _map = new Backend.Map(this, "start"); if (_map.Width < 1) { _map = new Backend.Map(this, 10, 10, false); } _attachedImagePos = new System.Drawing.Rectangle(); // Hook up Delegates Refresh += _output.Refresh; Move += _input.Move; Click += _input.Click; Keyboard += _input.Keyboard; Repaint(); // Generate lists for interaction objects _buttons = new List<Crawler.Frontend.Button>(); _mapview = new MapTiles(this); _buttons.Add(new Frontend.Button("Map-Level", ToggleMap, 120, -1, -1, _opener.ClientRectangle.Height - 28)); _buttons.Add(new Frontend.Button("Quit", Quit, -1, 5, _opener.ClientRectangle.Width - 5, -1)); // _buttons.Add(new Frontend.Button("Edit", Edit, -1, 5, _opener.ClientRectangle.Width - 64, -1)); _buttons.Add(new Frontend.Button("Save", Save, -1, 5, _opener.ClientRectangle.Width - 114, -1)); // _buttons.Add(new Frontend.Button("File", File, -1, 5, _opener.ClientRectangle.Width - 177, -1)); _buttons.Add(new Frontend.Button("+", ZoomPageIn, -1, -1, _opener.ClientRectangle.Width - 130, _opener.ClientRectangle.Height - 28)); _buttons.Add(new Frontend.Button("-", ZoomPageOut, -1, -1, _opener.ClientRectangle.Width - 105, _opener.ClientRectangle.Height - 28)); _buttons.Add(new Frontend.Button("+", ZoomMapIn, 55, -1, -1, _opener.ClientRectangle.Height - 28)); _buttons.Add(new Frontend.Button("-", ZoomMapOut, 29, -1, -1, _opener.ClientRectangle.Height - 28)); _buttons.Add(new Frontend.Button("<", PrevPage, -1, -1, _opener.ClientRectangle.Width - 50, _opener.ClientRectangle.Height - 28)); _buttons.Add(new Frontend.Button(">", NextPage, -1, -1, _opener.ClientRectangle.Width - 17, _opener.ClientRectangle.Height - 28)); }