// File: /workspace/github_cpp_makefile_star2_O3/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
movsd 0xc75c(%rip), %xmm0     # 0x2dba0
movups %xmm0, (%rdi)
leaq 0x20(%rdi), %rbp
movq %rbp, 0x10(%rdi)
xorl %eax, %eax
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 0x20aac
leaq 0x118(%rbx), %rdi
movq %rdi, 0x8(%rsp)
callq 0x1f6a4
movl $0x0, 0x148(%rbx)
leaq 0x158(%rbx), %rdi
movq %rdi, 0x90(%rsp)
callq 0x22c34
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 0x1f58c
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 0x23648
leaq 0x130(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0xc5ae(%rip), %rsi      # 0x2dbb0
leaq 0xc5b4(%rip), %rdx      # 0x2dbbd
leaq 0x120(%rsp), %rdi
movq %rbp, 0x78(%rsp)
callq 0x19e74
leaq 0x418(%rbx), %rdi
leaq 0x120(%rsp), %rsi
movq %rdi, 0x50(%rsp)
callq 0x1ce40
movq 0x120(%rsp), %rdi
cmpq %r14, %rdi
je 0x21651
movq 0x130(%rsp), %rsi
incq %rsi
callq 0x5340
leaq 0x68(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0xbfc2(%rip), %rdx      # 0x2d623
leaq 0x58(%rsp), %rdi
movq %rdx, %rsi
callq 0x19e74
leaq 0x110(%rsp), %r14
movq %r14, -0x10(%r14)
movq 0x58(%rsp), %rsi
movq 0x60(%rsp), %rdx
addq %rsi, %rdx
leaq 0x100(%rsp), %rdi
callq 0x1a0b6
leaq 0x100(%rsp), %rsi
movq 0x50(%rsp), %rdi
callq 0x1ceda
movq %rax, 0x150(%rbx)
movq 0x100(%rsp), %rdi
cmpq %r14, %rdi
je 0x216ca
movq 0x110(%rsp), %rsi
incq %rsi
callq 0x5340
movq 0x188ef(%rip), %rdi     # 0x39fc0
leaq 0xc4e6(%rip), %rsi      # 0x2dbbe
movl $0x21, %edx
callq 0x53a0
leaq 0x150(%rbx), %r15
movq (%r15), %rsi
movq 0x188cd(%rip), %rdi     # 0x39fc0
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 0xc4ab(%rip), %rsi      # 0x2dbe0
leaq 0xc4ba(%rip), %rdx      # 0x2dbf6
leaq 0xb0(%rsp), %rdi
callq 0x19e74
leaq 0x30(%rbx), %r13
xorps %xmm0, %xmm0
leaq 0x140(%rsp), %rbp
movaps %xmm0, (%rbp)
movq $0x0, 0x10(%rbp)
xorl %r14d, %r14d
leaq 0x1eb12(%rip), %r12     # 0x40280
leaq (%r12,%r14), %rsi
movq %rbp, %rdi
callq 0x19d90
addq $0x20, %r14
cmpq $0x1c0, %r14            # imm = 0x1C0
jne 0x2176e
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 0x22d10
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 0x22dc6
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 0x22e9c
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 0x22f52
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 0x2301c
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 0x1e6af(%rip), %rdx     # 0x3ffa0
movq %rax, %rdi
movq %r15, %rsi
movq %rbp, %rcx
callq 0x230d2
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 0x1e68b(%rip), %rdx     # 0x3ffc0
movq %rax, %rdi
movq %r15, %rsi
movq %rbp, %rcx
callq 0x230d2
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 0x1e687(%rip), %rdx     # 0x40000
movq %rax, %rdi
movq %r15, %rsi
movq %rbp, %rcx
callq 0x230d2
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 0x1e623(%rip), %rdx     # 0x3ffe0
movq %rax, %rdi
movq %r15, %rsi
movq %rbp, %rcx
callq 0x230d2
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 0x23194
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 0x2326e
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 0x23338
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 0x23402
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 0x234cc
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 0x21bda
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 0x1a0b6
movq 0x10(%r14), %rbx
movq %r13, %rdi
movq %r15, %rsi
callq 0x1fdcc
movq %rbx, (%rax)
movq 0xd0(%rsp), %rdi
cmpq %r12, %rdi
je 0x21bd2
movq 0xe0(%rsp), %rsi
incq %rsi
callq 0x5340
movq (%r14), %r14
cmpq %rbp, %r14
jne 0x21b84
leaq 0x188(%rsp), %rdi
leaq 0x158(%rsp), %rsi
callq 0x237a2
leaq 0xd0(%rsp), %rdi
leaq 0x188(%rsp), %rsi
movq 0x28(%rsp), %rbx
callq 0x237a2
movq 0x38(%rsp), %rdi
callq 0x239ca
movq 0xe0(%rsp), %rax
testq %rax, %rax
je 0x21c6b
leaq 0xd8(%rsp), %rcx
movl (%rcx), %edx
movl %edx, 0x2d0(%rbx)
movq %rax, 0x2d8(%rbx)
movups 0x10(%rcx), %xmm0
movups %xmm0, 0x2e0(%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 0x210d4
leaq 0x188(%rsp), %rdi
callq 0x210d4
leaq 0x158(%rsp), %rdi
callq 0x210d4
movq 0x10(%rsp), %rdi
cmpq %rbp, %rdi
je 0x21cb1
movq (%rdi), %rbx
movl $0x18, %esi
callq 0x5340
movq %rbx, %rdi
cmpq %rbp, %rbx
jne 0x21c9c
leaq 0x140(%rsp), %rdi
callq 0x19dce
movq 0xb0(%rsp), %rdi
leaq 0xc0(%rsp), %rax
cmpq %rax, %rdi
je 0x21ce3
movq 0xc0(%rsp), %rsi
incq %rsi
callq 0x5340
movq 0x58(%rsp), %rdi
leaq 0x68(%rsp), %rax
cmpq %rax, %rdi
je 0x21cff
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 0x210d4
jmp 0x21e48
jmp 0x21e23
movq %rax, %r15
movl $0x50, %esi
jmp 0x21d63
jmp 0x21d5b
jmp 0x21d5b
jmp 0x21d5b
movq %rax, %r15
movl $0x48, %esi
jmp 0x21d63
jmp 0x21d5b
jmp 0x21d5b
jmp 0x21d5b
jmp 0x21d5b
jmp 0x21d51
jmp 0x21d5b
movq %rax, %r15
movl $0x30, %esi
jmp 0x21d63
movq %rax, %r15
movl $0x40, %esi
movq %r13, %rdi
callq 0x5340
jmp 0x21e55
movq %rax, %r15
movl $0x30, %esi
movq %rbp, %rdi
jmp 0x21d66
jmp 0x21e1b
movq %rax, %r15
movq 0x100(%rsp), %rdi
cmpq %r14, %rdi
je 0x21eb0
movq 0x110(%rsp), %rsi
jmp 0x21ea8
movq %rax, %r15
jmp 0x21ecc
movq %rax, %r15
movq 0x120(%rsp), %rdi
cmpq %r14, %rdi
je 0x21ed6
movq 0x130(%rsp), %rsi
incq %rsi
callq 0x5340
jmp 0x21ed6
movq %rax, %r15
jmp 0x21ed6
movq %rax, %r15
jmp 0x21eea
movq %rax, %r15
jmp 0x21eff
movq %rax, %r15
jmp 0x21f16
jmp 0x21e0e
jmp 0x21e0e
jmp 0x21e0e
jmp 0x21e0e
jmp 0x21e0e
jmp 0x21e0e
jmp 0x21e0e
jmp 0x21e0e
jmp 0x21e0e
jmp 0x21e0e
jmp 0x21e0e
jmp 0x21e0e
jmp 0x21e0e
movq %rax, %r15
jmp 0x21e55
movq %rax, %r15
jmp 0x21f20
movq %rax, %r15
jmp 0x21eb0
movq %rax, %r15
jmp 0x21e48
movq %rax, %r15
movq 0xd0(%rsp), %rdi
cmpq %r12, %rdi
je 0x21e48
movq 0xe0(%rsp), %rsi
incq %rsi
callq 0x5340
leaq 0x158(%rsp), %rdi
callq 0x210d4
movq 0x10(%rsp), %rdi
leaq 0x10(%rsp), %r14
cmpq %r14, %rdi
je 0x21e7e
movq (%rdi), %rbx
movl $0x18, %esi
callq 0x5340
movq %rbx, %rdi
cmpq %r14, %rbx
jne 0x21e64
jmp 0x21e7e
movq %rax, %r15
leaq 0x140(%rsp), %rdi
callq 0x19dce
movq 0xb0(%rsp), %rdi
leaq 0xc0(%rsp), %rax
cmpq %rax, %rdi
je 0x21eb0
movq 0xc0(%rsp), %rsi
incq %rsi
callq 0x5340
movq 0x58(%rsp), %rdi
leaq 0x68(%rsp), %rax
cmpq %rax, %rdi
je 0x21ecc
movq 0x68(%rsp), %rsi
incq %rsi
callq 0x5340
movq 0x50(%rsp), %rdi
callq 0x235bc
movq 0x40(%rsp), %rdi
callq 0x2107c
movq 0x28(%rsp), %rbx
movq 0x78(%rsp), %rbp
movq 0x88(%rsp), %rdi
callq 0x235e4
movq 0x80(%rsp), %r14
movq 0x38(%rsp), %rdi
callq 0x210d4
movq 0x90(%rsp), %rdi
callq 0x20fc8
movq 0x8(%rsp), %rdi
callq 0x1b8a0
leaq 0x98(%rbx), %r12
leaq 0xb0(%rbx), %r13
leaq 0xe0(%rbx), %rdi
callq 0x21172
movq %r13, %rdi
callq 0x1b990
movq %r12, %rdi
callq 0x19dce
movq 0x30(%rsp), %rax
movq (%rax), %rdi
movq 0x98(%rsp), %rax
cmpq %rax, %rdi
je 0x21f6a
movq (%rax), %rsi
incq %rsi
callq 0x5340
movq 0x48(%rsp), %rax
movq (%rax), %rdi
movq 0xa0(%rsp), %rax
cmpq %rax, %rdi
je 0x21f8a
movq (%rax), %rsi
incq %rsi
callq 0x5340
movq 0x28(%rsp), %rbx
movq 0x38(%rbx), %rdi
cmpq %r14, %rdi
je 0x21fa3
movq (%r14), %rsi
incq %rsi
callq 0x5340
movq 0x10(%rbx), %rdi
cmpq %rbp, %rdi
je 0x21fb8
movq (%rbp), %rsi
incq %rsi
callq 0x5340
movq %r15, %rdi
callq 0x55c0