/// <summary> /// returns the slot number for the BipedObjectEnum - e.g. 51 for 'Ring' /// </summary> /// <param name="bipedObject">the enum to convert</param> /// <returns>the slot number for the BipedObjectEnum - e.g. 51 for 'Ring', -1 when called with "None"</returns> public static int ToSlot(this BipedObject bipedObject) { if (bipedObject == BipedObject.None) { return(-1); } return(BipedObjectConverter.ConversionList.First(itm => itm.Value.Item1 == bipedObject).Key); }
/// <summary> /// converts the object enum to the corresponding flag enum, throws an exception when called with 'None' /// </summary> /// <param name="bipedObject"></param> /// <returns></returns> public static BipedObjectFlag ToFlagEnum(this BipedObject bipedObject) { if (bipedObject == BipedObject.None) { throw new ArgumentException("Object enum 'None' does not exist as flag enum"); } return((BipedObjectFlag)Enum.Parse(typeof(BipedObjectFlag), bipedObject.ToString())); }
public static partial void FillBinaryBipedObjectNamesCustom(MutagenFrame frame, IRaceInternal item) { for (int i = 0; i < NumBipedObjectNames; i++) { if (!frame.Reader.TryReadSubrecordFrame(RecordTypes.NAME, out var subHeader)) { break; } BipedObject type = (BipedObject)i; var val = BinaryStringUtility.ProcessWholeToZString(subHeader.Content, frame.MetaData.Encodings.NonTranslated); if (!string.IsNullOrEmpty(val)) { item.BipedObjectNames[type] = val; } } }