private int checkBonus(int x, int y)
 {
     if (grid.getBuilding(x, y) == 2)
     {
         //Replace return 1 with return bonus
         return(1);
     }
     return(0);
 }
 private int checkBonus(int x, int y)
 {
     if (grid.getBuilding(x, y) == 2)
     {
         //For now pylons will increase energy and mass
         return(1);
     }
     return(0);
 }
Exemple #3
0
    public bool checkPosition(GameObject cursor)
    {
        //plus 5 comes from the offset
        int             bldType    = grid.getBuilding(cursor.transform.position.x, cursor.transform.position.z);
        SortedSet <int> validTypes = GetValidFoundations(cursor);

        if (validTypes.Contains(bldType))
        {
            foreach (Transform child in cursor.transform)
            {
                if (!validTypes.Contains(grid.getBuilding(child.position.x, child.position.z)))
                {
                    return(false);
                }
            }
        }
        else
        {
            return(false);
        }
        return(true);
    }