void Awake()
 {
     mInventory      = GetComponent <DwarfInventory>();
     mStatus         = GetComponent <DwarfStatus>();
     mTaskQueue      = new LinkedList <Task>();
     mTasksBlackList = new List <int>();
 }
Beispiel #2
0
 public virtual void Perform(DwarfInventory inventory, System.Action onFinish)
 {
     mDwarfInventory   = inventory;
     mDwarfStatus      = inventory.GetComponent <DwarfStatus>();
     mDwarfBehaviour   = inventory.GetComponent <DwarfBehaviour>();
     mOnFinishCallback = onFinish;
 }
    public override void Perform(DwarfInventory inventory, System.Action onFinish)
    {
        base.Perform(inventory, onFinish);
        this.hardness = 2f;

        inventory.StartCoroutine(FinishPerform());
    }
Beispiel #4
0
    public override void Perform(DwarfInventory inventory, System.Action onFinish)
    {
        Item item = mGameItem.PickUp();

        inventory.AddItem(item, 1);

        onFinish();
    }
Beispiel #5
0
    public override void Perform(DwarfInventory inventory, System.Action onFinish)
    {
        base.Perform(inventory, onFinish);

        mDwarfStatus.StartSleep(mBed);
        mBed.StartSleep();

        mDwarfInventory.StartCoroutine(FinishPerform());
    }
    public override bool Check(DwarfInventory inventory)
    {
        if (target == null)
        {
            Cancel();
            return(false);
        }

        return(true);
    }
Beispiel #7
0
    public override bool Check(DwarfInventory inventory)
    {
        foreach (Building.Requirement req in building.requirements)
        {
            if (!inventory.CheckItem(req.item, req.amount))
            {
                Cancel();
                return(false);
            }
        }

        return(true);
    }
Beispiel #8
0
 public virtual bool Check(DwarfInventory inventory)
 {
     return(false);
 }
Beispiel #9
0
 public override void Perform(DwarfInventory inventory, System.Action onFinish)
 {
     onFinish();
 }
Beispiel #10
0
 public override bool Check(DwarfInventory inventory)
 {
     return(true);
 }
Beispiel #11
0
 void Awake()
 {
     mBehaviour = GetComponent <DwarfBehaviour>();
     mInventory = GetComponent <DwarfInventory>();
 }