//  Read this object from message-in
        internal override bool Read(BinaryReader binaryReader, EndPoint senderEndPoint, int gameVersion)
        {
            if (base.Read(binaryReader, senderEndPoint, gameVersion) == false)
            {
                return(NetworkError());
            }

            int?amount = MyMwcMessageIn.ReadInt32Ex(binaryReader, senderEndPoint);

            if (amount == null)
            {
                return(NetworkError());
            }
            Amount = amount.Value;
            MyMwcLog.IfNetVerbose_AddToLog("Amount: " + Amount);

            //  Ammo Type
            MyMwcObjectBuilder_LargeShip_Ammo_TypesEnum?ammoType = MyMwcMessageIn.ReadObjectBuilderLargeShipAmmoTypesEnumEx(binaryReader, senderEndPoint);

            if (ammoType == null)
            {
                return(NetworkError());
            }
            AmmoType = ammoType.Value;
            MyMwcLog.IfNetVerbose_AddToLog("AmmoType: " + AmmoType);

            return(true);
        }
        //  Read this object from message-in
        internal override bool Read(BinaryReader binaryReader, EndPoint senderEndPoint, int gameVersion)
        {
            if (base.Read(binaryReader, senderEndPoint, gameVersion) == false) return NetworkError();

            int? amount = MyMwcMessageIn.ReadInt32Ex(binaryReader, senderEndPoint);
            if (amount == null) return NetworkError();
            Amount = amount.Value;
            MyMwcLog.IfNetVerbose_AddToLog("Amount: " + Amount);

            //  Ammo Type
            MyMwcObjectBuilder_LargeShip_Ammo_TypesEnum? ammoType = MyMwcMessageIn.ReadObjectBuilderLargeShipAmmoTypesEnumEx(binaryReader, senderEndPoint);
            if (ammoType == null) return NetworkError();
            AmmoType = ammoType.Value;
            MyMwcLog.IfNetVerbose_AddToLog("AmmoType: " + AmmoType);

            return true;
        }
 internal override void SetObjectBuilderIdInternal(int? objectBuilderId)
 {
     AmmoType = (MyMwcObjectBuilder_LargeShip_Ammo_TypesEnum)Convert.ToUInt16(objectBuilderId);
 }
 public MyMwcObjectBuilder_LargeShip_Ammo(int amount, MyMwcObjectBuilder_LargeShip_Ammo_TypesEnum ammoType)
 {
     Amount = amount;
     AmmoType = ammoType;
 }
 internal override void SetObjectBuilderIdInternal(int?objectBuilderId)
 {
     AmmoType = (MyMwcObjectBuilder_LargeShip_Ammo_TypesEnum)Convert.ToUInt16(objectBuilderId);
 }
 public MyMwcObjectBuilder_LargeShip_Ammo(int amount, MyMwcObjectBuilder_LargeShip_Ammo_TypesEnum ammoType)
 {
     Amount   = amount;
     AmmoType = ammoType;
 }
 public static void WriteObjectBuilderLargeShipAmmoTypesEnum(MyMwcObjectBuilder_LargeShip_Ammo_TypesEnum val, BinaryWriter binaryWriter)
 {
     binaryWriter.Write((ushort)val);
 }