Esempio n. 1
0
 public void ItDefinesPointsInAWall(string dim, string assertions)
 {
     var box = new WallPlan(Dimension.Parse(dim));
     var points = new HashSet<Location>(box.GetLocations());
     var expected = assertions.Split('|').Select(Location.Parse).ToList();
     foreach (var loc in expected)
     {
         Assert.That(points.Contains(loc), "Does not contain " + loc);
     }
     Assert.AreEqual(expected.Count, points.Count);
 }
Esempio n. 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));
     }
 }