示例#1
0
 public Coach(string n, string s, int sk, string m)
 {
     CoachName = n;
     CoachSurname = s;
     SkillAvg = sk;
     favouriteModule = new Module(m);
 }
示例#2
0
        public bool check(Team t, Module m)
        {
           
            foreach (Player pl in t.getPlayers())
            {
                int i = roles.IndexOf(pl.Role);
                if (i >= 0) nplayr[i] += 1;
            }
            int length = nplayr.Count();
            int[] needed = playerForRolesForModule(m.SelectedModule);
            for (int i = 0; i < length; i++)
            {
                if (nplayr[i] < needed[i]) return false;
            }

            return true;
        }
示例#3
0
 public void TestModuloEValidita()
 {
     Module m = new Module("4-4-2");
     List<Player> players = GameUtils.getRandomPlayersList(20);
     Team t = new Team("Ababa");
     foreach (Player item in players)
     {
         t.addPlayer(item);
     }
     Console.WriteLine(t.ToStringFull());
     if (m.check(t, m))
         Console.WriteLine("OK");
     else
         Console.WriteLine("Nope");
 }