Example #1
0
    //This Function Checks if the player owns the whole Group of Cities or not.
    public bool IsGroupOwned(City city, Monopoly_Master Temp)
    {
        bool owned = false;

        for (int i = 0; i < Temp.GetGroups()[city.Get_GroupNumber()].Count; i++)
        {
            if (OwnedCities.Contains(Temp.GetGroups()[city.Get_GroupNumber()][i]))
            {
                owned = true;
            }
            else
            {
                owned = false;
                break;
            }
        }
        if (owned)
        {
            return(true);
        }
        else
        {
            return(false);
        }
    }
Example #2
0
    //This Function Checks if the player owns the whole Group of Cities or not.
    public bool IsGroupOwned(City city, Monopoly_Master Temp)
    {
        bool owned     = false;
        var  ThisGroup = (List <City>)Temp.Groups[city.GroupNumber];

        foreach (City GroupCity in ThisGroup)
        {
            if (OwnedCities.Contains(GroupCity))
            {
                owned = true;
            }
            else
            {
                owned = false;
                break;
            }
        }
        return(owned);
    }