From 8f212205c32b283d9a7730e15044d706db2f08bf Mon Sep 17 00:00:00 2001 From: brady Date: Sun, 25 Apr 2010 02:11:03 +0000 Subject: [PATCH] Added small function that only tests if the space is a wall. Used for AI calculations git-svn-id: https://bd85.net/svn/cs3505_group@143 92bb83a3-7c8f-8a45-bc97-515c4e399668 --- CarFire/CarFire/CarFire/Map.cs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/CarFire/CarFire/CarFire/Map.cs b/CarFire/CarFire/CarFire/Map.cs index 1970994..1b8b5a8 100644 --- a/CarFire/CarFire/CarFire/Map.cs +++ b/CarFire/CarFire/CarFire/Map.cs @@ -235,6 +235,16 @@ namespace CarFire return mData.IsCellOpen(x, y); } + /// + /// created by Brady for AI precalculations + /// + /// X-coordinate. + /// Y-coordinate. + public bool IsWall(int x, int y) + { + return mData.IsWall(x, y); + } + /// /// Determine whether or not a cell can be occupied by a game entity. /// @@ -394,6 +404,12 @@ namespace CarFire return false; } + //created by Brady for AI precalculations + public bool IsWall(int x, int y) + { + if (IsOnMap(x, y)) return (mGrid[x, y] == '-' || mGrid[x, y] == '|' || mGrid[x, y] == '+' || mGrid[x, y] == '/' || mGrid[x, y] == '\\'); + return false; + } public void SetCell(int x, int y, char tile) { if (IsOnMap(x, y)) -- 2.43.0