]> Dogcows Code - chaz/carfire/blob - CarFire/CarFire/CarFire/Key.cs
0fab663185772fd8cb20fbf9b553977b4be30a1c
[chaz/carfire] / CarFire / CarFire / CarFire / Key.cs
1 using System;
2 using System.Collections.Generic;
3 using System.Linq;
4 using System.Text;
5 using Microsoft.Xna.Framework;
6 using Microsoft.Xna.Framework.Content;
7 using Microsoft.Xna.Framework.Graphics;
8
9 namespace CarFire
10 {
11 /// <summary>
12 /// A key entity. Keys can be used to unlock doors... what a surprise.
13 /// </summary>
14 public class Key : Trigger
15 {
16 #region Public Methods
17
18 /// <summary>
19 /// Construct a key entity.
20 /// </summary>
21 /// <param name="identifier">The entity identifier.</param>
22 /// <param name="position">The position.</param>
23 /// <param name="info">The key-value pairs.</param>
24 /// <param name="game">The game reference.</param>
25 public Key(char identifier, Point position, Dictionary<string, string> info, Game game) :
26 base(identifier, position, info, game)
27 {
28 mPosition = new Vector2(position.X, position.Y);
29 mGame = game;
30 }
31
32 public override void LoadContent(ContentManager contentManager)
33 {
34 mTexture = contentManager.Load<Texture2D>("default");
35 }
36
37 public override void Draw(SpriteBatch spriteBatch)
38 {
39 Rectangle position = mGame.State.Map.GetRectangleFromCoordinates(mPosition);
40 spriteBatch.Draw(mTexture, position, Color.White);
41 }
42
43 #endregion
44
45
46 #region Private Variables
47
48 Texture2D mTexture;
49 Game mGame;
50 Vector2 mPosition;
51
52 #endregion
53 }
54 }
This page took 0.029456 seconds and 3 git commands to generate.