private HashSet <Vec> BuildCandidates()
        {
            var result = new HashSet <Vec>();

            for (int x = 0; x < state.Matrix.R; x++)
            {
                for (int y = 0; y < state.Matrix.R; y++)
                {
                    for (int z = 0; z < state.Matrix.R; z++)
                    {
                        var vec = new Vec(x, y, z);
                        if (state.TargetMatrix[vec] &&
                            !state.Matrix[vec] &&
                            (y == 0 || vec.GetMNeighbours(state.Matrix).Any(nvec => state.Matrix[nvec])))
                        {
                            result.Add(vec);
                        }
                    }
                }
            }
            return(result);
        }
 private bool CanFill(bool[,,] buildingMatrix, [NotNull] Vec vec)
 {
     return(vec.Y == 0 || vec.GetMNeighbours().Where(x => x.IsInCuboid(N)).Any(buildingMatrix.Get));
 }
示例#3
0
 private Vec GetGrounded(Vec vec)
 {
     return(vec.GetMNeighbours().FirstOrDefault(p => p.IsInCuboid(R) && isGrounded.Get(p)));
 }
示例#4
0
 private bool CanFill([NotNull] DeluxeState state, [NotNull] Vec vec)
 {
     return(vec.Y == 0 || vec.GetMNeighbours().Where(x => x.IsInCuboid(state.Matrix.R)).Any(x => !state.Matrix.IsVoidVoxel(x)));
 }