public void AddTo(double x, double z, string type, bool invert) { if (!stripping) { throw new InvalidOperationException("Can't add wall: strip belum mulai."); } if (!this.stripStarted) { throw new InvalidOperationException("Can't add wall: butuh tembok untuk memulai strip"); } Wall last = this.last; Wall next; if (!invert) { next = WallBuilder.BuildWall(last.To, new Point3D(x, 0, z), bottom, height, type); } else { next = new InvertedWall(WallBuilder.BuildWall(new Point3D(x, 0, z), last.To, bottom, height, type)); } this.walls.Add(next); last.after = next.To; next.before = last.From; this.last = next; this.closewall(); }
public void AddTo(double x, double z, string type, bool invert) { if (!stripping) { throw new InvalidOperationException("Can't add wall: strip not started."); } if (!this.stripStarted) { throw new InvalidOperationException("Can't add wall: need the first wall of the strip"); } Wall last = this.last; //(Wall)walls[walls.Count-1]; Wall next; if (!invert) { next = WallBuilder.BuildWall(last.To, new Point3D(x, 0, z), bottom, height, type); } else { next = new InvertedWall(WallBuilder.BuildWall(new Point3D(x, 0, z), last.To, bottom, height, type)); } this.walls.Add(next); last.after = next.To; next.before = last.From; this.last = next; this.closewall(); }