// File: /workspace/github_cpp_makefile_star2_O1/Worthy-Wang[P]Warcraft3-StartWar/warcraftWorld.cpp
// Function: warcraft::WarcraftWorld::init()
void WarcraftWorld::init()
{
    vector<WarriorType> initHpOrder{DRAGON, NINJA, ICEMAN, LION, WOLF}; //同时对生命值与攻击力顺序赋值
    vector<WarriorType> redCreateorder{ICEMAN, LION, WOLF, NINJA, DRAGON};
    vector<WarriorType> blueCreateorder{LION, DRAGON, NINJA, ICEMAN, WOLF};

    GameConfig::getInstance()->setInitWarriorOrder(initHpOrder.begin(), initHpOrder.end());
    GameConfig::getInstance()->readFromFile("warcraft.conf");
    GameConfig::getInstance()->print(); //进行检测

    _caseNum = GameConfig::getInstance()->currentGroupId();
    size_t baseHp = GameConfig::getInstance()->getInitBaseHp(_caseNum);
    _red = new Headquarters(RED, baseHp);
    _blue = new Headquarters(BLUE, baseHp);
    _red->setWarriorCreateOrder(redCreateorder.begin(), redCreateorder.end());
    _blue->setWarriorCreateOrder(blueCreateorder.begin(), blueCreateorder.end());

    CityPtr city(new City(0));
    _citys.push_back(city); //红方基地
    size_t i = 1;
    for (; i <= GameConfig::getInstance()->getCityNum(_caseNum); i++)
    {
        city.reset(new City(i));
        _citys.push_back(city);
    }
    city.reset(new City(i));
    _citys.push_back(city); //蓝方基地
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movq %rdi, %rbx
movups 0x1a92(%rip), %xmm0     # 0x10978
leaq -0x80(%rbp), %rsi
movaps %xmm0, (%rsi)
movl $0x4, 0x10(%rsi)
leaq -0x98(%rbp), %rdi
leaq -0x60(%rbp), %r14
movl $0x5, %edx
movq %r14, %rcx
callq 0xca4c
movups 0x1b9d(%rip), %xmm0     # 0x10ab0
movaps %xmm0, (%r14)
movl $0x0, 0x10(%r14)
leaq -0x80(%rbp), %rdi
leaq -0x60(%rbp), %rsi
leaq -0x40(%rbp), %rcx
movl $0x5, %edx
callq 0xca4c
movups 0x1a50(%rip), %xmm0     # 0x1098c
leaq -0x40(%rbp), %rsi
movaps %xmm0, (%rsi)
movl $0x4, 0x10(%rsi)
leaq -0x60(%rbp), %rdi
leaq -0x29(%rbp), %rcx
movl $0x5, %edx
callq 0xca4c
leaq 0x81f5(%rip), %r12      # 0x17158
movq (%r12), %rdi
movq -0x98(%rbp), %rsi
movq -0x90(%rbp), %rdx
callq 0xca92
movq (%r12), %r14
leaq -0xa8(%rbp), %r15
movq %r15, -0x10(%r15)
leaq 0x1994(%rip), %rsi      # 0x10924
leaq 0x199a(%rip), %rdx      # 0x10931
leaq -0xb8(%rbp), %rdi
callq 0x8c3a
leaq -0xb8(%rbp), %rsi
movq %r14, %rdi
callq 0x6526
movq -0xb8(%rbp), %rdi
cmpq %r15, %rdi
je 0xefcd
movq -0xa8(%rbp), %rsi
incq %rsi
callq 0x4170
movq (%r12), %rdi
callq 0x65ea
leaq 0x8173(%rip), %rax      # 0x17150
movq (%rax), %rax
movq %rax, 0x28(%rbx)
movq (%r12), %rcx
movq 0x18(%rcx), %rcx
shlq $0x7, %rax
movq -0x80(%rcx,%rax), %r15
movl $0xa8, %edi
callq 0x4160
movq %rax, %r14
movl $0x0, (%rax)
movq %r15, 0x8(%rax)
xorl %eax, %eax
movq %rax, 0x10(%r14)
movl $0x1, %r13d
movq %r13, 0x18(%r14)
xorps %xmm0, %xmm0
movups %xmm0, 0x20(%r14)
movq %rax, 0x30(%r14)
leaq 0x68(%r14), %rax
movq %rax, 0x38(%r14)
movq %r13, 0x40(%r14)
movups %xmm0, 0x48(%r14)
movl $0x3f800000, %ecx       # imm = 0x3F800000
movl %ecx, 0x58(%r14)
movups %xmm0, 0x60(%r14)
movq %r14, %rax
addq $0xa0, %rax
movq %rax, 0x70(%r14)
movq %r13, 0x78(%r14)
movups %xmm0, 0x80(%r14)
movl %ecx, 0x90(%r14)
movups %xmm0, 0x98(%r14)
movq %r14, (%rbx)
movl $0xa8, %edi
callq 0x4160
movl $0x1, (%rax)
movq %r15, 0x8(%rax)
xorl %ecx, %ecx
movq %rcx, 0x10(%rax)
movq %r13, 0x18(%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0x20(%rax)
movq %rcx, 0x30(%rax)
leaq 0x68(%rax), %rcx
movq %rcx, 0x38(%rax)
movq %r13, 0x40(%rax)
movups %xmm0, 0x48(%rax)
movl $0x3f800000, %edx       # imm = 0x3F800000
movl %edx, 0x58(%rax)
movups %xmm0, 0x60(%rax)
movq %rax, %rcx
addq $0xa0, %rcx
movq %rcx, 0x70(%rax)
movq %r13, 0x78(%rax)
movups %xmm0, 0x80(%rax)
movl %edx, 0x90(%rax)
movups %xmm0, 0x98(%rax)
movq %rax, 0x8(%rbx)
movq -0x80(%rbp), %rsi
movq -0x78(%rbp), %rdx
movq %r14, %rdi
callq 0xf304
movq 0x8(%rbx), %rdi
movq -0x60(%rbp), %rsi
movq -0x58(%rbp), %rdx
callq 0xf304
movl $0x28, %edi
callq 0x4160
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rax)
movups %xmm0, (%rax)
movq $0x0, 0x20(%rax)
leaq -0x38(%rbp), %rdi
movq %rax, -0x8(%rdi)
movq %rax, %rsi
callq 0xf3ec
leaq 0x10(%rbx), %r14
leaq -0x40(%rbp), %rsi
movq %r14, %rdi
callq 0xf358
movq (%r12), %rax
movq 0x28(%rbx), %rcx
movq 0x18(%rax), %rax
shlq $0x7, %rcx
cmpq $0x0, -0x78(%rax,%rcx)
je 0xf1a2
leaq -0x40(%rbp), %r15
movl $0x28, %edi
callq 0x4160
movq %r13, (%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rax)
movups %xmm0, 0x18(%rax)
movq %r15, %rdi
movq %rax, %rsi
callq 0xf39e
movq %r14, %rdi
movq %r15, %rsi
callq 0xf358
incq %r13
movq (%r12), %rax
movq 0x28(%rbx), %rcx
movq 0x18(%rax), %rax
shlq $0x7, %rcx
cmpq -0x78(%rax,%rcx), %r13
jbe 0xf15a
movl $0x28, %edi
callq 0x4160
movq %r13, (%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rax)
movups %xmm0, 0x18(%rax)
leaq -0x40(%rbp), %rdi
movq %rax, %rsi
callq 0xf39e
leaq -0x40(%rbp), %rsi
movq %r14, %rdi
callq 0xf358
movq -0x38(%rbp), %rdi
testq %rdi, %rdi
je 0xf1e0
callq 0x57ba
movq -0x60(%rbp), %rdi
testq %rdi, %rdi
je 0xf1f5
movq -0x50(%rbp), %rsi
subq %rdi, %rsi
callq 0x4170
movq -0x80(%rbp), %rdi
testq %rdi, %rdi
je 0xf20a
movq -0x70(%rbp), %rsi
subq %rdi, %rsi
callq 0x4170
movq -0x98(%rbp), %rdi
testq %rdi, %rdi
je 0xf225
movq -0x88(%rbp), %rsi
subq %rdi, %rsi
callq 0x4170
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xf270
movq %rax, %rbx
movq -0xb8(%rbp), %rdi
cmpq %r15, %rdi
je 0xf281
movq -0xa8(%rbp), %rsi
incq %rsi
callq 0x4170
jmp 0xf281
jmp 0xf26b
movq %rax, %rbx
jmp 0xf296
movq %rax, %rbx
jmp 0xf2ab
jmp 0xf26b
jmp 0xf26b
jmp 0xf270
movq %rax, %rbx
jmp 0xf281
movq %rax, %rbx
movq -0x38(%rbp), %rdi
testq %rdi, %rdi
je 0xf281
callq 0x57ba
movq -0x60(%rbp), %rdi
testq %rdi, %rdi
je 0xf296
movq -0x50(%rbp), %rsi
subq %rdi, %rsi
callq 0x4170
movq -0x80(%rbp), %rdi
testq %rdi, %rdi
je 0xf2ab
movq -0x70(%rbp), %rsi
subq %rdi, %rsi
callq 0x4170
movq -0x98(%rbp), %rdi
testq %rdi, %rdi
je 0xf2c6
movq -0x88(%rbp), %rsi
subq %rdi, %rsi
callq 0x4170
movq %rbx, %rdi
callq 0x4230