Beispiel #1
0
        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);
        }
Beispiel #2
0
 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,
     });
Beispiel #3
0
 public float this[RspAttribute attribute]
 {
     get => Attributes[ToIndex(attribute)];
Beispiel #4
0
 private static int ToIndex(RspAttribute attribute)
 => attribute < RspAttribute.NumAttributes && attribute >= 0
         ? ( int )attribute
         : throw new InvalidEnumArgumentException();
Beispiel #5
0
 public float this[SubRace subRace, RspAttribute attribute]
 {
     get => *( float * )(Data + RacialScalingStart + ToRspIndex(subRace) * RspEntry.ByteSize + ( int )attribute * 4);