private ComboMove AddComboData(ComboEntry comboEntry, ComboData comboData, int depth) { if (comboData.Moves.Count <= depth) { return(null); } ComboMove move = comboData.Moves.ElementAt(depth); ComboEntry nextComboEntry = null; foreach (IComboEntry entry in comboEntry.comboEntries) { if (move.Equals(entry.Move)) { nextComboEntry = (ComboEntry)entry; break; } } if (null == nextComboEntry) { nextComboEntry = new ComboEntry { Move = move, }; comboEntry.comboEntries.Add(nextComboEntry); } AddComboData(nextComboEntry, comboData, depth + 1); return(move); }