private bool isSpawnPossible(int val) { int len = avaibleSlots; if (val < 0 || val > 3) { return(false); } if (roots.getWater() < prefabBank.waterCosts[val - 1]) { return(false); } if (foliage.getSun() < prefabBank.sunCosts[val - 1]) { return(false); } for (int i = 0; i < len; i++) { if (slots[i]) { return(true); } } return(true); }
private bool isResourceAvaible() { if (roots.getWater() >= waterCost) { if (foliage.getSun() >= sunCost) { return(true); } } return(false); }