public RecipeData Pop(string playerName) { RecipeData data = memory[playerName]?.Clone(); memory.Remove(playerName); return(data); }
public RecipeData Clone() { RecipeData newData = new RecipeData(); newData.activeRecipe = activeRecipe.Clone(); newData.activeIngredients = new List <Ingredient>(activeIngredients); newData.droppedItems = new List <RecItem>(droppedItems); return(newData); }
public bool SaveSlot(string playerName, RecipeData data) { if (Contains(playerName)) { return(false); } memory[playerName] = data.Clone(); return(true); }
void OnLogout(PlayerLogoutEventArgs args) { if (args.Player == null || !args.Player.Active) { return; } RecipeData data = args.Player.GetRecipeData(); if (data != null && data.activeRecipe != null) { Memory.Save(args.Player); } }