public void CoalitionMaxTest()
        {
            Coalition c = new Coalition(5);
            ValueFunction vf = new ValueFunction();
            int[] materials = new int[5];
            int max = 0;
            materials[0] = 1;
            materials[1] = 5;
            materials[2] = 3;
            materials[3] = 8;
            materials[4] = 4;
            /*int[] materials2 = new int[3];
            materials[0] = 1;
            materials[1] = 3;
            materials[2] = 5; */
            /*int[] materials3 = new int[4];
            materials[0] = 10;
            materials[1] = 9;
            materials[2] = 3;
            materials[3] = 4;*/
            Dynamic_Games.coop.models.Player p1 = new Dynamic_Games.coop.models.Player(vf, materials);
            //Dynamic_Games.coop.models.Player p2 = new Dynamic_Games.coop.models.Player();
            //Dynamic_Games.coop.models.Player p3 = new Dynamic_Games.coop.models.Player();
            c.addPlayer(p1);
            //c.addPlayer(p2);
            //c.addPlayer(p3);
            p1.Materials = materials;
            //p2.Materials = materials2;
            //p3.Materials = materials3;

            for (int i = 0; i < materials.Length; i++)
            {
                if (materials[i] > max)
                {
                    max = materials[i];
                }
            }
            int res = c.calculateMaximumValue();
            Assert.AreEqual(max, res);
        }
 public Player(ValueFunction valueFunction, int[] materials)
 {
     this.Materials = materials;
     this.ValueFunction = valueFunction;
 }
Esempio n. 3
0
 public Player(ValueFunction valueFunction, int[] materials)
 {
     this.materials     = materials;
     this.valueFunction = valueFunction;
 }