Пример #1
0
        private void ConstructLookups()
        {
            Lookups lookups = new Lookups();

            lookups.clubNames   = _savegame.Clubs.Values.ToDictionary(x => x.ClubId, x => x.Name);
            lookups.firstNames  = _savegame.FirstNames;
            lookups.secondNames = _savegame.Surnames;
            lookups.commonNames = _savegame.CommonNames;
            lookups.nations     = NationConverter.ConvertNations(_savegame.Nations);
            _displayHelper      = new PlayerDisplayHelper(lookups, _savegame.GameDate);
        }
Пример #2
0
        public static Dictionary <int, Nation> GetDataFileNationDictionary(SaveGameFile savegame)
        {
            Dictionary <int, Nation> dic = new Dictionary <int, Nation>();
            var fileFacts = DataFileFacts.GetDataFileFacts().First(x => x.Type == DataFileType.Nations);
            var bytes     = GetDataFileBytes(savegame, fileFacts.Type, fileFacts.DataSize);

            NationConverter converter = new NationConverter();

            foreach (var item in bytes)
            {
                var nation = converter.Convert(item);

                if (nation.Id != -1)
                {
                    if (!dic.ContainsKey(nation.Id))
                    {
                        dic.Add(nation.Id, nation);
                    }
                }
            }

            return(dic);
        }