static void WriteTurb(Dictionary <int, Engine> collection) { foreach (KeyValuePair <int, Engine> elem in collection) { TurbojetEngine someEng = elem.Value as TurbojetEngine; if (someEng != null) { someEng.Show(); } } }
static void WriteTurb(Queue collection) { foreach (object elem in collection) { TurbojetEngine someEng = elem as TurbojetEngine; if (someEng != null) { someEng.Show(); } } }