public Form1() { InitializeComponent(); _grid = new FieldGrid(20, 1920, 1080); Zoom.SelectedIndex = 10; }
private void SetAttr_Click(object sender, EventArgs e) { int screenWidth = 1920, screenHeigth = 1080; if (!String.IsNullOrEmpty(SW.Text)) { Int32.TryParse(SW.Text, out screenWidth); } if (!String.IsNullOrEmpty(SH.Text)) { Int32.TryParse(SH.Text, out screenHeigth); } _grid = new FieldGrid(20, screenWidth, screenHeigth); Map.Invalidate(); }
public void LoadMap(FieldGrid grid) { grid.ClearField(); foreach (EntityInfo info in _entity) { switch (info.Type) { case "Player": grid.LoadPlayer(info.Position.X, info.Position.Y); break; case "AI": grid.LoadAI(info.Position.X, info.Position.Y); break; case "Block": grid.LoadBlock(info.Position.X, info.Position.Y); break; } } }