示例#1
0
        public void Update(DiscordApiData data)
        {
            Name            = data.GetString("name");
            Icon            = data.GetString("icon");
            Splash          = data.GetString("splash");
            RegionId        = data.GetString("region");
            AfkTimeout      = data.GetInteger("afk_timeout").Value;
            IsEmbedEnabled  = data.GetBoolean("embed_enabled") ?? false;
            OwnerId         = data.GetSnowflake("owner_id").Value;
            AfkChannelId    = data.GetSnowflake("afk_channel_id");
            EmbedChannelId  = data.GetSnowflake("embed_channel_id");
            ApplicationId   = data.GetSnowflake("application_id");
            IsWidgetEnabled = data.GetBoolean("widget_enabled") ?? false;
            WidgetChannelId = data.GetSnowflake("widget_channel_id");
            SystemChannelId = data.GetSnowflake("system_channel_id");

            ExplicitContentFilter       = (GuildExplicitContentFilterLevel)data.GetInteger("explicit_content_filter").Value;
            VerificationLevel           = (GuildVerificationLevel)data.GetInteger("verification_level").Value;
            DefaultMessageNotifications = (GuildNotificationOption)(data.GetInteger("default_message_notifications") ?? 0);
            MfaLevel = (GuildMfaLevel)data.GetInteger("mfa_level").Value;

            // Deserialize features
            IList <DiscordApiData> featuresArray = data.GetArray("features");
            List <string>          features      = new List <string>(featuresArray.Count);

            for (int i = 0; i < features.Count; i++)
            {
                features[i] = featuresArray[i].ToString();
            }

            Features = features;

            // Deserialize roles
            Roles.Clear();
            IList <DiscordApiData> rolesArray = data.GetArray("roles");

            for (int i = 0; i < rolesArray.Count; i++)
            {
                DiscordRole role = new DiscordRole(Http, Id, rolesArray[i]);
                Roles[role.Id] = role;
            }

            // Deserialize emojis
            Emojis.Clear();
            IList <DiscordApiData> emojisArray = data.GetArray("emojis");

            for (int i = 0; i < emojisArray.Count; i++)
            {
                DiscordEmoji emoji = new DiscordEmoji(emojisArray[i]);
                Emojis[emoji.Id] = emoji;
            }

            Dirty();
        }
示例#2
0
        internal async void matenerOVoltearTarjeta(int numero)
        {
            if (estado == -2)
            {
                if (Emojis[numero] != Emojis[anterior])
                {
                    await Task.Delay(TimeSpan.FromSeconds(1));

                    Emojis[numero].voltear();
                    Emojis[anterior].voltear();
                    CantidadReveladas -= 2;
                    OnPropertyChanged("Emojis");
                }
                else if (tam == CantidadReveladas)
                {
                    Emojis.Clear();
                    fillList();
                    OnPropertyChanged("Emojis");
                    CantidadReveladas = 0;
                }
                estado = -1;
            }
        }