private void Click_CellLabel(Point P, Control CellLabel) { CellLabel.MouseDown += (object s, MouseEventArgs ev) => { if (Room.Map[P.X, P.Y] == null) { CellLabel.Dispose(); } else if (Processing != Process.None) { switch (Room.Map[P.X, P.Y].type) { case Process.SetAgent: if (Processing == Process.SetAgent) { Room.EmptyFloor(P); Room.DCAgent = null; SetManually_Agent_Direction.Enabled = false; CellLabel.Dispose(); } break; case Process.SetObstacles: if (Processing == Process.SetObstacles) { bool isMovable = false; if (ev.Button == MouseButtons.Right) { isMovable = true; } if (Room.Map[P.X, P.Y].isMovable == isMovable) { Room.EmptyFloor(P); CellLabel.Dispose(); } else { Room.Map[P.X, P.Y].UpdateMovableState(isMovable); CellLabel.Text = ((Obstacle)Room.Map[P.X, P.Y]).ToString(); } } break; } } RoomDisplay.Refresh(); }; }
public void UpdateMap() { foreach (RoomObject RObj in UpdatableObject) { RObj.Update(); } MForm.Processing = Process.SetDust; Random r = new Random(); MForm.SRForm.Random(r.Next(-10, 2), null); MForm.Processing = Process.None; Display.Refresh(); }