Ejemplo n.º 1
0
    public void UpdateHexagons(HexCell f, HexCell t)
    {
        Player fr = null;
        Player to = null;

        foreach (var player in players)
        {
            if (player.color == f.color)
            {
                fr = player;
            }
            if (player.color == t.color)
            {
                to = player;
            }
        }

        if (fr != null && to == null)
        {
            scoreboard.ChangeHexagons(fr, 1);
        }

        if (fr != null && to != null)
        {
            scoreboard.ChangeHexagons(fr, 1);
            scoreboard.ChangeHexagons(to, -1);
        }
    }