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); }
public void Initialize(IReadOnlyCollection <ComboData> combos) { _rootComboEntry.comboEntries.Clear(); bool hasDirectionlessOpener = false; foreach (ComboData comboData in combos) { ComboMove openerMove = AddComboData(_rootComboEntry, comboData, 0); hasDirectionlessOpener = hasDirectionlessOpener || (null != openerMove && openerMove.IsDirectionlessAttack); } Assert.IsTrue(hasDirectionlessOpener, "Brawler combo requires a directionless opener attack"); }