private static void GetAdjacentRunesRecursivelyHelper(Rune startRune, HashSet<Rune> visitedRunes) { visitedRunes.Add(startRune); foreach (Rune adjacentRune in startRune.AdjacentRunes) { if(!visitedRunes.Contains(adjacentRune)) GetAdjacentRunesRecursivelyHelper(adjacentRune, visitedRunes); } }
private void CreateRuneAdjacency(Rune r1, Rune r2) { r1.AdjacentRunes.Add(r2); r2.AdjacentRunes.Add(r1); }
public static HashSet<Rune> GetAdjacentRunesRecursively(Rune startRune) { HashSet<Rune> visitedRunes = new HashSet<Rune>(); GetAdjacentRunesRecursivelyHelper(startRune, visitedRunes); return visitedRunes; }
public RuneBoundParticleSwarm(int particleCount, Rune rune) : base(particleCount, rune.Position, RuneColor(rune.GetType())) { this.Rune = rune; rune.particleSwarm = this; }