Exemple #1
0
 /// <summary>
 /// Karakterler arası görev dağılımı bütün görevleri siler bunu ekler
 /// </summary>
 /// <param name="byWho"></param>
 /// <param name="order"></param>
 /// <param name="receivedCallback"></param>
 public void GiveSetOrder(NPCLogic byWho, Job order)
 {
     if (byWho != null /*Eğer karakteri sevmiyorsa görevi almasın falan filan logic buraya*/)
     {
         SetJob(order);
         byWho.InteractionReceive(this, "order_received");
     }
     else
     {
         byWho.InteractionReceive(this, "order_declined");
     }
 }
Exemple #2
0
    /// <summary>
    /// Karakterler arası görev dağılımı priority olarak ekler öncelikli görev olarak ekler
    /// </summary>
    /// <param name="byWho"></param>
    /// <param name="orders"></param>
    /// <param name="receivedCallback"></param>
    public void GivePriorityOrders(NPCLogic byWho, Job[] orders)
    {
        if (byWho != null /*Eğer karakteri sevmiyorsa görevi almasın falan filan logic buraya*/)
        {
            AddPriorityJobs(orders);

            byWho.InteractionReceive(this, "order_received");
        }
        else
        {
            byWho.InteractionReceive(this, "order_declined");
        }
    }
Exemple #3
0
 /// <summary>
 /// Karakterler arası görev dağılımı bütün görevleri siler bunu ekler
 /// </summary>
 /// <param name="byWho"></param>
 /// <param name="orders"></param>
 /// <param name="receivedCallback"></param>
 public void GiveSetOrders(NPCLogic byWho, Job[] orders)
 {
     if (byWho != null /*Eğer karakteri sevmiyorsa görevi almasın falan filan logic buraya*/)
     {
         SetJob(orders[0]);
         for (int i = 1; i < orders.Length; i++)
         {
             AddJob(orders[i]);
         }
         byWho.InteractionReceive(this, "order_received");
     }
     else
     {
         byWho.InteractionReceive(this, "order_declined");
     }
 }
Exemple #4
0
    /// <summary>
    /// This function is called by other npc's in the game
    /// </summary>
    /// <param name="whoIsReporting"> Who is doing to reportig </param>
    /// <param name="data"> Data that is being sent </param>
    public void Report(NPCLogic whoIsReporting, string data)
    {
        if (npcData.isCheif)
        {
            Debug.Log(name + " " + npcData.isCheif + " cheif and " + whoIsReporting.name + " is reporting");
            var workType = npcData.workingOn.GetWorkType();
            switch (workType)
            {
            case Work.WorkType.WOOD_HARVEST_WORK:
            {
                Debug.Log("HERE1");
                if (data.Equals("Completed"))
                {
                    Debug.Log("HERE2");
                    var woodHarvestWork = npcData.workingOn as HarvestWoodWork;
                    woodHarvestWork.GiveWoodCutJobToWorker(whoIsReporting);
                    whoIsReporting.InteractionReceive(this, data);
                }
            }

            break;

            case Work.WorkType.STONE_HARVEST_WORK:
            {
                Debug.Log("HERE1");
                if (data.Equals("Completed"))
                {
                    Debug.Log("HERE2");
                    var stoneHarvestWork = npcData.workingOn as HarvestStoneWork;
                    stoneHarvestWork.GiveStoneMineJobToWorker(whoIsReporting);
                    whoIsReporting.InteractionReceive(this, data);
                }
            }
            break;
            }
        }
        else
        {
        }
    }