public static ProfileCampaign ReadFrom(PrimitiveReader reader) { ProfileCampaign campaign = new ProfileCampaign(); campaign.Name = reader.ReadFixedString(nameLength, Utils.TextEncoding); campaign.Count1 = reader.ReadUInt32(); campaign.ScenariosCount = reader.ReadUInt32(); campaign.Count2 = reader.ReadUInt32(); campaign.Unknown1 = reader.ReadUInt32(); campaign.Unknown2 = reader.ReadUInt32(); ScenarioStatus[] statuses = new ScenarioStatus[(int)campaign.ScenariosCount]; for (int i = 0; i < statuses.Length; i++) { statuses[i] = (ScenarioStatus)reader.ReadUInt8(); } campaign.Statuses = statuses; return(campaign); }
public static ProfilePlayer ReadFrom(PrimitiveReader reader) { ProfilePlayer player = new ProfilePlayer(); player.Name = reader.ReadFixedString(nameLength, Utils.TextEncoding); player.PlayerId = reader.ReadUInt32(); player.Unknown = reader.ReadUInt32(); int campaignsCount = reader.ReadInt32(); List <ProfileCampaign> campaigns = new List <ProfileCampaign>(campaignsCount); for (int i = 0; i < campaignsCount; i++) { campaigns.Add(ProfileCampaign.ReadFrom(reader)); } player.Campaigns = campaigns; player.Options = reader.ReadBytes(522); var options2 = new ProfilePlayerOptions(player.Options); return(player); }