Example #1
0
 public bool InRange(LocalCoordinates localpos, float range)
 {
     if (localpos.MapID != MapID)
     {
         return(false);
     }
     return((localpos.ToWorld().Position - ToWorld().Position).LengthSquared < range * range);
 }
Example #2
0
        /// <inheritdoc />
        public IMapGrid FindGridAt(LocalCoordinates worldPos)
        {
            var      pos  = worldPos.ToWorld().Position;
            IMapGrid grid = GetDefaultGrid();

            foreach (var kvGrid in _grids)
            {
                if (kvGrid.Value.AABBWorld.Contains(pos) && kvGrid.Value.Index != GridId.DefaultGrid)
                {
                    grid = kvGrid.Value;
                }
            }
            return(grid);
        }