internal override bool Read(BinaryReader binaryReader, EndPoint senderEndPoint, int gameVersion) { if (!base.Read(binaryReader, senderEndPoint, gameVersion)) { return(NetworkError()); } // Small ship templates int?countTemplates = MyMwcMessageIn.ReadInt32Ex(binaryReader, senderEndPoint); if (countTemplates == null) { return(NetworkError()); } MyMwcLog.IfNetVerbose_AddToLog("countTemplates: " + countTemplates); SmallShipTemplates = new List <MyMwcObjectBuilder_SmallShipTemplate>(countTemplates.Value); for (int i = 0; i < countTemplates; i++) { MyMwcObjectBuilder_SmallShipTemplate templateBuilder = MyMwcObjectBuilder_Base.ReadAndCreateNewObject(binaryReader, senderEndPoint) as MyMwcObjectBuilder_SmallShipTemplate; if (templateBuilder == null) { return(NetworkError()); } if (templateBuilder.Read(binaryReader, senderEndPoint, gameVersion) == false) { return(NetworkError()); } SmallShipTemplates.Add(templateBuilder); } return(true); }
public MySmallShipTemplate(MyMwcObjectBuilder_SmallShipTemplate template) : this(template.ID, new StringBuilder(template.Name), template.Builder, true) { }