예제 #1
0
        //Harvest Coops
        private void HarvestProducts()
        {
            Farm    pFarm  = Game1.getFarm();
            SFarmer Player = Game1.player;

            foreach (Building building in pFarm.buildings)
            {
                if (building is Coop)
                {
                    List <Vector2> coops = new List <Vector2>();

                    foreach (KeyValuePair <Vector2, SObject> pair in building.indoors.Objects)
                    {
                        SObject @object = pair.Value;
                        if (@object.isAnimalProduct() || @object.parentSheetIndex == 107)
                        {
                            if (this.AddToPlayer(@object, Player))
                            {
                                coops.Add(pair.Key);
                                Player.gainExperience(0, 5);
                            }
                        }
                    }
                    foreach (Vector2 iLocation in coops)
                    {
                        building.indoors.removeObject(iLocation, false);
                    }
                }
            }
        }
예제 #2
0
 public bool IsReadyForHarvest()
 {
     return((_object.readyForHarvest == new NetBool(true)) ||
            _object.isAnimalProduct()); // animal products laying around are always ready for harvest
 }