コード例 #1
0
ファイル: Collision.cs プロジェクト: Perfect-GH/PrivateServer
 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;
 }
コード例 #2
0
ファイル: Collision.cs プロジェクト: Perfect-GH/PrivateServer
        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;
        }
コード例 #3
0
ファイル: Collision.cs プロジェクト: Perfect-GH/PrivateServer
        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);
        }