attribute individual fields, not the class

This commit is contained in:
Bob
2010-08-27 19:13:42 +12:00
committed by Chris Forbes
parent 29a77f7c5c
commit 9fedeefdbc
6 changed files with 52 additions and 71 deletions

View File

@@ -15,27 +15,26 @@ using System.Linq;
namespace OpenRA.FileFormats
{
[FieldLoader.Foo( "Selectable", "Title", "Description", "Author", "PlayerCount", "Tileset", "TopLeft", "BottomRight" )]
public class MapStub
{
public readonly IFolder Package;
// Yaml map data
public readonly string Uid;
public bool Selectable;
[FieldLoader.Load] public bool Selectable;
public string Title;
public string Description;
public string Author;
public int PlayerCount;
public string Tileset;
[FieldLoader.Load] public string Title;
[FieldLoader.Load] public string Description;
[FieldLoader.Load] public string Author;
[FieldLoader.Load] public int PlayerCount;
[FieldLoader.Load] public string Tileset;
[FieldLoader.LoadUsing( "LoadWaypoints" )]
public Dictionary<string, int2> Waypoints = new Dictionary<string, int2>();
public IEnumerable<int2> SpawnPoints { get { return Waypoints.Select(kv => kv.Value); } }
public int2 TopLeft;
public int2 BottomRight;
[FieldLoader.Load] public int2 TopLeft;
[FieldLoader.Load] public int2 BottomRight;
public int Width { get { return BottomRight.X - TopLeft.X; } }
public int Height { get { return BottomRight.Y - TopLeft.Y; } }