예제 #1
0
        public bool MoveStack(IItemStack stack, IStorage newStorage)
        {
            if (!this.Stacks.Contains(stack))
                return false;

            if (!newStorage.CanAdd(stack))
                return false;

            this.RemoveStack(stack);
            if (newStorage.AddStack(stack))
                return true;

            // Recover the stack
            this.AddStack(stack);
            return false;
        }