]> Dogcows Code - chaz/carfire/commitdiff
nevermind, constants should be case-sensitive; renamed Map.Type to Map.Mode to avoid...
authorCharles <Charles@92bb83a3-7c8f-8a45-bc97-515c4e399668>
Thu, 15 Apr 2010 03:19:13 +0000 (03:19 +0000)
committerCharles <Charles@92bb83a3-7c8f-8a45-bc97-515c4e399668>
Thu, 15 Apr 2010 03:19:13 +0000 (03:19 +0000)
git-svn-id: https://bd85.net/svn/cs3505_group@80 92bb83a3-7c8f-8a45-bc97-515c4e399668

CarFire/CarFire/CarFire/Content/Maps/sandbox.cfmap
CarFire/CarFire/CarFire/Map.cs
CarFire/CarFire/CarFire/MapReader.cs
CarFire/CarFire/CarFire/Parse.cs

index 9ae2acdea3bd359c690165489acb0f364f465e72..e663d508386088c7e6d7a569c27dd4227d8c77f1 100644 (file)
@@ -6,7 +6,7 @@
 [metadata]\r
        author = Chaz McGarvey\r
        levelname = Sandbox\r
-       type = campaign\r
+       type = Campaign\r
        dimensions = [80,21]\r
        tileset = FuturisticBuilding\r
        numplayers = <1,4>\r
index 3b10663d089a9f06242b68aa0082625a40876cf5..26b74e9ac8fa2d9c5f557c60ea8f1bb0f4c99f1e 100644 (file)
@@ -58,7 +58,7 @@ namespace CarFire
         /// <summary>\r
         /// The type of a map helps determine how the map is intended to be used.\r
         /// </summary>\r
-        public enum Type\r
+        public enum Mode\r
         {\r
             None,\r
             Campaign,\r
@@ -71,7 +71,7 @@ namespace CarFire
         public class Metadata\r
         {\r
             public string Name;\r
-            public Type Type;\r
+            public Mode Type;\r
             public string Author;\r
             public HashSet<int> NumPlayers = new HashSet<int>();\r
             public string Tileset;\r
@@ -102,7 +102,7 @@ namespace CarFire
         /// <summary>\r
         /// Get the type of the map.\r
         /// </summary>\r
-        //public Type Type { get { return mData.mMetadata.Type; } }\r
+        public Mode Type { get { return mData.Metadata.Type; } }\r
 \r
         /// <summary>\r
         /// Get the author of the map.\r
@@ -151,7 +151,9 @@ namespace CarFire
         /// <summary>\r
         /// Construct a map with the provided map data.\r
         /// </summary>\r
-        /// <param name="data">Map data.</param>\r
+        /// <param name="metadata">The metadata.</param>\r
+        /// <param name="grid">The grid.</param>\r
+        /// <param name="entities">The entities.</param>\r
         public Map(Metadata metadata, char[,] grid, List<RawEntity> entities)\r
         {\r
             mData = new Modal(metadata, grid, entities);\r
index cfb1f945219cb1bf73e315957bee1cc0fd7285f4..3d43f3619a8929152a062d4677032f2528635547 100644 (file)
@@ -312,7 +312,7 @@ namespace CarFire
                     if (mPlayerPositions[i] == default(Point))\r
                     {\r
                         throw new ParserException("Not enough player positions were defined on the grid; " +\r
-                            "are missing a spot for player " + i + ".");\r
+                            "you are missing a spot for player " + i + ".");\r
                     }\r
                 }\r
             }\r
@@ -347,8 +347,8 @@ namespace CarFire
 \r
             public void set_type(string atom)\r
             {\r
-                Map.Type value = Parse.Constant<Map.Type>(atom);\r
-                if (value != default(Map.Type)) mMetadata.Type = value;\r
+                Map.Mode value = Parse.Constant<Map.Mode>(atom);\r
+                if (value != default(Map.Mode)) mMetadata.Type = value;\r
                 else throw new ParserException("Unexpected type on line " + mInput.LineNumber + ": " + atom);\r
             }\r
 \r
index 2df3ca73028aadadc36013bb529593b988e38dfd..be11a9ac506046827f06441b31f67aea3adab07c 100644 (file)
@@ -131,7 +131,7 @@ namespace CarFire
         {\r
             try\r
             {\r
-                return (T)System.Enum.Parse(typeof(T), String(atom), true);\r
+                return (T)System.Enum.Parse(typeof(T), String(atom));\r
             }\r
 #pragma warning disable 0168\r
             catch (System.Exception ex)\r
This page took 0.035396 seconds and 4 git commands to generate.