Пример #1
0
 private void BanHero(Hero hero)
 {
     if (hero == null)
     {
         return;
     }
     if (PickedAllies.Any(h => h.Hero == hero) ||
         PickedEnemies.Any(h => h.Hero == hero) ||
         Bans.Any(h => h == hero))
     {
         return;
     }
     for (int i = 0; i < AvailableAllies.Count; i++)
     {
         if (AvailableAllies[i].Hero == hero)
         {
             AvailableAllies.RemoveAt(i);
             break;
         }
     }
     for (int i = 0; i < AvailableEnemies.Count; i++)
     {
         if (AvailableEnemies[i].Hero == hero)
         {
             AvailableEnemies.RemoveAt(i);
             break;
         }
     }
     Bans.Add(hero);
 }
Пример #2
0
 public virtual bool IsBanned()
 {
     // TODO Implement IP & Machine ID Bans
     return(Bans.Any(x => x.ExpiresAt > DateTime.Now));
 }