예제 #1
0
 //Null for player
 public static void AOE(this World world, Position pos, float radius, bool players, Action<Entity> callback)
 {
     if (players)
         foreach (Entity i in world.PlayersCollision.HitTest(pos.X, pos.Y, radius))
         {
             double d = MathsUtils.Dist(i.X, i.Y, pos.X, pos.Y);
             if (d < radius)
                 callback(i);
         }
     else
         foreach (Entity i in world.EnemiesCollision.HitTest(pos.X, pos.Y, radius))
         {
             if (!(i is Enemy)) continue;
             double d = MathsUtils.Dist(i.X, i.Y, pos.X, pos.Y);
             if (d < radius)
                 callback(i);
         }
 }
예제 #2
0
 public static Position Read(NReader rdr)
 {
     Position ret = new Position();
     ret.X = rdr.ReadSingle();
     ret.Y = rdr.ReadSingle();
     return ret;
 }