Exemplo n.º 1
0
        public void GetBuildings()
        {
            Graph g2 = new Graph(bb);
            g.Add(b1);
            g.SetWeight(b1, 1);
            g2.Add(b1);
            g2.SetWeight(b1, 1);

            g.Add(b2);
            g.SetWeight(b2, 2);
            g2.Add(b2);
            g2.SetWeight(b2, 2);

            g.Add(b3);
            g.SetWeight(b3, 3);
            g2.Add(b3);
            g2.SetWeight(b3, 3);

            IEnumerable<Building> it = g.GetBuildings();
            foreach(Building b in it)
            {
                g2.SetWeight(b, g.GetWeight(b)+10);
            }

            Assert.AreEqual(11, g2.GetWeight(b1));
            Assert.AreEqual(12, g2.GetWeight(b2));
            Assert.AreEqual(13, g2.GetWeight(b3));
        }
        public void AddBaseBuildings()
        {
            g1 = gc.AddBaseBuilding(b1);
            g2 = gc.AddBaseBuilding(ba);

            Assert.AreEqual(g1, gc.GetGraph(b1));
            Assert.AreEqual(g2, gc.GetGraph(ba));
        }
 public void init()
 {
     this.p = new Player();
     this.bb = new BaseBuilding("test", 0, 0, new Player(), new LinkedList<Tile>());
     this.g = new Graph(bb);
     this.ua = new UnitAccountant(p);
     this.p.AddGraph(g);
 }
Exemplo n.º 4
0
 public void Init()
 {
     size = 0;
     g = new Graph(bb);
     size += 1;
 }
Exemplo n.º 5
0
        /*public Color GetColor()
        {
            switch (colour)
            {
                case PlayerColour.RED:
                    return Color.Red;
                case PlayerColour.BLUE:
                    break;
                case PlayerColour.GREEN:
                    break;
                case PlayerColour.YELLOW:
                    break;
                case PlayerColour.PURPLE:
                    break;

            }
        }*/
        public void AddGraph(Graph g)
        {
            if (!graphs.Contains(g))
            {
                graphs.Add(g);
            }
        }