public readonly AmmoReload Reload; // normal: 00/01/0e/12 //public readonly string ShotTypeBinary; //public readonly string ReloadBinary; private AmmoEntryPrimitive(byte capacity, AmmoShotType shotType, AmmoReload reload /*, string shotTypeBinary, string reloadBinary*/) { Capacity = capacity; ShotType = shotType; Reload = reload; //ShotTypeBinary = shotTypeBinary; //ReloadBinary = reloadBinary; }
public static AmmoEntryPrimitive Read(Reader reader) { byte capacity = reader.ReadByte(); byte shotTypeNum = reader.ReadByte(); byte reloadNum = reader.ReadByte(); AmmoShotType shotType = FromShotTypeValue(shotTypeNum); AmmoReload reload = FromReloadValue(reloadNum); //string shotTypeBinary = Convert.ToString(shotTypeNum, 2).PadLeft(8, '0').Insert(4, "_"); //string reloadBinary = Convert.ToString(reloadNum, 2).PadLeft(8, '0').Insert(4, "_"); return(new AmmoEntryPrimitive(capacity, shotType, reload /*, shotTypeBinary, reloadBinary*/)); }