Ejemplo n.º 1
0
        public override void Receive(InteractiveElement element)
        {
            base.Receive(element);

            if (element is ToppingInteractiveElement topping)
            {
                StartCoroutine(nameof(Interact), topping);
            }
        }
Ejemplo n.º 2
0
        public override void Receive(InteractiveElement element)
        {
            if (element is PlateInteractiveElement plate)
            {
                HasContent      = true;
                CanInteractWith = false;

                AudioManager.PlaySound(SFXSound);

                _gameManager.OnOrderCompleted(this);
                _gameManager.AddScore(CalculateScore(plate));

                StartCoroutine(nameof(Consume));
            }
        }
Ejemplo n.º 3
0
        public override bool CanReceive(InteractiveElement element)
        {
            if (!CanInteractWith)
            {
                return(false);
            }

            switch (element.GetElementType)
            {
            case ElementType.PlateStack:
                if (HasPlate)
                {
                    return(false);
                }
                break;

            case ElementType.Broth:
                if (HasBroth || !HasPlate)
                {
                    return(false);
                }
                break;

            case ElementType.Strainer:
                if (HasNoodles || !HasPlate)
                {
                    return(false);
                }
                break;

            case ElementType.CuttingBoard:
                if (!HasPlate || !HasBroth || !HasNoodles)
                {
                    return(false);
                }
                break;

            default:
                return(false);
            }

            return(true);
        }
 public override bool CanReceive(InteractiveElement element) => true;
Ejemplo n.º 5
0
        public override void Receive(InteractiveElement element)
        {
            base.Receive(element);

            switch (element.GetElementType)
            {
            case ElementType.PlateStack:
                Image.sprite = LastSprite = plate;
                HasPlate     = true;
                HasContent   = true;
                break;

            case ElementType.Broth:
                if (element is BrothInteractiveElement brothElement)
                {
                    BrothType = brothElement.GetBrothType;

                    Sprite brothSprite;
                    if (!HasNoodles)
                    {
                        brothSprite = BrothType == BrothType.Shio ? plateWithClearBroth : plateWithDarkBroth;
                    }
                    else
                    {
                        brothSprite = BrothType == BrothType.Shio
                                    ? plateWithClearBrothWithNoodles
                                    : plateWithDarkBrothWithNoodles;
                    }

                    Image.sprite = LastSprite = brothSprite;

                    HasBroth = true;
                }
                break;

            case ElementType.Strainer:
                Sprite noodlesSprite;
                if (!HasBroth)
                {
                    noodlesSprite = plateWithNoodles;
                }
                else
                {
                    noodlesSprite = BrothType == BrothType.Shio
                                ? plateWithClearBrothWithNoodles
                                : plateWithDarkBrothWithNoodles;
                }

                Image.sprite = LastSprite = noodlesSprite;
                HasNoodles   = true;
                break;

            case ElementType.CuttingBoard:
                if (element is CuttingBoardInteractiveElement cuttingBoard && !ToppingTypes.Contains(cuttingBoard.ToppingType))
                {
                    ToppingTypes.Add(cuttingBoard.ToppingType);
                    Image.sprite = LastSprite = MergeSprites(Image.sprite, cuttingBoard.ToppingFinalSprite);
                }
                break;
            }
        }
        public override void Receive(InteractiveElement element)
        {
            base.Receive(element);

            StartCoroutine(nameof(Interact));
        }
Ejemplo n.º 7
0
 public virtual bool CanReceive(InteractiveElement element) => CanInteractWith && !HasContent;
Ejemplo n.º 8
0
 public virtual void Receive(InteractiveElement element)
 {
 }
Ejemplo n.º 9
0
 public override bool CanReceive(InteractiveElement element) => CanInteractWith && !HasContent;