Ejemplo n.º 1
0
    public bool PickUp(DulibaWaitor waitor, DulibaInput.Hand hand, int index)
    {
        if (!CanPickUp(waitor, hand, DulibaInput.ItemChoice.None))
        {
            return(false);
        }

        return(false);

        /*
         * DulibaHand h = null;
         *
         * switch (hand)
         * {
         *      case DulibaInput.Hand.Left:
         *              h = waitor.leftHand;
         *              break;
         *      case DulibaInput.Hand.Right:
         *              h = waitor.rightHand;
         *              break;
         * }
         *
         * if (h != null && h.GetItem() == null)
         * {
         *      if (items[index] != null)
         *      {
         *              h.SetItem(items[index]);
         *              items[index] = null;
         *              RefreshVisuals();
         *      }
         * }
         */
    }
Ejemplo n.º 2
0
    public void PlaceDown(DulibaWaitor waitor, DulibaInput.Hand hand)
    {
        Carryable  item = waitor.GetItemsInHand()[0];
        DulibaHand h    = null;

        switch (hand)
        {
        case DulibaInput.Hand.Left:
            h = waitor.leftHand;
            break;

        case DulibaInput.Hand.Right:
            h = waitor.rightHand;
            break;

        default:
            return;
        }

        for (int i = 0; i < itemSlots; i++)
        {
            if (items[i] == null)
            {
                items[i] = h.ClearItem();
                RefreshVisuals();
                return;
            }
        }
    }
Ejemplo n.º 3
0
    public bool CanPickUp(DulibaWaitor waitor, DulibaInput.Hand hand, DulibaInput.ItemChoice itemChoice)
    {
        /*
         * switch (itemChoice)
         * {
         *      case DulibaInput.ItemChoice.Any:
         *              if (items[0] == null && items[1] == null && items[2] == null && items[3] == null)
         *                      return false;
         *              break;
         *      case DulibaInput.ItemChoice.Item1:
         *              if (items[0] == null)
         *                      return false;
         *              break;
         *      case DulibaInput.ItemChoice.Item2:
         *              if (items[1] == null)
         *                      return false;
         *              break;
         *      case DulibaInput.ItemChoice.Item3:
         *              if (items[2] == null)
         *                      return false;
         *              break;
         *      case DulibaInput.ItemChoice.Item4:
         *              if (items[3] == null)
         *                      return false;
         *              break;
         *      default:
         *              return false;
         * }
         *
         * switch (hand)
         * {
         *      case DulibaInput.Hand.Left:
         *              return waitor.GetEmptyHand() == DulibaInput.Hand.Left;
         *      case DulibaInput.Hand.Right:
         *              return waitor.GetEmptyHand() == DulibaInput.Hand.Right;
         *      case DulibaInput.Hand.Either:
         *              return (waitor.GetEmptyHand() == DulibaInput.Hand.Right) || (waitor.GetEmptyHand() == DulibaInput.Hand.Left) || (waitor.GetEmptyHand() == DulibaInput.Hand.Both);
         *      case DulibaInput.Hand.Both:
         *              return waitor.GetEmptyHand() == DulibaInput.Hand.Both;
         *      default:
         *              return false;
         * }*/

        if (waitor.GetEmptyHand() == DulibaInput.Hand.Both)
        {
            return(true);
        }

        return(false);
    }
Ejemplo n.º 4
0
    public bool CanPlaceDown(DulibaWaitor waitor, DulibaInput.Hand hand)
    {
        Carryable[] items = new Carryable[2];

        switch (hand)
        {
        case DulibaInput.Hand.Left:
            items[0] = waitor.GetItemsInHand()[0];

            if (items[0] != null && GetFreeSlotCount() > 0)
            {
                return(true);
            }
            return(false);

        case DulibaInput.Hand.Right:
            items[0] = waitor.GetItemsInHand()[0];

            if (items[0] != null && GetFreeSlotCount() > 0)
            {
                return(true);
            }
            return(false);

        case DulibaInput.Hand.Either:
            items = waitor.GetItemsInHand();

            if (items[0] != null && GetFreeSlotCount() > 0)
            {
                return(true);
            }
            if (items[1] != null && GetFreeSlotCount() > 0)
            {
                return(true);
            }
            return(false);

        case DulibaInput.Hand.Both:
            items = waitor.GetItemsInHand();

            if (items[0] != null && items[1] != null && GetFreeSlotCount() > 1)
            {
                return(true);
            }
            return(false);

        default:
            return(false);
        }
    }