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
}
}