// File: /workspace/github_cpp_makefile_star2_O2/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, %rbx
movq %rdi, %r14
andl $0x0, 0xeb0(%rdi)
leaq 0x6b6ed(%rip), %rdi     # 0x77578
callq 0x4206e
leaq 0x28(%r14), %r15
movq 0x28(%r14), %r13
cmpq %r15, %r13
je 0xc0be
leaq 0x56a0(%rbx), %rax
movq %rax, -0x78(%rbp)
leaq 0x5668(%rbx), %rax
movq %rax, -0x70(%rbp)
leaq 0x5678(%rbx), %rax
movq %rax, -0x68(%rbp)
leaq 0x5640(%rbx), %rax
movq %rax, -0x60(%rbp)
leaq 0x5650(%rbx), %rax
movq %rax, -0x58(%rbp)
leaq 0x4b1d1(%rip), %r12     # 0x570b0
cmpq %r15, %r13
je 0xc0b6
movl 0x10(%r13), %eax
decl %eax
cmpl $0x9, %eax
ja 0xc0ad
movslq (%r12,%rax,4), %rax
addq %r12, %rax
jmpq *%rax
movl 0x160(%rbx), %eax
cmpl 0xe40(%r14), %eax
jne 0xc0ad
movl $0x1, 0xeb0(%r14)
andq $0x0, -0x40(%rbp)
movsd 0x40(%r13), %xmm0
movq 0x20(%r14), %rdi
leaq -0x40(%rbp), %rsi
callq 0xbdb0
movq 0xc(%rbx), %rax
movq %rax, 0x56b0(%rbx)
movsd -0x40(%rbp), %xmm0
movsd %xmm0, 0x56b8(%rbx)
jmp 0xc0ad
movl 0x168(%rbx), %eax
cmpl 0xe48(%r14), %eax
jne 0xc0ad
andq $0x0, -0x40(%rbp)
movsd 0x40(%r13), %xmm0
movq 0x20(%r14), %rdi
leaq -0x40(%rbp), %rsi
callq 0xbe14
movq 0xc(%rbx), %rax
movq %rax, 0x56c0(%rbx)
movsd -0x40(%rbp), %xmm0
movsd %xmm0, 0x56c8(%rbx)
jmp 0xc0ad
movl 0x15c(%rbx), %eax
cmpl 0xe44(%r14), %eax
jne 0xc0ad
movl $0x2, 0xeb0(%r14)
xorps %xmm0, %xmm0
movaps %xmm0, -0x40(%rbp)
movaps %xmm0, -0x50(%rbp)
movsd 0x38(%r13), %xmm0
movsd 0x40(%r13), %xmm1
movq 0x20(%r14), %rdi
leaq -0x40(%rbp), %rsi
leaq -0x50(%rbp), %rdx
callq 0xbc72
movq 0xc(%rbx), %rax
movq %rax, 0x5660(%rbx)
movaps -0x40(%rbp), %xmm0
movq -0x70(%rbp), %rax
movups %xmm0, (%rax)
movaps -0x50(%rbp), %xmm0
movq -0x68(%rbp), %rax
jmp 0xc0aa
movl 0x158(%rbx), %eax
cmpl 0xe54(%r14), %eax
jne 0xc0ad
movl $0x6, 0xeb0(%r14)
xorps %xmm0, %xmm0
movaps %xmm0, -0x40(%rbp)
movaps %xmm0, -0x50(%rbp)
movsd 0x38(%r13), %xmm0
movsd 0x40(%r13), %xmm1
movq 0x18(%r14), %rsi
movq 0x20(%r14), %rdi
leaq -0x40(%rbp), %rdx
leaq -0x50(%rbp), %rcx
pushq $0x1
popq %r8
callq 0xbb26
movq 0xc(%rbx), %rax
movq %rax, 0x5638(%rbx)
movaps -0x40(%rbp), %xmm0
movq -0x60(%rbp), %rax
movups %xmm0, (%rax)
movaps -0x50(%rbp), %xmm0
movq -0x58(%rbp), %rax
jmp 0xc0aa
movl 0x170(%rbx), %eax
cmpl 0xe64(%r14), %eax
jne 0xc0ad
movl $0xa, 0xeb0(%r14)
movups 0x48(%r13), %xmm0
movq 0xc(%rbx), %rax
movq %rax, 0x5688(%rbx)
movups %xmm0, 0x5690(%rbx)
movq -0x78(%rbp), %rax
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movq (%r13), %r13
jmp 0xbedf
movq %r15, %rdi
callq 0xd444
leaq 0x6b4b3(%rip), %rdi     # 0x77578
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x4208a