public static void UnlockDoors(BaseDoor door) { ArrayList list = new ArrayList(); foreach (Item item in door.GetItemsInRange(1)) { if (item is BaseDoor) { list.Add(item); } } foreach (Item item in list) { BaseDoor iDoor = (BaseDoor)item; iDoor.Locked = false; } }