// File: 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
subq $0x160, %rsp            # imm = 0x160
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x120(%rbp)
movl $0x0, 0xeb0(%rax)
leaq 0xeffb9(%rip), %rdi     # 0xfe6c8
callq 0x8ebb0
movq -0x120(%rbp), %rdi
addq $0x28, %rdi
callq 0x11900
testb $0x1, %al
jne 0xec5b
movq -0x120(%rbp), %rdi
addq $0x28, %rdi
callq 0x11920
movq %rax, -0x18(%rbp)
movq -0x120(%rbp), %rdi
addq $0x28, %rdi
callq 0x11980
movq %rax, -0x20(%rbp)
leaq -0x18(%rbp), %rdi
leaq -0x20(%rbp), %rsi
callq 0x11950
testb $0x1, %al
jne 0xe76a
jmp 0xec4b
leaq -0x18(%rbp), %rdi
callq 0x119b0
movl (%rax), %eax
decl %eax
movl %eax, %ecx
movq %rcx, -0x128(%rbp)
subl $0x9, %eax
ja 0xec39
movq -0x128(%rbp), %rax
leaq 0xb28d9(%rip), %rcx     # 0xc1070
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x10(%rbp), %rdi
callq 0x119d0
movq %rax, %rdi
callq 0x119f0
movq -0x120(%rbp), %rcx
movl (%rax), %eax
cmpl 0xe54(%rcx), %eax
jne 0xe8af
movq -0x120(%rbp), %rax
movl $0x6, 0xeb0(%rax)
xorps %xmm0, %xmm0
movsd %xmm0, -0x38(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x40(%rbp)
leaq -0x30(%rbp), %rdi
leaq -0x38(%rbp), %rsi
leaq -0x40(%rbp), %rdx
callq 0x11a10
xorps %xmm0, %xmm0
movsd %xmm0, -0x58(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x60(%rbp)
leaq -0x50(%rbp), %rdi
leaq -0x58(%rbp), %rsi
leaq -0x60(%rbp), %rdx
callq 0x11a10
leaq -0x18(%rbp), %rdi
callq 0x119b0
movsd 0x28(%rax), %xmm0
movsd %xmm0, -0x138(%rbp)
leaq -0x18(%rbp), %rdi
callq 0x119b0
movsd -0x138(%rbp), %xmm0
movq %rax, %rcx
movq -0x120(%rbp), %rax
movsd 0x30(%rcx), %xmm1
movq 0x20(%rax), %rdi
movq 0x18(%rax), %rsi
leaq -0x30(%rbp), %rdx
leaq -0x50(%rbp), %rcx
movl $0x1, %r8d
callq 0xe230
movq -0x10(%rbp), %rax
movq %rax, -0x130(%rbp)
movq -0x10(%rbp), %rdi
callq 0x11a70
movq -0x130(%rbp), %rdi
movq (%rax), %rax
movq %rax, -0x68(%rbp)
movq -0x68(%rbp), %rsi
callq 0x11a50
movq -0x10(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x11a90
movq -0x10(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0x11ac0
jmp 0xec3b
movq -0x10(%rbp), %rdi
callq 0x119d0
movq %rax, %rdi
callq 0x11af0
movq -0x120(%rbp), %rcx
movl (%rax), %eax
cmpl 0xe44(%rcx), %eax
jne 0xe9da
movq -0x120(%rbp), %rax
movl $0x2, 0xeb0(%rax)
xorps %xmm0, %xmm0
movsd %xmm0, -0x80(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x88(%rbp)
leaq -0x78(%rbp), %rdi
leaq -0x80(%rbp), %rsi
leaq -0x88(%rbp), %rdx
callq 0x11a10
xorps %xmm0, %xmm0
movsd %xmm0, -0xa0(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0xa8(%rbp)
leaq -0x98(%rbp), %rdi
leaq -0xa0(%rbp), %rsi
leaq -0xa8(%rbp), %rdx
callq 0x11a10
leaq -0x18(%rbp), %rdi
callq 0x119b0
movsd 0x28(%rax), %xmm0
movsd %xmm0, -0x148(%rbp)
leaq -0x18(%rbp), %rdi
callq 0x119b0
movsd -0x148(%rbp), %xmm0
movq %rax, %rcx
movq -0x120(%rbp), %rax
movsd 0x30(%rcx), %xmm1
movq 0x20(%rax), %rdi
leaq -0x78(%rbp), %rsi
leaq -0x98(%rbp), %rdx
callq 0xe430
movq -0x10(%rbp), %rax
movq %rax, -0x140(%rbp)
movq -0x10(%rbp), %rdi
callq 0x11a70
movq -0x140(%rbp), %rdi
movq (%rax), %rax
movq %rax, -0xb0(%rbp)
movq -0xb0(%rbp), %rsi
callq 0x11b10
movq -0x10(%rbp), %rdi
leaq -0x78(%rbp), %rsi
callq 0x11b30
movq -0x10(%rbp), %rdi
leaq -0x98(%rbp), %rsi
callq 0x11b60
jmp 0xec3b
movq -0x10(%rbp), %rdi
callq 0x119d0
movq %rax, %rdi
callq 0x11b90
movq -0x120(%rbp), %rcx
movl (%rax), %eax
cmpl 0xe64(%rcx), %eax
jne 0xeaea
movq -0x120(%rbp), %rax
movl $0xa, 0xeb0(%rax)
xorps %xmm0, %xmm0
movsd %xmm0, -0xc8(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0xd0(%rbp)
leaq -0xc0(%rbp), %rdi
leaq -0xc8(%rbp), %rsi
leaq -0xd0(%rbp), %rdx
callq 0x11a10
xorps %xmm0, %xmm0
movsd %xmm0, -0xe8(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0xf0(%rbp)
leaq -0xe0(%rbp), %rdi
leaq -0xe8(%rbp), %rsi
leaq -0xf0(%rbp), %rdx
callq 0x11a10
leaq -0x18(%rbp), %rdi
callq 0x119b0
movq %rax, %rdi
addq $0x38, %rdi
leaq -0xc0(%rbp), %rsi
leaq -0xe0(%rbp), %rdx
callq 0xe5a0
movq -0x10(%rbp), %rax
movq %rax, -0x150(%rbp)
movq -0x10(%rbp), %rdi
callq 0x11a70
movq -0x150(%rbp), %rdi
movq (%rax), %rax
movq %rax, -0xf8(%rbp)
movq -0xf8(%rbp), %rsi
callq 0x11bb0
movq -0x10(%rbp), %rdi
leaq -0xc0(%rbp), %rsi
callq 0x11bd0
movq -0x10(%rbp), %rdi
leaq -0xe0(%rbp), %rsi
callq 0x11c00
jmp 0xec3b
movq -0x10(%rbp), %rdi
callq 0x119d0
movq %rax, %rdi
callq 0x11c30
movq -0x120(%rbp), %rcx
movl (%rax), %eax
cmpl 0xe40(%rcx), %eax
jne 0xeb9b
movq -0x120(%rbp), %rax
movl $0x1, 0xeb0(%rax)
xorps %xmm0, %xmm0
movsd %xmm0, -0x100(%rbp)
leaq -0x18(%rbp), %rdi
callq 0x119b0
movq %rax, %rcx
movq -0x120(%rbp), %rax
movsd 0x30(%rcx), %xmm0
movq 0x20(%rax), %rdi
leaq -0x100(%rbp), %rsi
callq 0xe600
movq -0x10(%rbp), %rax
movq %rax, -0x158(%rbp)
movq -0x10(%rbp), %rdi
callq 0x11a70
movq -0x158(%rbp), %rdi
movq (%rax), %rax
movq %rax, -0x108(%rbp)
movq -0x108(%rbp), %rsi
callq 0x11c50
movq -0x10(%rbp), %rdi
movsd -0x100(%rbp), %xmm0
callq 0x11c70
jmp 0xec3b
movq -0x10(%rbp), %rdi
callq 0x119d0
movq %rax, %rdi
callq 0x11c90
movq -0x120(%rbp), %rcx
movl (%rax), %eax
cmpl 0xe48(%rcx), %eax
jne 0xec37
xorps %xmm0, %xmm0
movsd %xmm0, -0x110(%rbp)
leaq -0x18(%rbp), %rdi
callq 0x119b0
movq %rax, %rcx
movq -0x120(%rbp), %rax
movsd 0x30(%rcx), %xmm0
movq 0x20(%rax), %rdi
leaq -0x110(%rbp), %rsi
callq 0xe690
movq -0x10(%rbp), %rax
movq %rax, -0x160(%rbp)
movq -0x10(%rbp), %rdi
callq 0x11a70
movq -0x160(%rbp), %rdi
movq (%rax), %rax
movq %rax, -0x118(%rbp)
movq -0x118(%rbp), %rsi
callq 0x11cb0
movq -0x10(%rbp), %rdi
movsd -0x110(%rbp), %xmm0
callq 0x11cd0
jmp 0xec3b
jmp 0xec3b
jmp 0xec3d
leaq -0x18(%rbp), %rdi
callq 0x11cf0
jmp 0xe740
movq -0x120(%rbp), %rdi
addq $0x28, %rdi
callq 0x11d10
leaq 0xefa66(%rip), %rdi     # 0xfe6c8
callq 0x8ebe0
addq $0x160, %rsp            # imm = 0x160
popq %rbp
retq