public static void UpdateBuildplateAndList(BuildplateShareResponse data, string playerId) { data.result.buildplateData.eTag ??= "\"0xAAAAAAAAAAAAAAA\""; // TODO: If we ever use eTags for buildplates, replace this WriteBuildplate(data); var list = ReadPlayerBuildplateList(playerId); PlayerBuildplateList newList = new PlayerBuildplateList(); for (int i = list.UnlockedBuildplates.IndexOf(data.result.buildplateData.id); i > 0; i--) { list.UnlockedBuildplates[i] = list.UnlockedBuildplates[i - 1]; } list.UnlockedBuildplates[0] = data.result.buildplateData.id; WritePlayerBuildplateList(playerId, list); }
public static void WriteBuildplate(BuildplateShareResponse shareResponse) => WriteBuildplate(shareResponse.result.buildplateData);