X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;ds=sidebyside;f=CarFire%2FCarFire%2FCarFire%2FKey.cs;fp=CarFire%2FCarFire%2FCarFire%2FKey.cs;h=0fab663185772fd8cb20fbf9b553977b4be30a1c;hb=fc34f843ea42a3496a7ff5dd04853695ba628e8b;hp=0000000000000000000000000000000000000000;hpb=b5eebc2087c00bb67b3a3b9ddcec4743aa7a8cdb;p=chaz%2Fcarfire diff --git a/CarFire/CarFire/CarFire/Key.cs b/CarFire/CarFire/CarFire/Key.cs new file mode 100644 index 0000000..0fab663 --- /dev/null +++ b/CarFire/CarFire/CarFire/Key.cs @@ -0,0 +1,54 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Content; +using Microsoft.Xna.Framework.Graphics; + +namespace CarFire +{ + /// + /// A key entity. Keys can be used to unlock doors... what a surprise. + /// + public class Key : Trigger + { + #region Public Methods + + /// + /// Construct a key entity. + /// + /// The entity identifier. + /// The position. + /// The key-value pairs. + /// The game reference. + public Key(char identifier, Point position, Dictionary info, Game game) : + base(identifier, position, info, game) + { + mPosition = new Vector2(position.X, position.Y); + mGame = game; + } + + public override void LoadContent(ContentManager contentManager) + { + mTexture = contentManager.Load("default"); + } + + public override void Draw(SpriteBatch spriteBatch) + { + Rectangle position = mGame.State.Map.GetRectangleFromCoordinates(mPosition); + spriteBatch.Draw(mTexture, position, Color.White); + } + + #endregion + + + #region Private Variables + + Texture2D mTexture; + Game mGame; + Vector2 mPosition; + + #endregion + } +}