Files
crtr/Assets/Cryville/Crtr/Browsing/UI/MetaProperty.cs

21 lines
694 B
C#

using System;
using System.Collections.Generic;
namespace Cryville.Crtr.Browsing.UI {
public class MetaProperty {
public string Name { get; set; }
public IReadOnlyDictionary<string, object> Values { get; set; }
public object MainValue { get { return Values[""]; } }
public MetaProperty(string name, IReadOnlyDictionary<string, object> values) {
if (values.Count == 0) throw new ArgumentException("Value is empty.");
if (!values.ContainsKey("")) throw new ArgumentException("Main value is missing.");
Name = name;
Values = values;
}
public MetaProperty(string name, object value) {
Name = name;
Values = new Dictionary<string, object> { { "", value } };
}
}
}