public void ApplyParams(RoomGenerationParams generationParams) { this.FillTileType = generationParams.FillTileType; this.NumberOfRooms = generationParams.NumberOfRooms; this.RoomMinSize = generationParams.RoomMinSize; this.RoomMaxSize = generationParams.RoomMaxSize; this.MaxRetries = generationParams.MaxRetries; this.Rooms = new List<Rect>(); }
private void runAutomata(int finalFrame) { for (int i = this.CurrentPhase.FramesElapsed; i < finalFrame; ++i) { LevelGenMap.TileType[,] newMap = new LevelGenMap.TileType[this.Bounds.IntWidth(), this.Bounds.IntHeight()]; doSimulationStep(this.Map.Grid, newMap); this.Map.ApplyGridSubset(this.Bounds.IntXMin(), this.Bounds.IntYMin(), newMap); } }
public void ApplyParams(RoomGenerationParams generationParams) { this.FillTileType = generationParams.FillTileType; this.NumberOfRooms = generationParams.NumberOfRooms; this.RoomMinSize = generationParams.RoomMinSize; this.RoomMaxSize = generationParams.RoomMaxSize; this.MaxRetries = generationParams.MaxRetries; this.Rooms = new List <Rect>(); }
public void ApplyParams(CAGenerationParams generationParams) { this.ValidBaseTilesForGeneration = generationParams.ValidBaseTilesForGeneration; this.FillTileType = generationParams.FillTileType; this.InitialChance = generationParams.InitialChance; this.DeathLimit = generationParams.DeathLimit; this.BirthLimit = generationParams.BirthLimit; this.NumberOfSteps = generationParams.NumberOfSteps; this.MaxCaves = generationParams.MaxCaves; }
public LevelGenMap.TileType[,] CopyOfGridRect(Rect rect) { LevelGenMap.TileType[,] copy = new LevelGenMap.TileType[rect.IntWidth(), rect.IntHeight()]; for (int x = rect.IntXMin(); x < rect.IntXMax(); ++x) { for (int y = rect.IntYMin(); y < rect.IntYMax(); ++y) { copy[x - rect.IntXMin(), y - rect.IntYMin()] = _grid[x, y]; } } return(copy); }
public void ApplyParams(BSPGenerationParams generationParams) { this.FillTileType = generationParams.FillTileType; this.DebugSecondFillTileType = generationParams.DebugSecondFillTileType; this.RoomMinSize = generationParams.RoomMinSize; this.RoomMaxSize = generationParams.RoomMaxSize; this.MinLeafSize = generationParams.MinLeafSize; this.MinNodeWHRatio = generationParams.MinNodeWHRatio; this.RoomToLeafRatio = generationParams.RoomToLeafRatio; this.EnableCorridors = generationParams.EnableCorridors; this.ExtraCorridorsPerRoom = generationParams.ExtraCorridorsPerRoom; this.VisualizeSplitting = generationParams.VisualizeSplitting; }
//TODO - fcole - Data-drive this private int tileSetIndexForTile(LevelGenMap.TileType tile) { switch (tile) { default: case LevelGenMap.TileType.A: return(1); case LevelGenMap.TileType.B: return(0); case LevelGenMap.TileType.C: return(2); case LevelGenMap.TileType.D: return(3); case LevelGenMap.TileType.E: return(4); case LevelGenMap.TileType.F: return(5); } }
public LevelGenMap.TileType[,] CopyOfGridRect(Rect rect) { LevelGenMap.TileType[,] copy = new LevelGenMap.TileType[rect.IntWidth(), rect.IntHeight()]; for (int x = rect.IntXMin(); x < rect.IntXMax(); ++x) { for (int y = rect.IntYMin(); y < rect.IntYMax(); ++y) { copy[x - rect.IntXMin(), y - rect.IntYMin()] = _grid[x, y]; } } return copy; }