/// character to coordinate mappings. This effects what the map looks\r
/// like when it is drawn.\r
/// </summary>\r
- public Tilemap Tilemap\r
- {\r
- get { return mView.Tilemap; }\r
- set { mView.Tilemap = value; }\r
- }\r
+ public static Tilemap Tilemap;\r
\r
/// <summary>\r
/// Get and set the zoom of the map view. The default zoom is\r
Debug.Assert(grid != null);\r
Debug.Assert(entities != null);\r
Debug.Assert(metadata.GridWidth * metadata.GridHeight == grid.Length);\r
+ Debug.Assert(Tilemap != null);\r
\r
mMetadata = metadata;\r
mCleanGrid = grid;\r
\r
public bool IsCellOpen(int x, int y)\r
{\r
- // TODO: Still need to define characters for types of scenery.\r
- if (IsOnMap(x, y)) return mGrid[x, y] == ' ';\r
- return false;\r
+ if (!IsOnMap(x, y)) return false;\r
+ return (Tilemap.GetTileFlags(mGrid[x, y]) & TileFlags.Open) == TileFlags.Open;\r
}\r
\r
//created by Brady for AI precalculations\r
public bool IsWall(int x, int y)\r
{\r
- if (IsOnMap(x, y)) return (mGrid[x, y] == '-' || mGrid[x, y] == '|' || mGrid[x, y] == '+' || mGrid[x, y] == '/' || mGrid[x, y] == '\\');\r
- return false;\r
+ if (!IsOnMap(x, y)) return false;\r
+ return (Tilemap.GetTileFlags(mGrid[x, y]) & TileFlags.Wall) == TileFlags.Wall;\r
}\r
+\r
public void SetCell(int x, int y, char tile)\r
{\r
if (IsOnMap(x, y))\r
class View\r
{\r
public Vector2 CenterCell;\r
- public Tilemap Tilemap;\r
public float Zoom;\r
\r
\r