public static void OnPlayerRecipeSettingChanged(RecipeStorage.PlayerRecipeStorage storage, Recipe recipe, Box <RecipeStorage.RecipeSetting> recipeSetting) { BaseRecipe bRecipe; if (recipes.TryGetValue(recipe.Name, out bRecipe)) { bRecipe.OnPlayerRecipeSettingChanged(storage, recipeSetting); } }
public static void OnPlayerRecipeSettingChanged(RecipeStorage.PlayerRecipeStorage storage, Recipe recipe, Box <RecipeStorage.RecipeSetting> recipeSetting) { //If the setting changed is from a fake player if (storage.Player.ID.type == NetworkID.IDType.Steam && storage.Player.ID.steamID.GetEAccountType() == Steamworks.EAccountType.k_EAccountTypeAnonUser) { Team team = TeamManager.GetTeamManager().GetTeamOfFakePlayer(storage.Player); if (null == team) { return; } foreach (Players.Player plr in team.GetConnectedPlayersPlayers()) { RecipePlayer.SendRecipes(plr); //Recipes in job (how many create) Synchronization (Depends on the stockpile) } } }
public override void OnPlayerRecipeSettingChanged(RecipeStorage.PlayerRecipeStorage storage, Box <RecipeStorage.RecipeSetting> recipeSetting) { Pipliz.Chatting.Chat.SendToAll("Testing OnPlayerRecipeSettingChanged"); }
public override int ShouldBeMade(Stockpile stockpile, RecipeStorage.PlayerRecipeStorage playerStorage = null) { return(RecipeStorage.GetPlayerStorage(stockpile.Owner).GetRecipeSetting(this.Name).Limit); }
/// <summary> /// Don't store the Box<>, it's re-used. /// See storage.Player for the owner of the recipe /// This callback is also called upon loading the settings from json - but only for non-default values (defaults aren't stored) /// No registered uses /// </summary> /// <param name="storage">the players' recipe settings storage</param> /// <param name="recipeSetting">the new setting for the recipe</param> public virtual void OnPlayerRecipeSettingChanged(RecipeStorage.PlayerRecipeStorage storage, Pipliz.Box <RecipeStorage.RecipeSetting> recipeSetting) { }