Beispiel #1
0
 public static bool Add(LinkedList<object> coll, object obj)
 {
     if (obj == null)
     {
         return false;
     }
     return coll.AddLast(obj) != null;
 }
Beispiel #2
0
		public void AddObject(Actor actor) {
			Type cls = actor.GetType();
			if (CollectionUtils.Contains(cls,this.collisionClasses)) {
				this.collisionChecker.AddObject(actor);
			} else {
				LinkedList classSet = (LinkedList) this.freeObjects.Get(cls);
				if (classSet == null) {
					classSet = new LinkedList();
					this.freeObjects.Put(cls, classSet);
				}
				CollectionUtils.Add(classSet,actor);
			}
		}
Beispiel #3
0
 public static bool AddAll(ICollection source, LinkedList dest)
 {
     return dest.AddAll(source);
 }
Beispiel #4
0
 public static object RemoveAt(LinkedList coll, int index)
 {
     object obj2 = coll[index];
     coll.RemoveAt(index);
     return obj2;
 }
Beispiel #5
0
 public static object Poll(LinkedList coll)
 {
     return coll.RemoveFirst();
 }
Beispiel #6
0
        private bool Ydirect(Grid start, Grid end, LinkedList path)
        {
            if (start.GetXpos() != end.GetXpos())
            {
                return false;
            }
            int direct = 1;
            if (start.GetYpos() > end.GetYpos())
            {
                direct = -1;
            }
            path.Clear();
            for (int y = start.GetYpos() + direct; y != end.GetYpos() && y < yBound
                    && y >= 0; y += direct)
            {
                if (grid[y][start.GetXpos()].IsVisible())
                {
                    return false;
                }
                path.Add(grid[y][start.GetXpos()]);
            }

            path.Add(end);
            return true;
        }
Beispiel #7
0
 private void DeletePair(Grid prev, Grid current)
 {
     LinkedList temp = new LinkedList();
     temp.Add(prev);
     for (int i = 0; i < pcount; i++)
     {
         temp.AddAll(path[i]);
         path[i].Clear();
     }
     AnimateThread thread = new AnimateThread(temp);
     thread.Tag = this;
     thread.Start();
 }
Beispiel #8
0
        private bool Xdirect(Grid start, Grid end, LinkedList path)
        {
            if (start.GetYpos() != end.GetYpos())
                return false;
            int direct = 1;
            if (start.GetXpos() > end.GetXpos())
            {
                direct = -1;
            }
            path.Clear();
            for (int x = start.GetXpos() + direct; x != end.GetXpos() && x < xBound
                    && x >= 0; x += direct)
            {
                if (grid[start.GetYpos()][x].IsVisible())
                {
                    return false;
                }
                path.Add(grid[start.GetYpos()][x]);
            }

            path.Add(end);
            return true;
        }
Beispiel #9
0
 private void Reset()
 {
     overFlag = false;
     failgame = false;
     if (path == null)
     {
         path = new LinkedList[3];
     }
     path[0] = new LinkedList();
     path[1] = new LinkedList();
     path[2] = new LinkedList();
     init = false;
     count = 0;
     if (progress != null)
     {
         progress.Set(progress_number);
     }
     InitUI();
 }
Beispiel #10
0
 public AnimateThread(LinkedList temp)
 {
     v = temp;
 }
Beispiel #11
0
 public LinkedList()
 {
     this.list = new LinkedList<object>();
 }
 public TaskQueue()
 {
     this.queue = new LinkedList();
 }