public bool Set(SubRace subRace, RspAttribute attribute, float value) { var entry = _rspEntries[subRace.ToRspIndex()]; var oldValue = entry[attribute]; if (oldValue == value) { return(false); } entry[attribute] = value; return(true); }
public static Gender ToGender(this RspAttribute attribute) { return(attribute switch { RspAttribute.MaleMinSize => Gender.Male, RspAttribute.MaleMaxSize => Gender.Male, RspAttribute.MaleMinTail => Gender.Male, RspAttribute.MaleMaxTail => Gender.Male, RspAttribute.FemaleMinSize => Gender.Female, RspAttribute.FemaleMaxSize => Gender.Female, RspAttribute.FemaleMinTail => Gender.Female, RspAttribute.FemaleMaxTail => Gender.Female, RspAttribute.BustMinX => Gender.Female, RspAttribute.BustMinY => Gender.Female, RspAttribute.BustMinZ => Gender.Female, RspAttribute.BustMaxX => Gender.Female, RspAttribute.BustMaxY => Gender.Female, RspAttribute.BustMaxZ => Gender.Female, _ => Gender.Unknown, });
public float this[RspAttribute attribute] { get => Attributes[ToIndex(attribute)];
private static int ToIndex(RspAttribute attribute) => attribute < RspAttribute.NumAttributes && attribute >= 0 ? ( int )attribute : throw new InvalidEnumArgumentException();
public float this[SubRace subRace, RspAttribute attribute] { get => *( float * )(Data + RacialScalingStart + ToRspIndex(subRace) * RspEntry.ByteSize + ( int )attribute * 4);