]> Dogcows Code - chaz/carfire/commitdiff
Added small function that only tests if the space is a wall. Used for AI calculations
authorbrady <brady@92bb83a3-7c8f-8a45-bc97-515c4e399668>
Sun, 25 Apr 2010 02:11:03 +0000 (02:11 +0000)
committerbrady <brady@92bb83a3-7c8f-8a45-bc97-515c4e399668>
Sun, 25 Apr 2010 02:11:03 +0000 (02:11 +0000)
git-svn-id: https://bd85.net/svn/cs3505_group@143 92bb83a3-7c8f-8a45-bc97-515c4e399668

CarFire/CarFire/CarFire/Map.cs

index 197099436bdb18d86a01c9aaec742801ad278bb5..1b8b5a89bc992a9279f324102379674ce0a5ef73 100644 (file)
@@ -235,6 +235,16 @@ namespace CarFire
             return mData.IsCellOpen(x, y);\r
         }\r
 \r
+        /// <summary>\r
+        /// created by Brady for AI precalculations\r
+        /// </summary>\r
+        /// <param name="x">X-coordinate.</param>\r
+        /// <param name="y">Y-coordinate.</param>\r
+        public bool IsWall(int x, int y)\r
+        {\r
+            return mData.IsWall(x, y);\r
+        }\r
+\r
         /// <summary>\r
         /// Determine whether or not a cell can be occupied by a game entity.\r
         /// </summary>\r
@@ -394,6 +404,12 @@ namespace CarFire
                 return false;\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
+            }\r
             public void SetCell(int x, int y, char tile)\r
             {\r
                 if (IsOnMap(x, y))\r
This page took 0.040799 seconds and 4 git commands to generate.