| 978 | ParamArchive arSubcls; |
| 979 | if (!ar.OpenSubclass("Stats", arSubcls)) |
| 980 | { |
| 981 | return LSStructure; |
| 982 | } |
| 983 | stats.CampaignSerialize(arSubcls); |
| 984 | } |
| 985 | else if (ar.IsLoading()) |
| 986 | { |
| 987 | stats.Clear(); |
| 988 | } |
| 989 | PARAM_CHECK(ar.Serialize("Weapons", weapons, 1)) |
| 990 | PARAM_CHECK(ar.Serialize("Magazines", magazines, 1)) |
| 991 | PARAM_CHECK(ar.SerializeArray("Dead", dead, 1)) |
| 992 | return LSOK; |
| 993 | } |
| 994 | |
| 995 | LSError BattleHistory::Serialize(ParamArchive& ar) |
| 996 | { |
| 997 | PARAM_CHECK(ar.Serialize("battleName", battleName, 1)) |
| 998 | PARAM_CHECK(ar.Serialize("Missions", missions, 1)) |
| 999 | return LSOK; |
| 1000 | } |
| 1001 | |
| 1002 | void CampaignHistory::AddMission(RString campaign, RString battle, RString mission, RString displayName) |
| 1003 | { |
| 1004 | if (!campaign || campaign.GetLength() <= 0) |
| 1005 | { |
| 1006 | return; |
| 1007 | } |
| 1008 | if (stricmp(campaign, campaignName) != 0) |
| 1009 | { |
| 1010 | return; |
| 1011 | } |
| 1012 | int i = battles.Size() - 1; |
| 1013 | if (i < 0 || stricmp(battles[i].battleName, battle) != 0) |
| 1014 | { |
| 1015 | i = battles.Add(); |
no test coverage detected