Esempio n. 1
0
        public void OnCharacterReceived(UICharacterDetails characterDetails)
        {
            var path          = Utils.GetCharacterPath(characterDetails);
            var characterView = CreateAndShowCharacterView(path);

            if (characterView != null)
            {
                characterView.Id             = characterDetails.GetCharacterId();
                characterView.CharacterName  = characterDetails.GetCharacterName();
                characterView.CharacterIndex = characterDetails.GetCharacterIndex();
                characterView.CharacterClass = characterDetails.GetCharacterClass();

                var characterIndex = characterDetails.GetCharacterIndex();
                if (characterIndex != UICharacterIndex.Zero)
                {
                    if (characterViewCollection == null)
                    {
                        var views =
                            new IClickableCharacterView[] { null, null, null };
                        characterViewCollection =
                            new CharacterViewCollection(views);
                    }

                    var index = (int)characterIndex;
                    characterViewCollection?.Set(index, characterView);
                }
            }
        }