public CollisionMap(byte type, int w, int h) { this.type = type; chunks = new CollisionNode <T> [ cW = (w + CHUNK_SIZE - 1) / CHUNK_SIZE, cH = (h + CHUNK_SIZE - 1) / CHUNK_SIZE]; this.w = w; this.h = h; }
public void InsertAfter(CollisionNode <T> node) { if (this.Next != null) { node.Next = this.Next; this.Next.Previous = node; } else { node.Next = null; } node.Previous = this; this.Next = node; }
public CollisionNode <T> Remove() { CollisionNode <T> ret = null; if (this.Previous != null) { ret = this.Previous; this.Previous.Next = this.Next; } if (this.Next != null) { ret = this.Next; this.Next.Previous = this.Previous; } this.Previous = null; this.Next = null; return(ret); }