// File: /workspace/github_cpp_makefile_star2_O1/rcolomina[P]the_charmed_house/src/manager.cpp
// Function: Manager::Manager()
Manager::Manager():dt(freq),
                   tiempo(0),
                   continuar_loop(true),
                   contador_mal_comportamiento(0),
		   fac("gamesInfo.xml")
{
    string gameId="";
    //scene using id
    escena_actual = fac.buildGameById(gameId);
    cout<<"manager() escena_actual address: "<<escena_actual<<endl;
     
    //CommandBuilder *commandBuilder    = new CommandBuilder();
    //map<string,ICommand*> mapComandos = commandBuilder->buildCommands(continuar_loop,
    //                                                                  escena_actual,
    //                                                                  inventario,
    //                                                                  parametro1,
    //                                                                  parametro2,
    //                                                                  primera_entrada,
    //                                                                  eventsQueue);
     
    //Construir los comandos y conectarlos al invocador
    string comandos_disponibles="Comandos disponibles: ";
    vector<string> v_comandos;
    for(int i=0;i<NUMBER_COMMANDS;++i)
        v_comandos.push_back(comandos[i]);

    list<ICommand*> mycommands;
    
    mycommands.push_back(new Exit(continuar_loop));
    mycommands.push_back(new Ayuda(v_comandos));
    mycommands.push_back(new Ver(&escena_actual));
    mycommands.push_back(new Examinar(&escena_actual,inventario,parametro1));
    mycommands.push_back(new CommandInventario(inventario));
    mycommands.push_back(new Cardinal(&escena_actual,s_norte,primera_entrada));
    mycommands.push_back(new Cardinal(&escena_actual,s_sur,primera_entrada));
    mycommands.push_back(new Cardinal(&escena_actual,s_oeste,primera_entrada));
    mycommands.push_back(new Cardinal(&escena_actual,s_este,primera_entrada));
    mycommands.push_back(new Tirar(&escena_actual,inventario,parametro1,parametro2));
    mycommands.push_back(new Coger(&escena_actual,inventario,parametro1));
    mycommands.push_back(new Dejar(&escena_actual,inventario,parametro1));
    mycommands.push_back(new Alcanzar(&escena_actual,inventario,parametro1));
    mycommands.push_back(new Colocar(&escena_actual,inventario,eventsQueue,parametro1,parametro2));    
    
    map<string,ICommand*> mapComandos; // = new map<string,ICommand*>;

    for(auto it=mycommands.begin();
        it!=mycommands.end();
        ++it){
        string key=(*it)->get_command_id();
        mapComandos[key]=*it;
        //cout<<"Added key "<<key<<endl;
    }
    
    // Build command trigger
    this->invocador_comandos = Invocador(mapComandos);
	 
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1b8, %rsp            # imm = 0x1B8
movq %rdi, %rbx
movabsq $0x3f91111111111111, %rax # imm = 0x3F91111111111111
movq %rax, (%rdi)
xorl %eax, %eax
movq %rax, 0x8(%rdi)
leaq 0x20(%rdi), %rbp
movq %rbp, 0x10(%rdi)
movq %rax, 0x18(%rdi)
movb %al, 0x20(%rdi)
movb $0x1, 0x30(%rdi)
leaq 0x48(%rdi), %r14
movq %r14, 0x38(%rdi)
movq %rax, 0x40(%rdi)
movb %al, 0x48(%rdi)
leaq 0x58(%rdi), %rcx
movq %rcx, 0x48(%rsp)
leaq 0x68(%rdi), %r12
movq %r12, 0x58(%rdi)
movq %rax, 0x60(%rdi)
movb %al, 0x68(%rdi)
leaq 0x78(%rdi), %rcx
movq %rcx, 0x30(%rsp)
leaq 0x88(%rdi), %rcx
movq %rcx, 0x98(%rsp)
movq %rcx, 0x78(%rdi)
movq %rax, 0x80(%rdi)
movb %al, 0x88(%rdi)
xorps %xmm0, %xmm0
movups %xmm0, 0x98(%rdi)
movq %rax, 0xa8(%rdi)
leaq 0xb8(%rdi), %rcx
movl %eax, 0xb8(%rdi)
movq %rax, 0xc0(%rdi)
movq %rcx, 0xc8(%rdi)
movq %rcx, 0xd0(%rdi)
movq %rax, 0xd8(%rdi)
leaq 0xe8(%rdi), %rcx
movl %eax, 0xe8(%rdi)
movq %rax, 0xf0(%rdi)
movq %rcx, 0xf8(%rdi)
movq %rcx, 0x100(%rdi)
movq %rax, 0x108(%rdi)
addq $0x110, %rdi            # imm = 0x110
movq %rbx, 0x28(%rsp)
movq %r12, 0xa0(%rsp)
callq 0x20d14
leaq 0x118(%rbx), %rdi
movq %rdi, 0x8(%rsp)
callq 0x1f8e8
movl $0x0, 0x148(%rbx)
leaq 0x158(%rbx), %rdi
movq %rdi, 0x90(%rsp)
callq 0x22ea4
leaq 0x2c8(%rbx), %rax
movq %rax, 0x38(%rsp)
leaq 0x2d0(%rbx), %rcx
movl $0x0, 0x2d0(%rbx)
xorl %eax, %eax
movq %rax, 0x2d8(%rbx)
movq %rcx, 0x2e0(%rbx)
movq %rcx, 0xa8(%rsp)
movq %rcx, 0x2e8(%rbx)
movq %rax, 0x2f0(%rbx)
leaq 0x2f8(%rbx), %rdi
movq %rdi, 0x88(%rsp)
callq 0x1f7d0
movq %r14, 0x80(%rsp)
leaq 0x3c8(%rbx), %rdi
xorps %xmm0, %xmm0
movups %xmm0, 0x408(%rbx)
movups %xmm0, 0x3f8(%rbx)
movups %xmm0, 0x3e8(%rbx)
movups %xmm0, 0x3d8(%rbx)
movups %xmm0, 0x3c8(%rbx)
movq %rdi, 0x40(%rsp)
xorl %esi, %esi
callq 0x238b8
leaq 0x130(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0xd338(%rip), %rsi      # 0x2eba8
leaq 0xd33e(%rip), %rdx      # 0x2ebb5
leaq 0x120(%rsp), %rdi
movq %rbp, 0x78(%rsp)
callq 0x1a08c
leaq 0x418(%rbx), %rdi
leaq 0x120(%rsp), %rsi
movq %rdi, 0x50(%rsp)
callq 0x1d088
movq 0x120(%rsp), %rdi
cmpq %r14, %rdi
je 0x218bf
movq 0x130(%rsp), %rsi
incq %rsi
callq 0x5340
leaq 0x68(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0xcd54(%rip), %rdx      # 0x2e623
leaq 0x58(%rsp), %rdi
movq %rdx, %rsi
callq 0x1a08c
leaq 0x110(%rsp), %r14
movq %r14, -0x10(%r14)
movq 0x58(%rsp), %rsi
movq 0x60(%rsp), %rdx
addq %rsi, %rdx
leaq 0x100(%rsp), %rdi
callq 0x1a300
leaq 0x100(%rsp), %rsi
movq 0x50(%rsp), %rdi
callq 0x1d122
movq %rax, 0x150(%rbx)
movq 0x100(%rsp), %rdi
cmpq %r14, %rdi
je 0x21938
movq 0x110(%rsp), %rsi
incq %rsi
callq 0x5340
movq 0x19681(%rip), %rdi     # 0x3afc0
leaq 0xd270(%rip), %rsi      # 0x2ebb6
movl $0x21, %edx
callq 0x53a0
leaq 0x150(%rbx), %r15
movq (%r15), %rsi
movq 0x1965f(%rip), %rdi     # 0x3afc0
callq 0x5290
movq %rax, %r13
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x5300
movsbl %al, %esi
movq %r13, %rdi
callq 0x5050
movq %rax, %rdi
callq 0x5230
leaq 0xc0(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0xd235(%rip), %rsi      # 0x2ebd8
leaq 0xd244(%rip), %rdx      # 0x2ebee
leaq 0xb0(%rsp), %rdi
callq 0x1a08c
leaq 0x30(%rbx), %r13
xorps %xmm0, %xmm0
leaq 0x140(%rsp), %rbp
movaps %xmm0, (%rbp)
movq $0x0, 0x10(%rbp)
xorl %r14d, %r14d
leaq 0x1f8a4(%rip), %r12     # 0x41280
leaq (%r12,%r14), %rsi
movq %rbp, %rdi
callq 0x19faa
addq $0x20, %r14
cmpq $0x1c0, %r14            # imm = 0x1C0
jne 0x219dc
leaq 0x10(%rsp), %rax
movq %rax, 0x8(%rax)
movq %rax, (%rax)
movq $0x0, 0x10(%rax)
movl $0x30, %edi
movq 0x28(%rsp), %rbx
movq 0x48(%rsp), %r14
callq 0x5330
movq %rax, %rbp
movq %rax, %rdi
movq %r13, %rsi
callq 0x22f80
movl $0x18, %edi
callq 0x5330
movq %rbp, 0x10(%rax)
leaq 0x10(%rsp), %r13
movq %rax, %rdi
movq %r13, %rsi
callq 0x50b0
incq 0x10(%r13)
movl $0x40, %edi
callq 0x5330
movq %rax, %r13
leaq 0x140(%rsp), %rsi
movq %rax, %rdi
callq 0x23036
movl $0x18, %edi
callq 0x5330
movq %r13, 0x10(%rax)
leaq 0x10(%rsp), %r13
movq %rax, %rdi
movq %r13, %rsi
callq 0x50b0
incq 0x10(%r13)
movl $0x30, %edi
callq 0x5330
movq %rax, %r13
movq %rax, %rdi
movq %r15, %rsi
callq 0x2310c
movl $0x18, %edi
callq 0x5330
movq %r13, 0x10(%rax)
leaq 0x10(%rsp), %r13
movq %rax, %rdi
movq %r13, %rsi
callq 0x50b0
incq 0x10(%r13)
movl $0x40, %edi
callq 0x5330
movq %rax, %r13
movq %rax, %rdi
movq %r15, %rsi
movq 0x8(%rsp), %rdx
movq %r14, %rcx
callq 0x231c2
movl $0x18, %edi
callq 0x5330
movq %r13, 0x10(%rax)
leaq 0x10(%rsp), %r13
movq %rax, %rdi
movq %r13, %rsi
callq 0x50b0
incq 0x10(%r13)
movl $0x30, %edi
callq 0x5330
movq %rax, %r13
movq %rax, %rdi
movq 0x8(%rsp), %rsi
callq 0x2328c
movl $0x18, %edi
callq 0x5330
movq %r13, 0x10(%rax)
leaq 0x10(%rsp), %r13
movq %rax, %rdi
movq %r13, %rsi
callq 0x50b0
incq 0x10(%r13)
movl $0x40, %edi
callq 0x5330
movq %rax, %r13
leaq 0x2c0(%rbx), %rbp
leaq 0x1f441(%rip), %rdx     # 0x40fa0
movq %rax, %rdi
movq %r15, %rsi
movq %rbp, %rcx
callq 0x23342
movl $0x18, %edi
callq 0x5330
movq %r13, 0x10(%rax)
leaq 0x10(%rsp), %r13
movq %rax, %rdi
movq %r13, %rsi
callq 0x50b0
incq 0x10(%r13)
movl $0x40, %edi
callq 0x5330
movq %rax, %r13
leaq 0x1f41d(%rip), %rdx     # 0x40fc0
movq %rax, %rdi
movq %r15, %rsi
movq %rbp, %rcx
callq 0x23342
movl $0x18, %edi
callq 0x5330
movq %r13, 0x10(%rax)
leaq 0x10(%rsp), %r13
movq %rax, %rdi
movq %r13, %rsi
callq 0x50b0
incq 0x10(%r13)
movl $0x40, %edi
callq 0x5330
movq %rax, %r13
leaq 0x1f419(%rip), %rdx     # 0x41000
movq %rax, %rdi
movq %r15, %rsi
movq %rbp, %rcx
callq 0x23342
movl $0x18, %edi
callq 0x5330
movq %r13, 0x10(%rax)
leaq 0x10(%rsp), %r13
movq %rax, %rdi
movq %r13, %rsi
callq 0x50b0
incq 0x10(%r13)
movl $0x40, %edi
callq 0x5330
movq %rax, %r13
leaq 0x1f3b5(%rip), %rdx     # 0x40fe0
movq %rax, %rdi
movq %r15, %rsi
movq %rbp, %rcx
callq 0x23342
movl $0x18, %edi
callq 0x5330
movq %r13, 0x10(%rax)
leaq 0x10(%rsp), %r13
movq %rax, %rdi
movq %r13, %rsi
callq 0x50b0
incq 0x10(%r13)
movl $0x48, %edi
callq 0x5330
movq %rax, %r13
movq %rax, %rdi
movq %r15, %rsi
movq 0x8(%rsp), %rdx
movq %r14, %rcx
movq 0x30(%rsp), %r8
callq 0x23404
movl $0x18, %edi
callq 0x5330
movq %r13, 0x10(%rax)
leaq 0x10(%rsp), %r13
movq %rax, %rdi
movq %r13, %rsi
callq 0x50b0
incq 0x10(%r13)
movl $0x40, %edi
callq 0x5330
movq %rax, %r13
movq %rax, %rdi
movq %r15, %rsi
movq 0x8(%rsp), %rdx
movq %r14, %rcx
callq 0x234de
movl $0x18, %edi
callq 0x5330
movq %r13, 0x10(%rax)
leaq 0x10(%rsp), %r13
movq %rax, %rdi
movq %r13, %rsi
callq 0x50b0
incq 0x10(%r13)
movl $0x40, %edi
callq 0x5330
movq %rax, %r13
movq %rax, %rdi
movq %r15, %rsi
movq 0x8(%rsp), %rdx
movq %r14, %rcx
callq 0x235a8
movl $0x18, %edi
callq 0x5330
movq %r13, 0x10(%rax)
leaq 0x10(%rsp), %r13
movq %rax, %rdi
movq %r13, %rsi
callq 0x50b0
incq 0x10(%r13)
movl $0x40, %edi
callq 0x5330
movq %rax, %r13
movq %rax, %rdi
movq %r15, %rsi
movq 0x8(%rsp), %rdx
movq %r14, %rcx
callq 0x23672
movl $0x18, %edi
callq 0x5330
movq %r13, 0x10(%rax)
leaq 0x10(%rsp), %rbp
movq %rax, %rdi
movq %rbp, %rsi
callq 0x50b0
incq 0x10(%rbp)
movl $0x50, %edi
callq 0x5330
movq %rax, %r13
movq %rax, %rdi
movq %r15, %rsi
movq 0x8(%rsp), %rdx
movq 0x40(%rsp), %rcx
movq %r14, %r8
movq 0x30(%rsp), %r9
callq 0x2373c
movl $0x18, %edi
callq 0x5330
movq %r13, 0x10(%rax)
movq %rax, %rdi
movq %rbp, %rsi
callq 0x50b0
incq 0x20(%rsp)
leaq 0x160(%rsp), %rax
movl $0x0, (%rax)
xorl %ecx, %ecx
movq %rcx, 0x8(%rax)
movq %rax, 0x10(%rax)
movq %rax, 0x18(%rax)
movq %rcx, 0x20(%rax)
movq 0x10(%rsp), %r14
cmpq %rbp, %r14
je 0x21e48
leaq 0xe0(%rsp), %r12
leaq 0xd0(%rsp), %r15
leaq 0x158(%rsp), %r13
movq 0x10(%r14), %rax
movq %r12, 0xd0(%rsp)
movq 0x8(%rax), %rsi
movq 0x10(%rax), %rdx
addq %rsi, %rdx
movq %r15, %rdi
callq 0x1a300
movq 0x10(%r14), %rbx
movq %r13, %rdi
movq %r15, %rsi
callq 0x2003c
movq %rbx, (%rax)
movq 0xd0(%rsp), %rdi
cmpq %r12, %rdi
je 0x21e40
movq 0xe0(%rsp), %rsi
incq %rsi
callq 0x5340
movq (%r14), %r14
cmpq %rbp, %r14
jne 0x21df2
leaq 0x188(%rsp), %rdi
leaq 0x158(%rsp), %rsi
callq 0x23a12
leaq 0xd0(%rsp), %rdi
leaq 0x188(%rsp), %rsi
movq 0x28(%rsp), %rbx
callq 0x23a12
movq 0x38(%rsp), %rdi
callq 0x23c3a
movq 0xe0(%rsp), %rax
testq %rax, %rax
je 0x21ee4
leaq 0xd8(%rsp), %rcx
movl (%rcx), %edx
movl %edx, 0x2d0(%rbx)
movq %rax, 0x2d8(%rbx)
movq 0x10(%rcx), %rdx
movq %rdx, 0x2e0(%rbx)
movq 0x18(%rcx), %rdx
movq %rdx, 0x2e8(%rbx)
movq 0xa8(%rsp), %rdx
movq %rdx, 0x8(%rax)
movq 0x20(%rcx), %rax
movq %rax, 0x2f0(%rbx)
xorl %eax, %eax
movq %rax, 0x8(%rcx)
movq %rcx, 0x10(%rcx)
movq %rcx, 0x18(%rcx)
movq %rax, 0x20(%rcx)
leaq 0xd0(%rsp), %rdi
callq 0x2133c
leaq 0x188(%rsp), %rdi
callq 0x2133c
leaq 0x158(%rsp), %rdi
callq 0x2133c
movq 0x10(%rsp), %rdi
cmpq %rbp, %rdi
je 0x21f2a
movq (%rdi), %rbx
movl $0x18, %esi
callq 0x5340
movq %rbx, %rdi
cmpq %rbp, %rbx
jne 0x21f15
leaq 0x140(%rsp), %rdi
callq 0x19fe8
movq 0xb0(%rsp), %rdi
leaq 0xc0(%rsp), %rax
cmpq %rax, %rdi
je 0x21f5c
movq 0xc0(%rsp), %rsi
incq %rsi
callq 0x5340
movq 0x58(%rsp), %rdi
leaq 0x68(%rsp), %rax
cmpq %rax, %rdi
je 0x21f78
movq 0x68(%rsp), %rsi
incq %rsi
callq 0x5340
addq $0x1b8, %rsp            # imm = 0x1B8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r15
leaq 0x188(%rsp), %rdi
callq 0x2133c
jmp 0x220c1
jmp 0x2209c
movq %rax, %r15
movl $0x50, %esi
jmp 0x21fdc
jmp 0x21fd4
jmp 0x21fd4
jmp 0x21fd4
movq %rax, %r15
movl $0x48, %esi
jmp 0x21fdc
jmp 0x21fd4
jmp 0x21fd4
jmp 0x21fd4
jmp 0x21fd4
jmp 0x21fca
jmp 0x21fd4
movq %rax, %r15
movl $0x30, %esi
jmp 0x21fdc
movq %rax, %r15
movl $0x40, %esi
movq %r13, %rdi
callq 0x5340
jmp 0x220ce
movq %rax, %r15
movl $0x30, %esi
movq %rbp, %rdi
jmp 0x21fdf
jmp 0x22094
movq %rax, %r15
movq 0x100(%rsp), %rdi
cmpq %r14, %rdi
je 0x22129
movq 0x110(%rsp), %rsi
jmp 0x22121
movq %rax, %r15
jmp 0x22145
movq %rax, %r15
movq 0x120(%rsp), %rdi
cmpq %r14, %rdi
je 0x2214f
movq 0x130(%rsp), %rsi
incq %rsi
callq 0x5340
jmp 0x2214f
movq %rax, %r15
jmp 0x2214f
movq %rax, %r15
jmp 0x22163
movq %rax, %r15
jmp 0x22178
movq %rax, %r15
jmp 0x2218f
jmp 0x22087
jmp 0x22087
jmp 0x22087
jmp 0x22087
jmp 0x22087
jmp 0x22087
jmp 0x22087
jmp 0x22087
jmp 0x22087
jmp 0x22087
jmp 0x22087
jmp 0x22087
jmp 0x22087
movq %rax, %r15
jmp 0x220ce
movq %rax, %r15
jmp 0x22199
movq %rax, %r15
jmp 0x22129
movq %rax, %r15
jmp 0x220c1
movq %rax, %r15
movq 0xd0(%rsp), %rdi
cmpq %r12, %rdi
je 0x220c1
movq 0xe0(%rsp), %rsi
incq %rsi
callq 0x5340
leaq 0x158(%rsp), %rdi
callq 0x2133c
movq 0x10(%rsp), %rdi
leaq 0x10(%rsp), %r14
cmpq %r14, %rdi
je 0x220f7
movq (%rdi), %rbx
movl $0x18, %esi
callq 0x5340
movq %rbx, %rdi
cmpq %r14, %rbx
jne 0x220dd
jmp 0x220f7
movq %rax, %r15
leaq 0x140(%rsp), %rdi
callq 0x19fe8
movq 0xb0(%rsp), %rdi
leaq 0xc0(%rsp), %rax
cmpq %rax, %rdi
je 0x22129
movq 0xc0(%rsp), %rsi
incq %rsi
callq 0x5340
movq 0x58(%rsp), %rdi
leaq 0x68(%rsp), %rax
cmpq %rax, %rdi
je 0x22145
movq 0x68(%rsp), %rsi
incq %rsi
callq 0x5340
movq 0x50(%rsp), %rdi
callq 0x2382c
movq 0x40(%rsp), %rdi
callq 0x212ec
movq 0x28(%rsp), %rbx
movq 0x78(%rsp), %rbp
movq 0x88(%rsp), %rdi
callq 0x23854
movq 0x80(%rsp), %r14
movq 0x38(%rsp), %rdi
callq 0x2133c
movq 0x90(%rsp), %rdi
callq 0x21238
movq 0x8(%rsp), %rdi
callq 0x1baf2
leaq 0x98(%rbx), %r12
leaq 0xb0(%rbx), %r13
leaq 0xe0(%rbx), %rdi
callq 0x213da
movq %r13, %rdi
callq 0x1bbe2
movq %r12, %rdi
callq 0x19fe8
movq 0x30(%rsp), %rax
movq (%rax), %rdi
movq 0x98(%rsp), %rax
cmpq %rax, %rdi
je 0x221e3
movq (%rax), %rsi
incq %rsi
callq 0x5340
movq 0x48(%rsp), %rax
movq (%rax), %rdi
movq 0xa0(%rsp), %rax
cmpq %rax, %rdi
je 0x22203
movq (%rax), %rsi
incq %rsi
callq 0x5340
movq 0x28(%rsp), %rbx
movq 0x38(%rbx), %rdi
cmpq %r14, %rdi
je 0x2221c
movq (%r14), %rsi
incq %rsi
callq 0x5340
movq 0x10(%rbx), %rdi
cmpq %rbp, %rdi
je 0x22231
movq (%rbp), %rsi
incq %rsi
callq 0x5340
movq %r15, %rdi
callq 0x55c0
nop