public void StoreAll(NPC target) { DBRessources.GetInstance().AddRessourceToDB(RessourceType.WOOD, target.GetWoodCargo()); target.AddCargo (-target.GetWoodCargo(), RessourceType.WOOD); DBRessources.GetInstance().AddRessourceToDB(RessourceType.STONE, target.GetStoneCargo()); target.AddCargo (-target.GetStoneCargo(), RessourceType.STONE); DBRessources.GetInstance().AddRessourceToDB(RessourceType.FOOD, target.GetFoodCargo()); target.AddCargo (-target.GetFoodCargo(), RessourceType.FOOD); }
public void StoreAll(NPC target) { DBRessources.GetInstance().AddRessourceToDB(RessourceType.WOOD, target.GetWoodCargo()); target.AddCargo(-target.GetWoodCargo(), RessourceType.WOOD); DBRessources.GetInstance().AddRessourceToDB(RessourceType.STONE, target.GetStoneCargo()); target.AddCargo(-target.GetStoneCargo(), RessourceType.STONE); DBRessources.GetInstance().AddRessourceToDB(RessourceType.FOOD, target.GetFoodCargo()); target.AddCargo(-target.GetFoodCargo(), RessourceType.FOOD); }
public IEnumerator RessourceGiver(float pTime,NPC pTarget,RessourceType pRessource) { while(presentWorkers.Contains(pTarget) && listedWorkers.Contains(pTarget)){ if(pTarget.AddCargo (10, pRessource)){ ressourceStock = ressourceStock - 10; } else{ break; } yield return new WaitForSeconds(pTime); } }
public IEnumerator RessourceGiver(float pTime, NPC pTarget, RessourceType pRessource) { while (presentWorkers.Contains(pTarget) && listedWorkers.Contains(pTarget)) { if (pTarget.AddCargo(10, pRessource)) { ressourceStock = ressourceStock - 10; } else { break; } yield return(new WaitForSeconds(pTime)); } }