public DNAEntry(string key, uint hashCode, int length, DNAEntry next) { Key = key; HashCode = hashCode; Positions = new DNAPos[length]; Count = 0; Next = next; }
/// <summary> /// Add Posion /// </summary> /// <param name="x">X Posion</param> /// <param name="y">Y Posion</param> public void Add(int x, int y) { if (Count == Positions.Length) { Resize(Positions.Length + 100); } Positions[Count] = new DNAPos(x, y); Count++; }
private void Resize(int newSize) { if (newSize < Positions.Length) { return; } DNAPos[] newpos = new DNAPos[newSize]; Array.Copy(Positions, newpos, Positions.Length); Positions = newpos; }