Пример #1
0
    IEnumerable <int> BreederWork()
    {
        Warehouse warehouse = null;

        foreach (var w in FindBuilding <Warehouse>(w => w.Has(Resource.Food)))
        {
            if (w == null)
            {
                yield return(0);
            }
            else
            {
                warehouse = w;
            }
        }

        warehouse.RemoveElement(Resource.Food);
        animation.Hold(Resource.Food);

        House h = null;

        foreach (var b in FindBuilding <House>(b => b.CanStoreFood(), true, true))
        {
            if (b == null)
            {
                yield return(0);
            }
            else
            {
                h = b;
            }
        }

        animation.Drop();
        h.AddFood();
        animation.Act(breedingTime / speedup, 3, InteractionWorldPos(h));
        while (animation.IsActing)
        {
            yield return(0);
        }
    }