public virtual void ReadChildData(BinaryReader reader) { int x = 0; for (x = 0; (x < _permutations.Count); x = (x + 1)) { Permutations.Add(new SoundPermutationsBlock()); Permutations[x].Read(reader); } for (x = 0; (x < _permutations.Count); x = (x + 1)) { Permutations[x].ReadChildData(reader); } }
public virtual void ReadChildData(BinaryReader reader) { int x = 0; _name.ReadString(reader); for (x = 0; (x < _permutations.Count); x = (x + 1)) { Permutations.Add(new DecoratorPermutationsBlockBlock()); Permutations[x].Read(reader); } for (x = 0; (x < _permutations.Count); x = (x + 1)) { Permutations[x].ReadChildData(reader); } }
public Region(CacheBase Cache, int Address) { EndianReader Reader = Cache.Reader; Reader.SeekTo(Address); Name = Cache.Strings.GetItemByID(Reader.ReadInt32()); int iCount = Reader.ReadInt32(); int iOffset = Reader.ReadInt32() - Cache.Magic; for (int i = 0; i < iCount; i++) { Permutations.Add(new Permutation(Cache, iOffset + 24 * i)); } }
/// <summary> /// Builds permutations of a byte array. /// </summary> /// <param name="digits">The digits</param> /// <param name="n">The n</param> /// <param name="i">The i</param> public void DoPermute(ref byte[] digits, ref int n, ref int i) { if (i == n) { long temp = Numbers.JoinDigits(digits); Permutations.Add(temp); } else { for (int j = i; j < n; j++) { SwapValues(ref digits, ref i, ref j); int temp = i + 1; DoPermute(ref digits, ref n, ref temp); SwapValues(ref digits, ref i, ref j); } } }
private void go(char[] list, int k, int m) { int i; if (k == m) { Permutations.Add(new string(list)); } else { for (i = k; i <= m; i++) { swap(ref list[k], ref list[i]); go(list, k + 1, m); swap(ref list[k], ref list[i]); } } }
public Region(CacheBase Cache, int Address) { EndianReader Reader = Cache.Reader; Reader.SeekTo(Address); Name = Reader.ReadNullTerminatedString(32); Reader.ReadInt16(); Reader.ReadInt32(); Reader.SeekTo(Address + 0x40); int iCount = Reader.ReadInt32(); int iOffset = Reader.ReadInt32() - Cache.Magic; for (int i = 0; i < iCount; i++) { Permutations.Add(new Permutation(Cache, iOffset + 88 * i)); } }
public ScannerBeacon(string input, Scanner scanner) { Scanner = scanner; var parts = input.Split(','); X = long.Parse(parts[0]); Y = long.Parse(parts[1]); Z = long.Parse(parts[2]); Permutations.Add(new Coordinate3d(X, Y, Z)); Permutations.Add(new Coordinate3d(X, Z, Y)); Permutations.Add(new Coordinate3d(Y, X, Z)); Permutations.Add(new Coordinate3d(Y, Z, X)); Permutations.Add(new Coordinate3d(Z, X, Y)); Permutations.Add(new Coordinate3d(Z, Y, X)); Permutations.Add(new Coordinate3d(-X, Y, Z)); Permutations.Add(new Coordinate3d(-X, Z, Y)); Permutations.Add(new Coordinate3d(-Y, X, Z)); Permutations.Add(new Coordinate3d(-Y, Z, X)); Permutations.Add(new Coordinate3d(-Z, X, Y)); Permutations.Add(new Coordinate3d(-Z, Y, X)); Permutations.Add(new Coordinate3d(-X, -Y, Z)); Permutations.Add(new Coordinate3d(-X, -Z, Y)); Permutations.Add(new Coordinate3d(-Y, -X, Z)); Permutations.Add(new Coordinate3d(-Y, -Z, X)); Permutations.Add(new Coordinate3d(-Z, -X, Y)); Permutations.Add(new Coordinate3d(-Z, -Y, X)); Permutations.Add(new Coordinate3d(-X, -Y, -Z)); Permutations.Add(new Coordinate3d(-X, -Z, -Y)); Permutations.Add(new Coordinate3d(-Y, -X, -Z)); Permutations.Add(new Coordinate3d(-Y, -Z, -X)); Permutations.Add(new Coordinate3d(-Z, -X, -Y)); Permutations.Add(new Coordinate3d(-Z, -Y, -X)); }