예제 #1
0
 public void ItDefinesPointsInABox(string dim, string assertions)
 {
     var box = new BoxPlan(Dimension.Parse(dim));
     var points = new HashSet<Location>(box.GetLocations());
     foreach (var loc in assertions.Split('|').Select(Location.Parse))
     {
         Assert.That(points.Contains(loc));
     }
 }
예제 #2
0
 public void Build(IBlockStamp stamp, Transform transform)
 {
     IShapePlan plan = null;
     switch (_shape)
     {
         case BuildShape.Box:
             plan = new BoxPlan(_dimension);
             break;
         case BuildShape.Wall:
             plan = new WallPlan(_dimension);
             break;
         default: throw new RuntimeException("Unknown shape: " + _shape);
     }
     foreach (var location in plan.GetLocations()
                 .Select(x => new Location(
                     x.X*_toBuild.Width + Location.X + transform.X,
                     x.Z*_toBuild.Depth + Location.Z + transform.Z,
                     x.Y*_toBuild.Height + Location.Y + transform.Y
                     )))
     {
         _toBuild.Build(stamp, new Transform(location.X, location.Z, location.Y));
     }
 }