private bool TryHarvestPlant(SoilBin bin) { Seed seed = bin.Harvest(); if (seed != null) { HarvestedFullyGrownPlant(seed); return(true); } return(false); }
protected override bool MeetCriteria(SoilBin bin) { if (bin.CanAddWater() && bin.PercentFull <= waterThreshold && !bin.IsGettingWateredSoon && !bin.CanHarvest()) { bin.IsGettingWateredSoon = true; return(true); } return(false); }
private bool TryPlantSeed(SoilBin bin) { if (bin.CanPlantSeed()) { Seed seed = UseSeedFromInventory(); if (seed != null) { bin.PlantSeed(seed); return(true); } } return(false); }
public List <SoilBin> GetAdjacentBins(int x, int y) { //check up down left right GameObject[] adjacentTiles = new GameObject[4]; adjacentTiles[0] = GetTileGameObject(x, y + 1); adjacentTiles[1] = GetTileGameObject(x, y - 1); adjacentTiles[2] = GetTileGameObject(x - 1, y); adjacentTiles[3] = GetTileGameObject(x + 1, y); //find bins List <SoilBin> adjacentBins = new List <SoilBin>(); for (int i = 0; i < adjacentTiles.Length; i++) { SoilBin bin = TryGetBin(adjacentTiles[i]); if (bin != null) { adjacentBins.Add(bin); } } return(adjacentBins); }
private bool TryWaterSeed(SoilBin bin) { bin.FillWithWater(); return(true); }
protected abstract bool MeetCriteria(SoilBin bin);
protected override bool MeetCriteria(SoilBin bin) { return(false); }
protected override bool MeetCriteria(SoilBin bin) { return(bin.CanHarvest()); }
public void AddToBin(SoilBin bin) { this.bin = bin; }
protected override bool MeetCriteria(SoilBin bin) { return(bin.CanPlantSeed()); }