]> Dogcows Code - chaz/carfire/blobdiff - CarFire/CarFire/CarFire/Key.cs
Implemented map tiles; started new Key entity; added missing variables to Melee.cs...
[chaz/carfire] / CarFire / CarFire / CarFire / Key.cs
diff --git a/CarFire/CarFire/CarFire/Key.cs b/CarFire/CarFire/CarFire/Key.cs
new file mode 100644 (file)
index 0000000..0fab663
--- /dev/null
@@ -0,0 +1,54 @@
+using System;\r
+using System.Collections.Generic;\r
+using System.Linq;\r
+using System.Text;\r
+using Microsoft.Xna.Framework;\r
+using Microsoft.Xna.Framework.Content;\r
+using Microsoft.Xna.Framework.Graphics;\r
+\r
+namespace CarFire\r
+{\r
+    /// <summary>\r
+    /// A key entity.  Keys can be used to unlock doors... what a surprise.\r
+    /// </summary>\r
+    public class Key : Trigger\r
+    {\r
+        #region Public Methods\r
+\r
+        /// <summary>\r
+        /// Construct a key entity.\r
+        /// </summary>\r
+        /// <param name="identifier">The entity identifier.</param>\r
+        /// <param name="position">The position.</param>\r
+        /// <param name="info">The key-value pairs.</param>\r
+        /// <param name="game">The game reference.</param>\r
+        public Key(char identifier, Point position, Dictionary<string, string> info, Game game) :\r
+            base(identifier, position, info, game)\r
+        {\r
+            mPosition = new Vector2(position.X, position.Y);\r
+            mGame = game;\r
+        }\r
+\r
+        public override void LoadContent(ContentManager contentManager)\r
+        {\r
+            mTexture = contentManager.Load<Texture2D>("default");\r
+        }\r
+\r
+        public override void Draw(SpriteBatch spriteBatch)\r
+        {\r
+            Rectangle position = mGame.State.Map.GetRectangleFromCoordinates(mPosition);\r
+            spriteBatch.Draw(mTexture, position, Color.White);\r
+        }\r
+\r
+        #endregion\r
+\r
+\r
+        #region Private Variables\r
+\r
+        Texture2D mTexture;\r
+        Game mGame;\r
+        Vector2 mPosition;\r
+\r
+        #endregion\r
+    }\r
+}\r
This page took 0.022932 seconds and 4 git commands to generate.