// File: wrighteagle2d[P]wrighteaglebase/Debug/../src/WorldState.cpp
// Function: WorldStateUpdater::UpdateInfoWhenCollided()
void WorldStateUpdater::UpdateInfoWhenCollided() {
  if (mpObserver->Sense().IsCollideWithBall() ||
      mpObserver->Sense().IsCollideWithPlayer() ||
      mpObserver->Sense().IsCollideWithPost()) {
    if (mpObserver->Sense().IsCollideWithBall()) {
      SelfState().UpdateCollideWithBall(true);
    } else if (mpObserver->Sense().IsCollideWithPlayer()) {
      SelfState().UpdateCollideWithPlayer(true);
    } else if (mpObserver->Sense().IsCollideWithPost()) {
      SelfState().UpdateCollideWithPost(true);
    }
  }

  //如果发生碰撞，速度需要处理 仅在未更新看到速度时使用
  if (mpObserver->Sense().IsCollideWithBall() && Ball().GetVelDelay() != 0) {
    Ball().UpdateVel(GetBall().GetVel() * -0.1, GetBall().GetVelDelay(),
                     GetBall().GetVelConf());
    Ball().UpdateVelEps(0.1 * Ball().GetVelEps());
  }

  if (mpObserver->Sense().IsCollideWithPlayer()) {
    //找到最近的球员
    bool is_teammate = false;
    Unum tmmt = GetSeenClosestTeammate(); //无则返回0
    Unum oppn = GetSeenClosestOpponent(); //无则返回0

    if (tmmt * oppn == 0) {
      if (tmmt != 0) {
        is_teammate = true;
      } else if (oppn != 0) {
        is_teammate = false;
      } else {
        return;
      }
    } else {
      if (mpObserver->Teammate(tmmt).Dist() <=
          mpObserver->Opponent(oppn).Dist()) {
        is_teammate = true;
      } else {
        is_teammate = false;
      }
    }

    if (is_teammate) {
      if (mpObserver->Teammate(tmmt).GetDirChg().time() !=
          mpObserver->LatestSightTime()) {
        Teammate(tmmt).UpdateVel(Teammate(tmmt).GetVel() * -0.1,
                                 Teammate(tmmt).GetVelDelay(),
                                 Teammate(tmmt).GetVelConf());
      }
      Teammate(tmmt).UpdateCollideWithPlayer(true);
    } else {
      if (mpObserver->Opponent(oppn).GetDirChg().time() !=
          mpObserver->LatestSightTime()) {
        Opponent(oppn).UpdateVel(Opponent(oppn).GetVel() * -0.1,
                                 Opponent(oppn).GetVelDelay(),
                                 Opponent(oppn).GetVelConf());
      }
      Opponent(oppn).UpdateCollideWithPlayer(true);
    }
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xc0, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x68(%rbp)
movq (%rax), %rdi
callq 0x119d0
movq %rax, %rdi
callq 0xbcec0
testb $0x1, %al
jne 0xb3250
movq -0x68(%rbp), %rax
movq (%rax), %rdi
callq 0x119d0
movq %rax, %rdi
callq 0xbcee0
testb $0x1, %al
jne 0xb3250
movq -0x68(%rbp), %rax
movq (%rax), %rdi
callq 0x119d0
movq %rax, %rdi
callq 0xbd600
testb $0x1, %al
jne 0xb3250
jmp 0xb32ea
movq -0x68(%rbp), %rax
movq (%rax), %rdi
callq 0x119d0
movq %rax, %rdi
callq 0xbcec0
testb $0x1, %al
jne 0xb326a
jmp 0xb3282
movq -0x68(%rbp), %rdi
callq 0xbc740
movq %rax, %rdi
movl $0x1, %esi
callq 0xbda50
jmp 0xb32e8
movq -0x68(%rbp), %rax
movq (%rax), %rdi
callq 0x119d0
movq %rax, %rdi
callq 0xbcee0
testb $0x1, %al
jne 0xb329c
jmp 0xb32b4
movq -0x68(%rbp), %rdi
callq 0xbc740
movq %rax, %rdi
movl $0x1, %esi
callq 0xbda80
jmp 0xb32e6
movq -0x68(%rbp), %rax
movq (%rax), %rdi
callq 0x119d0
movq %rax, %rdi
callq 0xbd600
testb $0x1, %al
jne 0xb32ce
jmp 0xb32e4
movq -0x68(%rbp), %rdi
callq 0xbc740
movq %rax, %rdi
movl $0x1, %esi
callq 0xbdab0
jmp 0xb32e6
jmp 0xb32e8
jmp 0xb32ea
movq -0x68(%rbp), %rax
movq (%rax), %rdi
callq 0x119d0
movq %rax, %rdi
callq 0xbcec0
testb $0x1, %al
jne 0xb3307
jmp 0xb33d1
movq -0x68(%rbp), %rdi
callq 0xbc760
movq %rax, %rdi
callq 0x28a30
cmpl $0x0, %eax
je 0xb33d1
movq -0x68(%rbp), %rdi
callq 0xbc760
movq -0x68(%rbp), %rdi
movq %rax, -0x80(%rbp)
callq 0xbc6e0
movq %rax, %rdi
callq 0x10a80
movq %rax, %rdi
movsd 0x10236(%rip), %xmm0    # 0xc3580
movsd %xmm0, -0x20(%rbp)
leaq -0x20(%rbp), %rsi
callq 0x13320
movq -0x68(%rbp), %rdi
movsd %xmm0, -0x18(%rbp)
movsd %xmm1, -0x10(%rbp)
callq 0xbc6e0
movq %rax, %rdi
callq 0x28a30
movq -0x68(%rbp), %rdi
movl %eax, -0x74(%rbp)
callq 0xbc6e0
movq %rax, %rdi
callq 0x32aa0
movq -0x80(%rbp), %rdi
movl -0x74(%rbp), %edx
movsd (%rax), %xmm0
leaq -0x18(%rbp), %rsi
callq 0x142a0
movq -0x68(%rbp), %rdi
callq 0xbc760
movq -0x68(%rbp), %rdi
movq %rax, -0x70(%rbp)
callq 0xbc760
movq %rax, %rdi
callq 0xbd9f0
movq -0x70(%rbp), %rdi
movaps %xmm0, %xmm1
movsd 0xf148(%rip), %xmm0     # 0xc2510
mulsd %xmm1, %xmm0
callq 0xbc850
movq -0x68(%rbp), %rax
movq (%rax), %rdi
callq 0x119d0
movq %rax, %rdi
callq 0xbcee0
testb $0x1, %al
jne 0xb33ee
jmp 0xb3693
movq -0x68(%rbp), %rdi
movb $0x0, -0x21(%rbp)
callq 0xb8010
movq -0x68(%rbp), %rdi
movl %eax, -0x28(%rbp)
callq 0xb8110
movl %eax, -0x2c(%rbp)
movl -0x28(%rbp), %eax
imull -0x2c(%rbp), %eax
cmpl $0x0, %eax
jne 0xb3437
cmpl $0x0, -0x28(%rbp)
je 0xb3422
movb $0x1, -0x21(%rbp)
jmp 0xb3435
cmpl $0x0, -0x2c(%rbp)
je 0xb342e
movb $0x0, -0x21(%rbp)
jmp 0xb3433
jmp 0xb3693
jmp 0xb3435
jmp 0xb3492
movq -0x68(%rbp), %rax
movq (%rax), %rdi
movl -0x28(%rbp), %esi
callq 0xbd1a0
movq %rax, %rdi
callq 0xbd3a0
movq %rax, %rcx
movq -0x68(%rbp), %rax
movsd (%rcx), %xmm0
movsd %xmm0, -0x88(%rbp)
movq (%rax), %rdi
movl -0x2c(%rbp), %esi
callq 0xbd1f0
movq %rax, %rdi
callq 0xbd3a0
movsd -0x88(%rbp), %xmm1
movsd (%rax), %xmm0
ucomisd %xmm1, %xmm0
jb 0xb348c
movb $0x1, -0x21(%rbp)
jmp 0xb3490
movb $0x0, -0x21(%rbp)
jmp 0xb3492
testb $0x1, -0x21(%rbp)
je 0xb3599
movq -0x68(%rbp), %rax
movq (%rax), %rdi
movl -0x28(%rbp), %esi
callq 0xbd1a0
movq %rax, %rdi
callq 0xbd490
movq %rax, %rdi
callq 0x28aa0
movq %rax, %rcx
movq -0x68(%rbp), %rax
movq %rcx, -0x90(%rbp)
movq (%rax), %rdi
callq 0xbc870
movq -0x90(%rbp), %rdi
movq %rax, %rsi
callq 0x175f0
testb $0x1, %al
jne 0xb34e9
jmp 0xb357b
movq -0x68(%rbp), %rdi
movl -0x28(%rbp), %esi
callq 0xbc780
movq -0x68(%rbp), %rdi
movq %rax, -0xa0(%rbp)
movl -0x28(%rbp), %esi
callq 0xbc780
movq %rax, %rdi
callq 0x10a80
movq %rax, %rdi
movsd 0x10065(%rip), %xmm0    # 0xc3580
movsd %xmm0, -0x48(%rbp)
leaq -0x48(%rbp), %rsi
callq 0x13320
movq -0x68(%rbp), %rdi
movsd %xmm0, -0x40(%rbp)
movsd %xmm1, -0x38(%rbp)
movl -0x28(%rbp), %esi
callq 0xbc780
movq %rax, %rdi
callq 0x28a30
movq -0x68(%rbp), %rdi
movl %eax, -0x94(%rbp)
movl -0x28(%rbp), %esi
callq 0xbc780
movq %rax, %rdi
callq 0x32aa0
movq -0xa0(%rbp), %rdi
movl -0x94(%rbp), %edx
movsd (%rax), %xmm0
leaq -0x40(%rbp), %rsi
callq 0x142a0
movq -0x68(%rbp), %rdi
movl -0x28(%rbp), %esi
callq 0xbc780
movq %rax, %rdi
movl $0x1, %esi
callq 0xbda80
jmp 0xb3691
movq -0x68(%rbp), %rax
movq (%rax), %rdi
movl -0x2c(%rbp), %esi
callq 0xbd1f0
movq %rax, %rdi
callq 0xbd490
movq %rax, %rdi
callq 0x28aa0
movq %rax, %rcx
movq -0x68(%rbp), %rax
movq %rcx, -0xa8(%rbp)
movq (%rax), %rdi
callq 0xbc870
movq -0xa8(%rbp), %rdi
movq %rax, %rsi
callq 0x175f0
testb $0x1, %al
jne 0xb35e6
jmp 0xb3678
movq -0x68(%rbp), %rdi
movl -0x2c(%rbp), %esi
callq 0xbc7e0
movq -0x68(%rbp), %rdi
movq %rax, -0xb8(%rbp)
movl -0x2c(%rbp), %esi
callq 0xbc7e0
movq %rax, %rdi
callq 0x10a80
movq %rax, %rdi
movsd 0xff68(%rip), %xmm0     # 0xc3580
movsd %xmm0, -0x60(%rbp)
leaq -0x60(%rbp), %rsi
callq 0x13320
movq -0x68(%rbp), %rdi
movsd %xmm0, -0x58(%rbp)
movsd %xmm1, -0x50(%rbp)
movl -0x2c(%rbp), %esi
callq 0xbc7e0
movq %rax, %rdi
callq 0x28a30
movq -0x68(%rbp), %rdi
movl %eax, -0xac(%rbp)
movl -0x2c(%rbp), %esi
callq 0xbc7e0
movq %rax, %rdi
callq 0x32aa0
movq -0xb8(%rbp), %rdi
movl -0xac(%rbp), %edx
movsd (%rax), %xmm0
leaq -0x58(%rbp), %rsi
callq 0x142a0
movq -0x68(%rbp), %rdi
movl -0x2c(%rbp), %esi
callq 0xbc7e0
movq %rax, %rdi
movl $0x1, %esi
callq 0xbda80
jmp 0xb3693
addq $0xc0, %rsp
popq %rbp
retq
nopl (%rax)