示例#1
0
        /**
         * <summary>Creates a new instance of the 'Containter: Add or remove' Action, set to remove all inventory items in a Constainer</summary>
         * <param name = "containerToModify">The Container to modify</param>
         * <param name = "transferToPlayer">If True, the current Player will receive the items</param>
         * <returns>The generated Action</returns>
         */
        public static ActionContainerSet CreateNew_RemoveAll(Container containerToModify, bool transferToPlayer = false)
        {
            ActionContainerSet newAction = (ActionContainerSet)CreateInstance <ActionContainerSet>();

            newAction.containerAction  = ContainerAction.RemoveAll;
            newAction.container        = containerToModify;
            newAction.transferToPlayer = transferToPlayer;

            return(newAction);
        }
示例#2
0
        /**
         * <summary>Creates a new instance of the 'Containter: Add or remove' Action, set to add an inventory item to a Constainer</summary>
         * <param name = "containerToModify">The Container to modify</param>
         * <param name = "itemIDToAdd">The ID of the inventory item to add to the Container</param>
         * <param name = "instancesToAdd">If multiple instances of the item can be held, the number to be added</param>
         * <returns>The generated Action</returns>
         */
        public static ActionContainerSet CreateNew_Add(Container containerToModify, int itemIDToAdd, int instancesToAdd = 1)
        {
            ActionContainerSet newAction = (ActionContainerSet)CreateInstance <ActionContainerSet>();

            newAction.containerAction = ContainerAction.Add;
            newAction.container       = containerToModify;
            newAction.invID           = itemIDToAdd;
            newAction.setAmount       = true;
            newAction.amount          = instancesToAdd;

            return(newAction);
        }
示例#3
0
        /**
         * <summary>Creates a new instance of the 'Containter: Add or remove' Action, set to remove an inventory item from a Constainer</summary>
         * <param name = "containerToModify">The Container to modify</param>
         * <param name = "itemIDToRemove">The ID of the inventory item to remove from the Container</param>
         * <param name = "instancesToAdd">If multiple instances of the item can be held, the number to be from</param>
         * <param name = "transferToPlayer">If True, the current Player will receive the item</param>
         * <returns>The generated Action</returns>
         */
        public static ActionContainerSet CreateNew_Remove(Container containerToModify, int itemIDToRemove, int instancesToRemove = 1, bool transferToPlayer = false)
        {
            ActionContainerSet newAction = (ActionContainerSet)CreateInstance <ActionContainerSet>();

            newAction.containerAction  = ContainerAction.Remove;
            newAction.container        = containerToModify;
            newAction.invID            = itemIDToRemove;
            newAction.setAmount        = true;
            newAction.amount           = instancesToRemove;
            newAction.transferToPlayer = transferToPlayer;

            return(newAction);
        }