summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
acee761)
[metadata]\r
author = Chaz McGarvey\r
levelname = Sandbox\r
[metadata]\r
author = Chaz McGarvey\r
levelname = Sandbox\r
dimensions = [80,21]\r
tileset = FuturisticBuilding\r
numplayers = <1,4>\r
dimensions = [80,21]\r
tileset = FuturisticBuilding\r
numplayers = <1,4>\r
/// <summary>\r
/// The type of a map helps determine how the map is intended to be used.\r
/// </summary>\r
/// <summary>\r
/// The type of a map helps determine how the map is intended to be used.\r
/// </summary>\r
public class Metadata\r
{\r
public string Name;\r
public class Metadata\r
{\r
public string Name;\r
public string Author;\r
public HashSet<int> NumPlayers = new HashSet<int>();\r
public string Tileset;\r
public string Author;\r
public HashSet<int> NumPlayers = new HashSet<int>();\r
public string Tileset;\r
/// <summary>\r
/// Get the type of the map.\r
/// </summary>\r
/// <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
\r
/// <summary>\r
/// Get the author of the map.\r
/// <summary>\r
/// Construct a map with the provided map data.\r
/// </summary>\r
/// <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
public Map(Metadata metadata, char[,] grid, List<RawEntity> entities)\r
{\r
mData = new Modal(metadata, grid, entities);\r
if (mPlayerPositions[i] == default(Point))\r
{\r
throw new ParserException("Not enough player positions were defined on the grid; " +\r
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
public void set_type(string atom)\r
{\r
\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
else throw new ParserException("Unexpected type on line " + mInput.LineNumber + ": " + atom);\r
}\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
}\r
#pragma warning disable 0168\r
catch (System.Exception ex)\r