private static void MoveAwayFrom(Point location, int player) { bool[] flagArray; if (!PressurePlateHelper.PressurePlatesPressed.TryGetValue(location, out flagArray)) { return; } flagArray[player] = false; bool flag = false; for (int index = 0; index < flagArray.Length; ++index) { if (flagArray[index]) { flag = true; break; } } if (flag) { return; } PressurePlateHelper.PressurePlatesPressed.Remove(location); PressurePlateHelper.PokeLocation(location); }
public static void DestroyPlate(Point location) { bool[] array; if (PressurePlateHelper.PressurePlatesPressed.TryGetValue(location, out array)) { PressurePlateHelper.PressurePlatesPressed.Remove(location); PressurePlateHelper.PokeLocation(location); } }
public static void DestroyPlate(Point location) { bool[] flagArray; if (!PressurePlateHelper.PressurePlatesPressed.TryGetValue(location, out flagArray)) { return; } PressurePlateHelper.PressurePlatesPressed.Remove(location); PressurePlateHelper.PokeLocation(location); }
private static void MoveInto(Point location, int player) { bool[] array; if (PressurePlateHelper.PressurePlatesPressed.TryGetValue(location, out array)) { array[player] = true; return; } PressurePlateHelper.PressurePlatesPressed[location] = new bool[255]; PressurePlateHelper.PressurePlatesPressed[location][player] = true; PressurePlateHelper.PokeLocation(location); }
public static void Update() { if (!PressurePlateHelper.NeedsFirstUpdate) { return; } foreach (Point key in PressurePlateHelper.PressurePlatesPressed.Keys) { PressurePlateHelper.PokeLocation(key); } PressurePlateHelper.PressurePlatesPressed.Clear(); PressurePlateHelper.NeedsFirstUpdate = false; }
private static void MoveInto(Point location, int player) { bool[] flagArray; if (PressurePlateHelper.PressurePlatesPressed.TryGetValue(location, out flagArray)) { flagArray[player] = true; } else { PressurePlateHelper.PressurePlatesPressed[location] = new bool[(int)byte.MaxValue]; PressurePlateHelper.PressurePlatesPressed[location][player] = true; PressurePlateHelper.PokeLocation(location); } }
public static void Update() { if (!PressurePlateHelper.NeedsFirstUpdate) { return; } using (Dictionary <Point, bool[]> .KeyCollection.Enumerator enumerator = PressurePlateHelper.PressurePlatesPressed.Keys.GetEnumerator()) { while (enumerator.MoveNext()) { PressurePlateHelper.PokeLocation(enumerator.Current); } } PressurePlateHelper.PressurePlatesPressed.Clear(); PressurePlateHelper.NeedsFirstUpdate = false; }
private static void MoveAwayFrom(Point location, int player) { bool[] array; if (PressurePlateHelper.PressurePlatesPressed.TryGetValue(location, out array)) { array[player] = false; bool flag = false; for (int i = 0; i < array.Length; i++) { if (array[i]) { flag = true; break; } } if (!flag) { PressurePlateHelper.PressurePlatesPressed.Remove(location); PressurePlateHelper.PokeLocation(location); } } }