// File: /workspace/github_cpp_makefile_star2_O3/wrighteagle2d[P]wrighteaglebase/Debug/../src/ActionEffector.cpp
// Function: ActionEffector::CheckCommandQueue(Observer*)
void ActionEffector::CheckCommandQueue(Observer *observer) {
  mLastCommandType = CT_None;

  ActionEffector::CMD_QUEUE_MUTEX.Lock();
  if (!mCommandQueue.empty()) {
    for (std::list<CommandInfo>::iterator it = mCommandQueue.begin();
         it != mCommandQueue.end(); ++it) {
      switch (it->mType) {
      case CT_Kick:
        if (observer->Sense().GetKickCount() == mKickCount) {
          mLastCommandType = CT_Kick;

          Vector ball_pos = Vector(0.0, 0.0);
          Vector ball_vel = Vector(0.0, 0.0);
          ComputeInfoAfterKick(it->mPower, it->mAngle, mSelfState, mBallState,
                               ball_pos, ball_vel);

          observer->SetBallKickTime(observer->CurrentTime());
          observer->SetBallPosByKick(ball_pos);
          observer->SetBallVelByKick(ball_vel);
        }
        break;
      case CT_Dash:
        if (observer->Sense().GetDashCount() == mDashCount) {
          mLastCommandType = CT_Dash;

          Vector player_pos = Vector(0.0, 0.0);
          Vector player_vel = Vector(0.0, 0.0);
          ComputeInfoAfterDash(it->mPower, it->mAngle, mSelfState, player_pos,
                               player_vel);

          observer->SetPlayerDashTime(observer->CurrentTime());
          observer->SetPlayerPosByDash(player_pos);
          observer->SetPlayerVelByDash(player_vel);
        }
        break;
      case CT_Move:
        if (observer->Sense().GetMoveCount() == mMoveCount) {
          mLastCommandType = CT_Move;

          Vector player_pos = Vector(0.0, 0.0);
          Vector player_vel = Vector(0.0, 0.0);
          ComputeInfoAfterMove(it->mMovePos, player_pos, player_vel);

          observer->SetPlayerMoveTime(observer->CurrentTime());
          observer->SetPlayerPosByMove(player_pos);
          observer->SetPlayerVelByMove(player_vel);
        }
        break;
      case CT_Turn:
        if (observer->Sense().GetTurnCount() == mTurnCount) {
          mLastCommandType = CT_Turn;

          AngleDeg body_dir = 0.0;
          ComputeInfoAfterTurn(it->mAngle, mSelfState, body_dir);

          observer->SetPlayerTurnTime(observer->CurrentTime());
          observer->SetPlayerBodyDirByTurn(body_dir);
        }
        break;
      case CT_TurnNeck:
        if (observer->Sense().GetTurnNeckCount() == mTurnNeckCount) {
          AngleDeg neck_dir = 0.0;
          ComputeInfoAfterTurnNeck(it->mAngle, mSelfState, neck_dir);

          observer->SetPlayerTurnNeckTime(observer->CurrentTime());
          observer->SetPlayerNeckDirByTurnNeck(neck_dir);
        }
        break;
      default:
        break;
      }
    }

    mCommandQueue.clear(); // 清空命令队列
  }
  ActionEffector::CMD_QUEUE_MUTEX.UnLock();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movl $0x0, 0xeb0(%rdi)
leaq 0x771a6(%rip), %rdi     # 0x84578
callq 0x4e01a
leaq 0x28(%rbx), %r15
movq 0x28(%rbx), %r13
cmpq %r15, %r13
je 0xd617
leaq 0x56a0(%r14), %rax
movq %rax, -0x78(%rbp)
leaq 0x5668(%r14), %rax
movq %rax, -0x70(%rbp)
leaq 0x5678(%r14), %rax
movq %rax, -0x68(%rbp)
leaq 0x5640(%r14), %rax
movq %rax, -0x60(%rbp)
leaq 0x5650(%r14), %rax
movq %rax, -0x58(%rbp)
leaq 0x5bc9a(%rip), %r12     # 0x690c0
movl 0x10(%r13), %eax
decl %eax
cmpl $0x9, %eax
ja 0xd5f2
movslq (%r12,%rax,4), %rax
addq %r12, %rax
jmpq *%rax
movl 0x160(%r14), %eax
cmpl 0xe40(%rbx), %eax
jne 0xd5f2
movl $0x1, 0xeb0(%rbx)
movq $0x0, -0x40(%rbp)
movsd 0x40(%r13), %xmm0
movq 0x20(%rbx), %rdi
leaq -0x40(%rbp), %rsi
callq 0xd200
movq 0xc(%r14), %rax
movq %rax, 0x56b0(%r14)
movsd -0x40(%rbp), %xmm0
movsd %xmm0, 0x56b8(%r14)
jmp 0xd5f2
movl 0x168(%r14), %eax
cmpl 0xe48(%rbx), %eax
jne 0xd5f2
movq $0x0, -0x40(%rbp)
movsd 0x40(%r13), %xmm0
movq 0x20(%rbx), %rdi
leaq -0x40(%rbp), %rsi
callq 0xd2fe
movq 0xc(%r14), %rax
movq %rax, 0x56c0(%r14)
movsd -0x40(%rbp), %xmm0
movsd %xmm0, 0x56c8(%r14)
jmp 0xd5f2
movl 0x15c(%r14), %eax
cmpl 0xe44(%rbx), %eax
jne 0xd5f2
movl $0x2, 0xeb0(%rbx)
xorps %xmm0, %xmm0
movaps %xmm0, -0x40(%rbp)
movaps %xmm0, -0x50(%rbp)
movsd 0x38(%r13), %xmm0
movsd 0x40(%r13), %xmm1
movq 0x20(%rbx), %rdi
leaq -0x40(%rbp), %rsi
leaq -0x50(%rbp), %rdx
callq 0xd032
movq 0xc(%r14), %rax
movq %rax, 0x5660(%r14)
movaps -0x40(%rbp), %xmm0
movq -0x70(%rbp), %rax
movups %xmm0, (%rax)
movaps -0x50(%rbp), %xmm0
movq -0x68(%rbp), %rax
jmp 0xd5ef
movl 0x158(%r14), %eax
cmpl 0xe54(%rbx), %eax
jne 0xd5f2
movl $0x6, 0xeb0(%rbx)
xorps %xmm0, %xmm0
movaps %xmm0, -0x40(%rbp)
movaps %xmm0, -0x50(%rbp)
movsd 0x38(%r13), %xmm0
movsd 0x40(%r13), %xmm1
movq 0x18(%rbx), %rsi
movq 0x20(%rbx), %rdi
leaq -0x40(%rbp), %rdx
leaq -0x50(%rbp), %rcx
movl $0x1, %r8d
callq 0xccec
movq 0xc(%r14), %rax
movq %rax, 0x5638(%r14)
movaps -0x40(%rbp), %xmm0
movq -0x60(%rbp), %rax
movups %xmm0, (%rax)
movaps -0x50(%rbp), %xmm0
movq -0x58(%rbp), %rax
jmp 0xd5ef
movl 0x170(%r14), %eax
cmpl 0xe64(%rbx), %eax
jne 0xd5f2
movl $0xa, 0xeb0(%rbx)
movups 0x48(%r13), %xmm0
movq 0xc(%r14), %rax
movq %rax, 0x5688(%r14)
movups %xmm0, 0x5690(%r14)
movq -0x78(%rbp), %rax
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movq (%r13), %r13
cmpq %r15, %r13
jne 0xd426
movq %r15, %rdi
callq 0xef08
movq %r15, 0x30(%rbx)
movq %r15, 0x28(%rbx)
movq $0x0, 0x38(%rbx)
leaq 0x76f5a(%rip), %rdi     # 0x84578
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x4e036
nop