Пример #1
0
        private bool CheckCollisionMapAtOffset(EditorMapPart part, int x, int y)
        {
            HashSet<Vec2I> collisions = part.GetCollisionsAt(x, y);

            if (collisions == null)
                return false;

            // Check each list of coordinates.
            // The collision is only valid if the list doesn't point to an object
            return (from coords in collisions
                    from layer in part.Layers
                    select layer.GetBrushAt(coords.x, coords.y)).Any(brush =>
                        brush != null &&
                        brush.FrontAsset != null &&
                        !(brush.FrontAsset is StarboundObject));
        }