public void FreeOneBoi(SmolMan m) { Debug.Log("Freeing one boi"); if (m.resourceActive) { Debug.Log("Resource Active"); Vertex v = m.getResource(); Debug.Log(v.getBiome()); Debug.Log(SphereTerrain.STONE_BIOME); if (v.getBiome() == SphereTerrain.WATER_BIOME) { RemoveGoods("Water", 1); } if (v.getBiome() == SphereTerrain.STONE_BIOME) { Debug.Log("Removing Stone"); RemoveGoods("Stone", 1); } if (v.getBiome() == SphereTerrain.OIL_BIOME) { RemoveGoods("Oil", 1); } if (v.getResource() != null) { if (v.getResource().name.Contains("Forest")) { RemoveGoods("Tree", 1); } if (v.getResource().name.Contains("Sand")) { RemoveGoods("Sand", 1); } if (v.getResource().name.Contains("Wheat")) { RemoveGoods("Wheat", 1); } if (v.getResource().name.Contains("Iron")) { RemoveGoods("Iron", 1); } if (v.getResource().name.Contains("Copper")) { RemoveGoods("Copper", 1); } if (v.getResource().name.Contains("Coal")) { RemoveGoods("Coal", 1); } } } busyBois.Remove(m); freeBois.Add(m); m.findNewBuilding(); }
private void detachMan() { if (attachedMan != null) { Community comm = GameObject.FindObjectOfType <Community>(); if (comm != null) { comm.FreeOneBoi(attachedMan); attachedMan = null; } } }
public bool MakeBusyBoi() { Debug.Log("Making busy boi"); if (IsThereAFreeBoi()) { SmolMan becomingBusy = freeBois[0]; busyBois.Add(becomingBusy); freeBois.RemoveAt(0); return(true); } return(false); }
public void attachMan(SmolMan man) { attachedMan = man; }