Dwarrowdelf.EnvironmentExtensions.GetPossibleMiningPositioning C# (CSharp) Method

GetPossibleMiningPositioning() public static method

Get possible positioning to perform mining to given location
public static GetPossibleMiningPositioning ( this env, IntVector3 p, MineActionType mineActionType ) : DirectionSet
env this
p IntVector3
mineActionType MineActionType
return DirectionSet
        public static DirectionSet GetPossibleMiningPositioning(this IEnvironmentObject env, IntVector3 p,
			MineActionType mineActionType)
        {
            DirectionSet ds;

            switch (mineActionType)
            {
                case MineActionType.Mine:
                    ds = DirectionSet.Planar;

                    if (env.GetTileData(p.Up).IsClear)
                    {
                        ds |= DirectionSet.DownNorth |
                            DirectionSet.DownEast |
                            DirectionSet.DownSouth |
                            DirectionSet.DownWest;
                    }

                    break;

                case MineActionType.Stairs:
                    ds = DirectionSet.Planar | DirectionSet.Down;

                    if (env.CanMoveFrom(p.Down, Direction.Up))
                        ds |= DirectionSet.Up;

                    break;

                default:
                    throw new Exception();
            }

            return ds;
        }