Skip to content
Snippets Groups Projects
Commit e1ca4666 authored by Elias Leinenweber's avatar Elias Leinenweber
Browse files

Crée Designer MapView

parent 180f0c0e
Branches
Tags
No related merge requests found
......@@ -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>
......
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
......@@ -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);
}
}
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment