Tokenize ruleset keys. Remove MotionName.
This commit is contained in:
@@ -139,41 +139,6 @@ namespace Cryville.Crtr {
|
||||
}
|
||||
}
|
||||
|
||||
public struct MotionName : IEquatable<MotionName> {
|
||||
public string MainName { get; private set; }
|
||||
public string SubName { get; private set; }
|
||||
public string FullName { get; private set; }
|
||||
|
||||
readonly int hash;
|
||||
public MotionName(string mainName, string subName) {
|
||||
MainName = mainName;
|
||||
SubName = subName;
|
||||
FullName = subName == null ? mainName : string.Format("{0}!{1}", mainName, subName);
|
||||
hash = FullName.GetHashCode();
|
||||
}
|
||||
public MotionName(string fullName) {
|
||||
var names = fullName.Split('!');
|
||||
if (names.Length > 2) throw new ArgumentException("Invalid name");
|
||||
FullName = fullName;
|
||||
hash = FullName.GetHashCode();
|
||||
MainName = names[0];
|
||||
SubName = names.Length == 1 ? "" : names[1];
|
||||
}
|
||||
public override bool Equals(object obj) {
|
||||
if (!(obj is MotionName)) return false;
|
||||
return Equals((MotionName)obj);
|
||||
}
|
||||
public bool Equals(MotionName other) {
|
||||
return hash == other.hash;
|
||||
}
|
||||
public override int GetHashCode() {
|
||||
return hash;
|
||||
}
|
||||
public override string ToString() {
|
||||
return FullName;
|
||||
}
|
||||
}
|
||||
|
||||
public struct MotionRegistry {
|
||||
readonly Type m_Type;
|
||||
public Type Type {
|
||||
|
Reference in New Issue
Block a user