diff options
author | Thomas Leyh <leyh.thomas@web.de> | 2016-07-24 08:14:18 +0200 |
---|---|---|
committer | Thomas Leyh <leyh.thomas@web.de> | 2016-07-24 08:14:18 +0200 |
commit | ced3d03bdb3ce866d832e03fb212865140905a9a (patch) | |
tree | 2a16c2063a46d3c354ce1585029dda3124f6ad93 /V3/Objects/IGameObject.cs | |
parent | 0394dccaf06e1009e591a6ff4d645895574724c1 (diff) | |
download | V3-release.tar.gz V3-release.tar.bz2 |
Diffstat (limited to 'V3/Objects/IGameObject.cs')
-rw-r--r-- | V3/Objects/IGameObject.cs | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/V3/Objects/IGameObject.cs b/V3/Objects/IGameObject.cs new file mode 100644 index 0000000..556e918 --- /dev/null +++ b/V3/Objects/IGameObject.cs @@ -0,0 +1,43 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Content; +using Microsoft.Xna.Framework.Graphics; + +namespace V3.Objects +{ + /// <summary> + /// A game object which is placed on the map. + /// </summary> + public interface IGameObject + { + Vector2 Position { get; set; } + + /// <summary> + /// A unique ID for this game object, with which it can be identified. + /// All implementations should use the IdGenerator to generate this ID. + /// </summary> + int Id { get; } + + /// <summary> + /// Draws the game object on the screen. + /// </summary> + /// <param name="spriteBatch">Sprite batch used for drawing.</param> + void Draw(SpriteBatch spriteBatch); + + /// <summary> + /// The size of the object. + /// </summary> + Rectangle BoundaryRectangle { get; } + + /// <summary> + /// Loads needed graphics. + /// </summary> + /// <param name="contentManager">Content manager used. </param> + void LoadContent(ContentManager contentManager); + + /// <summary> + /// Returns the object instance without modifications. + /// </summary> + /// <returns>This object.</returns> + IGameObject GetSelf(); + } +} |