/// <summary> Initializes this Room. </summary> internal void Init(int index) { this.Index = index; if (!this.IsGenerated) { if (!CheckDoors()) { return; } this.upperDoor.Init(this, this.Up); this.lowerDoor.Init(this, this.Down); this.leftDoor.Init(this, this.Left); this.rightDoor.Init(this, this.Right); this.Grid = null; } else { CellularAutomata ca = new CellularAutomata(15); ca.GeneratePattern(30); this.Grid = ca.GetPattern(); } this.doors = new List <GameObject>(); this.walls = new List <GameObject>(); this.floors = new List <GameObject>(); this.holes = new List <GameObject>(); this.enemies = new List <Enemy>(); Deactivate(); }
/// <summary> Initializes this Room. </summary> internal void Init(int index, bool hasStairs) { this.Index = index; if (!this.IsGenerated) { if (!CheckDoors()) { return; } this.upperDoor.Init(this, this.Up); this.lowerDoor.Init(this, this.Down); this.leftDoor.Init(this, this.Left); this.rightDoor.Init(this, this.Right); this.Grid = null; } else { CellularAutomata ca = new CellularAutomata(15); ca.GeneratePattern(30); this.Grid = ca.GetPattern(); if (hasStairs) { this.Grid[7, 7] = 2; } } this.doors = new List <GameObject>(); this.walls = new List <GameObject>(); this.stairs = new List <GameObject>(); this.enemies = new List <Enemy>(); this.traps = new List <Trap>(); Deactivate(); this.fullCleared = false; }