Exemple #1
0
 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>();
 }
Exemple #2
0
 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);
     }
 }
Exemple #3
0
 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>();
 }
Exemple #4
0
 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;
 }
Exemple #5
0
 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;
 }
Exemple #6
0
 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);
 }
Exemple #7
0
	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;
	}
Exemple #8
0
 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);
        }
    }
Exemple #10
0
    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);
		}
	}
Exemple #11
0
	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;
	}