Esempio n. 1
0
        public RecipeData Pop(string playerName)
        {
            RecipeData data = memory[playerName]?.Clone();

            memory.Remove(playerName);
            return(data);
        }
Esempio n. 2
0
        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);
        }
Esempio n. 3
0
        public bool SaveSlot(string playerName, RecipeData data)
        {
            if (Contains(playerName))
            {
                return(false);
            }

            memory[playerName] = data.Clone();
            return(true);
        }
Esempio n. 4
0
        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);
            }
        }