// Copyright (c) Strange Loop Games. All rights reserved.
// See LICENSE file in the project root for full license information.

namespace Eco.Mods.TechTree
{
    using System.Linq;
    using Eco.Gameplay.Objects;
    using Eco.Gameplay.Players;
    using Eco.Gameplay.Items;
    using Eco.Shared.Math;
    using Eco.World.Blocks;
    public partial class WoodenElevatorItem : WorldObjectItem<WoodenElevatorObject>
    {
        // Elevators are shaft-mounted, they do not require a surface.
        public override DirectionAxisFlags RequiresSurfaceOnSides { get; } = DirectionAxisFlags.None;
        
        /// <summary> Special placement logic for elevators since they are meant to only care about the existence of solid ground below regardless of the depth of their shafts (wells). </summary>
        public override bool TryPlaceObject(Player player, Vector3i worldPos, Quaternion rotation) => OccupancyHelper.IsValidShaftPlacement(player, worldPos, rotation, this.WorldObjectType, this.DisplayName);
    }
}
