Ejemplo n.º 1
0
        public static ScoresStorageData Create(Scores scores)
        {
            if (scores is null)
            {
                throw new System.ArgumentNullException(nameof(scores));
            }

            var storageData = new ScoresStorageData
            {
                Achievements = scores.Achievements,
                BaseScores   = scores.BaseScores,
                Frags        = scores.Frags.Select(x => new ScoreSidCounterStorageData {
                    Sid = x.Key.Sid, Value = x.Value
                })
                               .ToArray(),
                PlaceTypes = scores.PlaceTypes
                             .Select(x => new ScoreSidCounterStorageData {
                    Sid = x.Key.Sid, Value = x.Value
                }).ToArray(),
                TurnCounter = scores.TurnCounter,
                Turns       = scores.Turns
            };

            return(storageData);
        }
Ejemplo n.º 2
0
        public static ScoresStorageData Create(Scores scores)
        {
            var storageData = new ScoresStorageData();

            storageData.Achievements = scores.Achievements;
            storageData.BaseScores   = scores.BaseScores;
            storageData.Frags        = scores.Frags.Select(x => new ScoreSidCounterStorageData {
                Sid = x.Key.Sid, Value = x.Value
            }).ToArray();
            //storageData.Places = scores.Places.Select(x => new OffsetCoords(x.OffsetX, x.OffsetY)).ToArray();
            storageData.PlaceTypes = scores.PlaceTypes.Select(x => new ScoreSidCounterStorageData {
                Sid = x.Key.Sid, Value = x.Value
            }).ToArray();
            storageData.TurnCounter = scores.TurnCounter;
            storageData.Turns       = scores.Turns;

            return(storageData);
        }