Exemplo n.º 1
0
        public void  run(AreaDbContext DB)
        {
            List <WoWCharacterModel> characters = DB.wowcharactermodels.ToList();

            if (WoW.getIndex() == 0)
            {
                List <WoWCharacterModel> new_characters = WoW.getCharacters();
                foreach (var character in new_characters)
                {
                    if (!WoW.alreadyExists(characters, character))
                    {
                        DB.wowcharactermodels.Add(character);
                        DB.SaveChanges();
                        Spotify.postReaction(WoW.getAction());
                    }
                }
            }
            else
            {
                foreach (var character in characters)
                {
                    if (WoW.checkAndUpdateCharacter(character, DB))
                    {
                        Spotify.postReaction(WoW.getAction());
                    }
                }
            }
        }
Exemplo n.º 2
0
        public void run(AreaDbContext DB)
        {
            string info = facebook.getAction();

            if (info == null || info == last_event)
            {
                return;
            }
            last_event      = info;
            area.last_event = info;
            DB.areas.Update(area);
            DB.SaveChanges();
            spotify.postReaction(info);
        }
Exemplo n.º 3
0
        public void run(AreaDbContext DB)
        {
            string tweet = twitter.getAction();

            if (tweet == null || tweet == last_event)
            {
                return;
            }
            last_event      = tweet;
            area.last_event = tweet;
            DB.areas.Update(area);
            DB.SaveChanges();
            spotify.postReaction(tweet);
        }