Exemple #1
0
    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);
    }
Exemple #2
0
    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);
    }
Exemple #3
0
 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);
     }
 }
Exemple #4
0
 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));
     }
 }