/* * Add an IJunimoAbility to the list of possible actions if allowed */ public void RegisterJunimoAbility(IJunimoAbility junimoAbility) { string name = junimoAbility.AbilityName(); if (!EnabledAbilities.ContainsKey(name)) { EnabledAbilities.Add(name, true); } if (EnabledAbilities[name]) { JunimoCapabilities.Add(junimoAbility); RequiredItems.UnionWith(junimoAbility.RequiredItems()); } }
public bool PerformAction(IJunimoAbility ability, Guid id, Vector2 pos, JunimoHarvester junimo) { JunimoHut hut = Util.GetHutFromId(id); Chest chest = hut.output.Value; Farm farm = Game1.getFarm(); bool success = ability.PerformAction(farm, pos, junimo, chest); List <int> requiredItems = ability.RequiredItems(); if (requiredItems.Count > 0) { UpdateHutContainsItems(id, chest, requiredItems); } return(success); }