Rename resource meta interface.
This commit is contained in:
20
Assets/Cryville/Crtr/Browsing/MetaProperty.cs
Normal file
20
Assets/Cryville/Crtr/Browsing/MetaProperty.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Cryville.Crtr.Browsing {
|
||||
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 } };
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user