// File: /workspace/github_cpp_makefile_star2_O2/JacobLCarter[P]2D-Portal/game.cpp
// Function: Game::moveThroughPortal()
void Game::moveThroughPortal()
{
    //exit if the user does not have the Portal Gun
    if (!checkForPortalGun())
    {
        std::cout << "You do not have the Portal Gun!" << std::endl;
        return;
    }

    char userDirectionInput;

    std::cout << "Would you like to move up(w), down(s), or neither(n)?: ";
    
    //get the user's chosen direction on the vertical plane
    userDirectionInput = getVerticalChar(); 
   
    //re-prompt if the move would place the player out of bounds
    while (isOutOfBounds(userDirectionInput))
    {
        std::cout << "Seriously? You clearly can't go that way. Try again" << std::endl;
        userDirectionInput = getVerticalChar(); 
    }

    //switch to change the player's coordinates based on chosen direction
    switch (userDirectionInput)
    {
        case 'w': testSubject->decrementCurrentX();
                  break;
        case 's': testSubject->incrementCurrentX();
                  break;
        case 'n': break;
    }
   
    //set the player space based on new coordinates
    setPlayerSpace();

    showPosition(userDirectionInput);

    std::cout << "Would you like to move left(a), right(d), or neither(n)?: ";
    
    //get the user's chosen direction on the vertical plane
    userDirectionInput = getHorizontalChar(); 
    
    //re-prompt if the move would place the player out of bounds or on an obstacle
    while (isOutOfBounds(userDirectionInput) || isObstacle(userDirectionInput))
    {
        std::cout << "Seriously? You clearly can't go that way. Try again" << std::endl;
        userDirectionInput = getHorizontalChar(); 
    }
    std::cout << std::endl;

    //switch to change the player's coordinates based on chosen direction
    switch (userDirectionInput)
    {
        case 'a': testSubject->decrementCurrentY();
                  break;
        case 'd': testSubject->incrementCurrentY();
                  break;
        case 'n': break;
    }
    
    //set the player space based on new coordinates
    setPlayerSpace();
    
    //check for a special space type interaction
    playerSpace->spaceTypeSpecialInteraction(testSubject, map->getItem(3), map->getItem(2));
      
    //print the player's character on the map
    showPosition(userDirectionInput);

    //show the map
    map->showMap();
   
    //remove one turn from the total allowed
    turnCounter--;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
callq 0x33e6
testb %al, %al
je 0x32c3
movq 0x7d6b(%rip), %r14      # 0xafd0
leaq 0x412a(%rip), %rsi      # 0x7396
movq %r14, %rdi
callq 0x2190
leaq 0x4153(%rip), %r15      # 0x73ce
callq 0x5547
movl %eax, %r12d
movsbl %al, %ebp
movq %rbx, %rdi
movl %ebp, %esi
callq 0x3068
testb %al, %al
je 0x32a9
movq %r14, %rdi
movq %r15, %rsi
callq 0x2190
movq %rax, %rdi
callq 0x20e0
jmp 0x327b
cmpb $0x73, %r12b
je 0x32e6
movzbl %r12b, %eax
cmpl $0x77, %eax
jne 0x32ef
movq 0x8(%rbx), %rdi
callq 0x3dce
jmp 0x32ef
movq 0x7d06(%rip), %rdi      # 0xafd0
leaq 0x40a5(%rip), %rsi      # 0x7376
callq 0x2190
movq %rax, %rdi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x20e0
movq 0x8(%rbx), %rdi
callq 0x3dc6
movq %rbx, %rdi
callq 0x25ac
movq %rbx, %rdi
movl %ebp, %esi
callq 0x31b8
movq 0x7cc8(%rip), %r14      # 0xafd0
leaq 0x40f3(%rip), %rsi      # 0x7402
movq %r14, %rdi
callq 0x2190
leaq 0x40b0(%rip), %r15      # 0x73ce
callq 0x5476
movl %eax, %r12d
movsbl %al, %ebp
movq %rbx, %rdi
movl %ebp, %esi
callq 0x3068
testb %al, %al
jne 0x3345
movq %rbx, %rdi
movl %ebp, %esi
callq 0x30ee
testb %al, %al
je 0x335a
movq %r14, %rdi
movq %r15, %rsi
callq 0x2190
movq %rax, %rdi
callq 0x20e0
jmp 0x331e
movq 0x7c6f(%rip), %rdi      # 0xafd0
callq 0x20e0
cmpb $0x64, %r12b
je 0x3380
movzbl %r12b, %eax
cmpl $0x61, %eax
jne 0x3389
movq 0x8(%rbx), %rdi
callq 0x3dd2
jmp 0x3389
movq 0x8(%rbx), %rdi
callq 0x3dca
movq %rbx, %rdi
callq 0x25ac
movq 0x8(%rbx), %r14
movq 0x10(%rbx), %r15
movq 0x18(%rbx), %rdi
pushq $0x3
popq %rsi
callq 0x4632
movq %rax, %r12
movq 0x18(%rbx), %rdi
pushq $0x2
popq %rsi
callq 0x4632
movq (%r15), %r8
movq %r15, %rdi
movq %r14, %rsi
movq %r12, %rdx
movq %rax, %rcx
callq *0x10(%r8)
movq %rbx, %rdi
movl %ebp, %esi
callq 0x31b8
movq 0x18(%rbx), %rdi
callq 0x4f78
decl (%rbx)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
nop