public override IEnumerable <Coord> GetBoundary() { if (carvedModule == null) { throw new InvalidOperationException("Module not assigned."); } return(carvedModule.GetBoundary()); }
public override IEnumerable <Coord> GetBoundary() { var boundary = Enumerable.Empty <Coord>(); for (int i = 0; i < modules.Length; i++) { Coord offset = (Coord)offsets[i]; MapGenModule mod = modules[i]; boundary = boundary.Concat(mod.GetBoundary().Select(coord => coord + offset)); } return(boundary); }
public void Draw(Rect nodeRect, MapGenModule module, bool isSelected) { if (module != null) { Texture boundaryTexture = isSelected ? activeSquare : inactiveSquare; Vector2 center = WindowHelpers.RoundToLattice(nodeRect.center); Vector2 square = SQUARE_SIZE * Vector2.one; Rect rect = new Rect(center, square); foreach (Coord coord in module.GetBoundary()) { DrawBox(center, coord, rect, boundaryTexture); } Coord mapSize = module.GetMapSize(); Boundary boundary = new Boundary(mapSize.x, mapSize.y); foreach (MapEntrance entrance in module.GetOpenings()) { foreach (Coord coord in entrance.GetCoords(boundary)) { DrawBox(center, coord, rect, entranceSquare); } } } }
public override IEnumerable <Coord> GetBoundary() { return(carvedModule.GetBoundary()); }