From: Charles Date: Thu, 15 Apr 2010 03:19:13 +0000 (+0000) Subject: nevermind, constants should be case-sensitive; renamed Map.Type to Map.Mode to avoid... X-Git-Url: https://git.brokenzipper.com/gitweb?a=commitdiff_plain;h=8438a35a901cf43ef85f226f58b5627b376a23c4;p=chaz%2Fcarfire nevermind, constants should be case-sensitive; renamed Map.Type to Map.Mode to avoid confusion with System.Type git-svn-id: https://bd85.net/svn/cs3505_group@80 92bb83a3-7c8f-8a45-bc97-515c4e399668 --- diff --git a/CarFire/CarFire/CarFire/Content/Maps/sandbox.cfmap b/CarFire/CarFire/CarFire/Content/Maps/sandbox.cfmap index 9ae2acd..e663d50 100644 --- a/CarFire/CarFire/CarFire/Content/Maps/sandbox.cfmap +++ b/CarFire/CarFire/CarFire/Content/Maps/sandbox.cfmap @@ -6,7 +6,7 @@ [metadata] author = Chaz McGarvey levelname = Sandbox - type = campaign + type = Campaign dimensions = [80,21] tileset = FuturisticBuilding numplayers = <1,4> diff --git a/CarFire/CarFire/CarFire/Map.cs b/CarFire/CarFire/CarFire/Map.cs index 3b10663..26b74e9 100644 --- a/CarFire/CarFire/CarFire/Map.cs +++ b/CarFire/CarFire/CarFire/Map.cs @@ -58,7 +58,7 @@ namespace CarFire /// /// The type of a map helps determine how the map is intended to be used. /// - public enum Type + public enum Mode { None, Campaign, @@ -71,7 +71,7 @@ namespace CarFire public class Metadata { public string Name; - public Type Type; + public Mode Type; public string Author; public HashSet NumPlayers = new HashSet(); public string Tileset; @@ -102,7 +102,7 @@ namespace CarFire /// /// Get the type of the map. /// - //public Type Type { get { return mData.mMetadata.Type; } } + public Mode Type { get { return mData.Metadata.Type; } } /// /// Get the author of the map. @@ -151,7 +151,9 @@ namespace CarFire /// /// Construct a map with the provided map data. /// - /// Map data. + /// The metadata. + /// The grid. + /// The entities. public Map(Metadata metadata, char[,] grid, List entities) { mData = new Modal(metadata, grid, entities); diff --git a/CarFire/CarFire/CarFire/MapReader.cs b/CarFire/CarFire/CarFire/MapReader.cs index cfb1f94..3d43f36 100644 --- a/CarFire/CarFire/CarFire/MapReader.cs +++ b/CarFire/CarFire/CarFire/MapReader.cs @@ -312,7 +312,7 @@ namespace CarFire if (mPlayerPositions[i] == default(Point)) { throw new ParserException("Not enough player positions were defined on the grid; " + - "are missing a spot for player " + i + "."); + "you are missing a spot for player " + i + "."); } } } @@ -347,8 +347,8 @@ namespace CarFire public void set_type(string atom) { - Map.Type value = Parse.Constant(atom); - if (value != default(Map.Type)) mMetadata.Type = value; + Map.Mode value = Parse.Constant(atom); + if (value != default(Map.Mode)) mMetadata.Type = value; else throw new ParserException("Unexpected type on line " + mInput.LineNumber + ": " + atom); } diff --git a/CarFire/CarFire/CarFire/Parse.cs b/CarFire/CarFire/CarFire/Parse.cs index 2df3ca7..be11a9a 100644 --- a/CarFire/CarFire/CarFire/Parse.cs +++ b/CarFire/CarFire/CarFire/Parse.cs @@ -131,7 +131,7 @@ namespace CarFire { try { - return (T)System.Enum.Parse(typeof(T), String(atom), true); + return (T)System.Enum.Parse(typeof(T), String(atom)); } #pragma warning disable 0168 catch (System.Exception ex)