Beispiel #1
0
        public static bool ReadCanBeCooked(this ICookable food)
        {
            var old = Scanner.Range;

            Scanner.Range = 1;
            var sourcelist = new List <ushort>();

            for (ushort v = 0xDE3; v <= 0xDE9; v++) //Camp Fire
            {
                sourcelist.Add(v);
            }

            for (ushort v = 0x461; v <= 0x48E; v++) // Sandstone oven/fireplace
            {
                sourcelist.Add(v);
            }

            for (ushort v = 0x92B; v <= 0x96C; v++) // Stone oven/fireplace
            {
                sourcelist.Add(v);
            }

            for (ushort v = 0x184A; v <= 0x184C; v++) // Heating stand (left)
            {
                sourcelist.Add(v);
            }

            for (ushort v = 0x184E; v <= 0x1850; v++) // Heating stand (right)
            {
                sourcelist.Add(v);
            }

            for (ushort v = 0x398C; v <= 0x399F; v++) // Fire field
            {
                sourcelist.Add(v);
            }

            sourcelist.Add(0xFAC); //Fire Pit

            var state = (Scanner.Find <UOEntity>(sourcelist, 0xFFFF, 0x0, false).Count > 0);

            Scanner.Range = old;
            return(state);
        }
    private IEnumerator CookAnimate(ICookable cookable)
    {
        float time    = cookable.GetTotalDuration();
        float elapsed = cookable.GetReadiness();

        _cookable = cookable.GetTransform();

        _cookable.SetParent(_cookingObjectParent);
        _cookable.localPosition = Vector3.zero;
        _cookable.localRotation = Quaternion.identity;
        _steam.Play();

        while (elapsed < time && _cookable != null)
        {
            cookable.Cook(elapsed);
            _ui.SetCookingState(cookable.GetTotalDuration(), cookable.GetReadiness());

            elapsed += Time.deltaTime;
            yield return(null);
        }
    }
Beispiel #3
0
 public Chef(ICookable kitchen)
 {
     Kitchen = kitchen;
 }
 private void Cook(ICookable cookable)
 {
     _cookingProcess = StartCoroutine(CookAnimate(cookable));
 }
 /// <summary>
 /// New common functionality for ICookable
 /// </summary>
 /// <param name="food"></param>
 public void Eat(ICookable food)
 {
     food.Cook();
     Console.WriteLine("Wait 5 minutes and eat");
 }