/// <summary> /// Initializes a new instance of the <see cref="TowerSettings"/> class. /// </summary> /// <param name="tower">The tower.</param> /// <param name="graphicsDevice">The graphics device.</param> public TowerSettings(Tower tower, IBallerburgGraphicsManager graphicsDevice) { this.X = tower.X; this.Y = tower.Y; this.Height = tower.Height; this.viewDirection = new Vector3(tower.X, tower.CoverHeight + 2, tower.Y + 1); this.ID = tower.ID; this.hasCannon = tower.HasCannon; if (this.hasCannon) { this.cannon = new Cannon(tower.X, tower.CoverHeight, tower.Y, null); this.cannon.InitGraphics(graphicsDevice.GraphicsDevice); } }
/// <summary> /// Releases unmanaged and - optionally - managed resources /// </summary> /// <param name="disposing"><c>true</c> to release both managed and unmanaged resources; <c>false</c> to release only unmanaged resources.</param> protected virtual void Dispose(bool disposing) { if (disposing) { this.cannon.Dispose(); this.cannon = null; } }