public void OnFlip(Mobile m) { var list = IDTable.FirstOrDefault(l => l.Any(id => id == ItemID)); if (list != null) { var index = Array.IndexOf(list, ItemID); if (index == 0 || index == 2) { ItemID = list[index + 1]; } else if (index == 1 || index == 3) { ItemID = list[index - 1]; } } }