Dwarrowdelf.Server.Fortress.DungeonWorldCreator.GetLocNearEntry C# (CSharp) Method

GetLocNearEntry() static private method

static private GetLocNearEntry ( EnvironmentObject env ) : IntVector3?
env EnvironmentObject
return IntVector3?
        static IntVector3? GetLocNearEntry(EnvironmentObject env)
        {
            foreach (var p in IntVector2.SquareSpiral(env.StartLocation.ToIntVector2(), env.Width / 2))
            {
                if (env.Size.Plane.Contains(p) == false)
                    continue;

                var p3 = env.GetSurfaceLocation(p);

                if (env.CanEnter(p3))
                    return p3;
            }

            return null;
        }