// File: /workspace/github_cpp_makefile_star2_O2/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, %r13
movups 0x19d0(%rip), %xmm0     # 0xe930
leaq -0x80(%rbp), %rsi
movaps %xmm0, (%rsi)
movl $0x4, 0x10(%rsi)
leaq -0x98(%rbp), %rdi
pushq $0x5
popq %r14
leaq -0x60(%rbp), %r15
movq %r14, %rdx
movq %r15, %rcx
callq 0xb50a
movups 0x1ad9(%rip), %xmm0     # 0xea68
movaps %xmm0, (%r15)
andl $0x0, 0x10(%r15)
leaq -0x80(%rbp), %rdi
leaq -0x60(%rbp), %rsi
leaq -0x40(%rbp), %rcx
movq %r14, %rdx
callq 0xb50a
movups 0x1991(%rip), %xmm0     # 0xe944
leaq -0x40(%rbp), %rsi
movaps %xmm0, (%rsi)
movl $0x4, 0x10(%rsi)
leaq -0x60(%rbp), %rdi
pushq $0x5
popq %rdx
leaq -0x29(%rbp), %rcx
callq 0xb50a
leaq 0x9190(%rip), %rbx      # 0x16168
movq (%rbx), %rdi
movq -0x98(%rbp), %rsi
movq -0x90(%rbp), %rdx
callq 0xb540
movq (%rbx), %r14
leaq 0x18e4(%rip), %rsi      # 0xe8dc
leaq -0xb8(%rbp), %rdi
leaq -0x40(%rbp), %rdx
callq 0x51dc
leaq -0xb8(%rbp), %rsi
movq %r14, %rdi
callq 0x60de
leaq -0xb8(%rbp), %rdi
callq 0x40a0
movq (%rbx), %rdi
callq 0x6192
leaq 0x912e(%rip), %rax      # 0x16160
movq (%rax), %rax
movq %rax, 0x28(%r13)
movq (%rbx), %rcx
movq 0x18(%rcx), %rcx
shlq $0x7, %rax
movq -0x80(%rcx,%rax), %r14
movl $0xa8, %edi
callq 0x4170
movq %rax, %r15
movq %rax, %rdi
xorl %esi, %esi
movq %r14, %rdx
callq 0xd23e
movq %r15, (%r13)
movl $0xa8, %edi
callq 0x4170
movq %rax, %r15
pushq $0x1
popq %rsi
movq %rax, %rdi
movq %r14, %rdx
callq 0xd23e
movq %r15, 0x8(%r13)
movq (%r13), %rdi
movq -0x80(%rbp), %rsi
movq -0x78(%rbp), %rdx
callq 0xd2a8
movq 0x8(%r13), %rdi
movq -0x60(%rbp), %rsi
movq -0x58(%rbp), %rdx
callq 0xd2a8
pushq $0x28
popq %rdi
callq 0x4170
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rax)
movups %xmm0, (%rax)
andq $0x0, 0x20(%rax)
leaq -0x40(%rbp), %rdi
movq %rax, %rsi
callq 0xd600
movq %r13, %rbx
leaq 0x10(%r13), %r14
leaq -0x40(%rbp), %rsi
movq %r14, %rdi
callq 0xd2de
pushq $0x1
popq %r13
pushq $0x28
popq %r15
leaq -0x40(%rbp), %r12
leaq 0x9077(%rip), %rax      # 0x16168
movq (%rax), %rax
movq 0x28(%rbx), %rcx
movq 0x18(%rax), %rax
shlq $0x7, %rcx
cmpq -0x78(%rax,%rcx), %r13
ja 0xd138
movq %r15, %rdi
callq 0x4170
movq %r13, (%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rax)
movups %xmm0, 0x18(%rax)
movq %r12, %rdi
movq %rax, %rsi
callq 0xd31a
movq %r14, %rdi
movq %r12, %rsi
callq 0xd2de
incq %r13
jmp 0xd0ea
pushq $0x28
popq %rdi
callq 0x4170
movq %r13, (%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rax)
movups %xmm0, 0x18(%rax)
leaq -0x40(%rbp), %rdi
movq %rax, %rsi
callq 0xd31a
leaq -0x40(%rbp), %rsi
movq %r14, %rdi
callq 0xd2de
leaq -0x38(%rbp), %rdi
callq 0x5302
leaq -0x60(%rbp), %rdi
callq 0x6488
leaq -0x80(%rbp), %rdi
callq 0x6488
leaq -0x98(%rbp), %rdi
callq 0x6488
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xd1c9
movq %rax, %rbx
leaq -0xb8(%rbp), %rdi
callq 0x40a0
jmp 0xd1d5
jmp 0xd1c4
movq %rax, %rbx
jmp 0xd1de
movq %rax, %rbx
jmp 0xd1e7
jmp 0xd1c4
jmp 0xd1c4
jmp 0xd1c9
movq %rax, %rbx
jmp 0xd1d5
movq %rax, %rbx
leaq -0x38(%rbp), %rdi
callq 0x5302
leaq -0x60(%rbp), %rdi
callq 0x6488
leaq -0x80(%rbp), %rdi
callq 0x6488
leaq -0x98(%rbp), %rdi
callq 0x6488
movq %rbx, %rdi
callq 0x4250
nop