private void SetDoor(DoorType type) { if (type == DoorType.Invalid) { Screen.DeleteDoor(this.side); } else { bool found = false; foreach (DoorInstance d in Screen.Doors) { if (d.Side == this.side) { DoorInstance dd = d; dd.Type = type; found = true; } } if (!found) { Screen.AddDoor(type, this.side); } } }