--- /dev/null
+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