Beispiel #1
0
        public static Dictionary <CharacterType, PersistedCharacterData> GetPersistedCharacterData(long accountId)
        {
            Dictionary <CharacterType, PersistedCharacterData> characterDatas = new Dictionary <CharacterType, PersistedCharacterData>();

            foreach (CharacterConfig characterConfig in CharacterConfigs.Characters.Values)
            {
                if (characterConfig.AllowForPlayers)
                {
                    PersistedCharacterData persistedCharacterData = new PersistedCharacterData(characterConfig.CharacterType);
                    persistedCharacterData.CharacterComponent  = GetCharacterComponent(accountId, characterConfig.CharacterType);
                    persistedCharacterData.CharacterType       = characterConfig.CharacterType;
                    persistedCharacterData.ExperienceComponent = new ExperienceComponent {
                        Level = 50
                    };
                    characterDatas.Add(characterConfig.CharacterType, persistedCharacterData);
                }
            }

            return(characterDatas);
        }
Beispiel #2
0
        public static List <PersistedCharacterData> CreateCharacterDataList()
        {
            var data = new List <PersistedCharacterData>();

            foreach (CharacterType characterType in Enum.GetValues(typeof(CharacterType)))
            {
                var characterData = new PersistedCharacterData(characterType)
                {
                    CharacterComponent =
                    {
                        Unlocked            = true,
                        LastSelectedLoadout =    0,
                        CharacterLoadouts   = new List <CharacterLoadout>()
                        {
                            PlayerUtils.GetLoadout(0, characterType)
                        },
                        Skins                            = new List <PlayerSkinData>()
                        {
                            new PlayerSkinData()
                            {
                                Unlocked = true,
                                Patterns = new List <PlayerPatternData>()
                                {
                                    new PlayerPatternData()
                                    {
                                        Colors           = new List <PlayerColorData>()
                                        {
                                            new PlayerColorData()
                                            {
                                                Unlocked = true
                                            },
                                            new PlayerColorData()
                                            {
                                                Unlocked = true
                                            },
                                            new PlayerColorData()
                                            {
                                                Unlocked = true
                                            },
                                            new PlayerColorData()
                                            {
                                                Unlocked = true
                                            }
                                        },
                                        Unlocked         = true,
                                    },
                                    new PlayerPatternData()
                                    {
                                        Colors           = new List <PlayerColorData>()
                                        {
                                            new PlayerColorData()
                                            {
                                                Unlocked = true
                                            },
                                            new PlayerColorData()
                                            {
                                                Unlocked = true
                                            }
                                        },
                                        Unlocked         = true,
                                    }
                                }
                            }
                        }
                    }
                };
                data.Add(characterData);
            }

            return(data);
        }