Exemplo n.º 1
0
        private static bool HasNoImpediments(Decorators.FarmAnimal moddedAnimal, Location moddedLocation)
        {
            var boundingBox = moddedAnimal.GetBoundingBox();

            for (var corner = 0; corner < 4; ++corner)
            {
                var cornersOfThisRectangle = StardewValley.Utility.getCornersOfThisRectangle(ref boundingBox, corner);
                var key = new Vector2(cornersOfThisRectangle.X / 64f, cornersOfThisRectangle.Y / 64f);
                if (moddedLocation.GetOriginal().terrainFeatures.ContainsKey(key) ||
                    moddedLocation.GetOriginal().objects.ContainsKey(key))
                {
                    return(false);
                }
            }

            return(true);
        }