using System; namespace FarseerGames.FarseerPhysics.Controllers { /// <summary> /// Provides common functionality for controllers. /// </summary> public abstract class Controller : IDisposable { public bool Enabled = true; public bool IsDisposed; /// <summary> /// Gets or sets the tag. The Tag can contain a custom object. /// </summary> /// <Value>The tag.</Value> public Object Tag { get; set; } #region IDisposable Members public void Dispose() { Dispose(true); GC.SuppressFinalize(this); } #endregion /// <summary> /// Validates this instance. /// </summary> public abstract void Validate(); /// <summary> /// Updates this instance. /// </summary> /// <param name="dt">The dt.</param> public abstract void Update(float dt); protected virtual void Dispose(bool disposing) { //subclasses can override incase they need to dispose of resources //otherwise do nothing. if (!IsDisposed) { if (disposing) { //dispose managed resources } //dispose unmanaged resources } IsDisposed = true; } } }
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.
This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)