Esempio n. 1
0
			public AStarFinder Contains(AStarFinder element) {
				for (IIterator it = new IteratorAdapter(queue.GetEnumerator()); it.HasNext();) {
                    AStarFinder af = (AStarFinder)it.Next();
					if (af.Equals(element)) {
						return af;
					}
				}
				return null;
			}
Esempio n. 2
0
 /// <summary>
 /// 删除指定集合中的所有角色
 /// </summary>
 ///
 /// <param name="obj"></param>
 public void RemoveObjects(IList obj)
 {
     if (isClose)
     {
         return;
     }
     lock (obj)
     {
         IIterator iter = new IteratorAdapter(obj.GetEnumerator());
         while (iter.HasNext())
         {
             Actor actor = (Actor)iter.Next();
             this.RemoveObject(actor);
         }
     }
 }
Esempio n. 3
0
 public override string ToString()
 {
     ICollection<string> set = this.attributes.Keys;
     string str1 = "<" + this.name;
     for (IIterator it = new IteratorAdapter(set.GetEnumerator()); it.HasNext(); )
     {
         string str2 = (string)it.Next();
         str1 = str1 + " " + str2 + " = \"" + GetAttribute(str2).GetValue()
                 + "\"";
     }
     str1 = str1 + ">";
     str1 = str1 + GetContents();
     str1 = str1 + "</" + this.name + ">";
     return str1;
 }
Esempio n. 4
0
 public void Draw(GLEx g, int x, int y)
 {
     LColor oldColor = g.GetColor();
     g.SetColor(color);
     switch (style)
     {
         case 0:
             float alpha = 0.0f;
             int nx = x + width / 2 - (int)r * 4,
             ny = y + height / 2 - (int)r * 4;
             g.Translate(nx, ny);
             for (IIterator it = new IteratorAdapter(list.GetEnumerator()); it.HasNext(); )
             {
                 RectBox s = (RectBox)it.Next();
                 alpha = alpha + 0.1f;
                 g.SetAlpha(alpha);
                 g.FillOval(s.x, s.y, s.width, s.height);
             }
             g.SetAlpha(1.0F);
             g.Translate(-nx, -ny);
             break;
         case 1:
             g.SetLineWidth(10);
             g.Translate(x, y);
             g.SetColor(Fill);
             g.DrawOval(0, 0, width, height);
             int sa = angle % 360;
             g.FillArc(x + (width - paintWidth) / 2, y
                     + (height - paintHeight) / 2, paintWidth, paintHeight,
                     sa, sa + ANGLE_STEP);
             g.Translate(-x, -y);
             g.ResetLineWidth();
             break;
     }
     g.SetColor(oldColor);
 }