diff --git a/Wanderer.csproj b/Wanderer.csproj index 1868afb056dfe1484d21fec9d52167d1d10e2de0..91c3b56e9ac86c6214eab97792c8ed5f18582808 100644 --- a/Wanderer.csproj +++ b/Wanderer.csproj @@ -47,6 +47,7 @@ <Reference Include="System.Xml" /> </ItemGroup> <ItemGroup> + <Compile Include="view\Controls\MapView.Designer.cs" /> <Compile Include="view\FormFin.cs"> <SubType>Form</SubType> </Compile> diff --git a/view/Controls/MapView.Designer.cs b/view/Controls/MapView.Designer.cs new file mode 100644 index 0000000000000000000000000000000000000000..2e078c1df1efd7a5305a9cef1f7435f0909c512b --- /dev/null +++ b/view/Controls/MapView.Designer.cs @@ -0,0 +1,23 @@ +using System.ComponentModel; + +namespace Wanderer.view.Controls +{ + public partial class MapView + { + private IContainer components = null; + + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) { + components.Dispose(); + } + base.Dispose(disposing); + } + + private void InitializeComponent() + { + this.SuspendLayout(); + this.ResumeLayout(false); + } + } +} \ No newline at end of file diff --git a/view/Controls/MapView.cs b/view/Controls/MapView.cs index af665ca8a699769a569406a5117810e689e8e917..71fbd8b707485fef1ed47f2d9b591344bd45f542 100644 --- a/view/Controls/MapView.cs +++ b/view/Controls/MapView.cs @@ -2,16 +2,22 @@ namespace Wanderer.view.Controls { - public class MapView : TableLayoutPanel + public partial class MapView : TableLayoutPanel { private TileView[,] tileViews; public MapView(Map map) { - for (int i = 0; i < map.Tiles.GetLength(0); ++i) - for (int j = 0; j < map.Tiles.GetLength(1); ++j) + InitializeComponent(); + + ColumnCount = map.Tiles.GetLength(0); + RowCount = map.Tiles.GetLength(1); + + for (int i = 0; i < ColumnCount; ++i) + for (int j = 0; j < RowCount; ++j) { tileViews[i, j] = new TileView(map.Tiles[i, j]); + Controls.Add(tileViews[i, j], i, j); } } }