using Microsoft.Xna.Framework.Graphics;\r
namespace CarFire\r
{\r
+ /// <summary>\r
+ /// Flag options to define attributes for individual tiles.\r
+ /// </summary>\r
+ [Flags]\r
+ public enum TileFlags\r
+ {\r
+ Open = 0x01,\r
+ Closed = 0x02,\r
+ Floor = 0x04,\r
+ Wall = 0x08,\r
+ Default = 0x05\r
+ }\r
+\r
+\r
/// <summary>\r
/// Small wrapper around a texture to provide easy access to\r
/// tile rectangles.\r
}\r
\r
\r
+ /// <summary>\r
+ /// Get the flags associated with a tile character.\r
+ /// </summary>\r
+ /// <param name="tile">Tile character.</param>\r
+ /// <returns>Tile flags.</returns>\r
+ public TileFlags GetTileFlags(char tile)\r
+ {\r
+ return mFlags[tile];\r
+ }\r
+\r
+\r
/// <summary>\r
/// Associate a tile character with tile coordinates. This\r
- /// lets you access tile rectangles by character.\r
+ /// lets you access tiles by character.\r
/// </summary>\r
/// <param name="tile">Tile character.</param>\r
/// <param name="point">Coordinates.</param>\r
- public void SetTile(char tile, Point point)\r
+ public void SetTile(char tile, Point point, TileFlags flags)\r
{\r
mTiles.Add(tile, GetRectangleForTile(point));\r
+ mFlags.Add(tile, flags);\r
}\r
\r
\r
int mTileW;\r
int mTileH;\r
Dictionary<char, Rectangle> mTiles = new Dictionary<char, Rectangle>();\r
+ Dictionary<char, TileFlags> mFlags = new Dictionary<char, TileFlags>();\r
\r
#endregion\r
}\r