internal void CheckBall(object sender, BallChangedDirectionEvent e) { if (Id == e.LastTouchTeamId) { return; } if (!e.LandingSpot.HasValue) { return; } var landingSpot = e.LandingSpot.Value; var foward = this.InMatchInformation.Foward.z; var incomming = (foward < 0 && e.FowardDirection > 0) || (foward > 0 && e.FowardDirection < 0); if (!incomming) { foreach (var player in Formation) { player.AddAction(PlayerAction.MoveToDenfensivePosition); } } else { Defend(); } }
internal void CountTouches(object sender, BallChangedDirectionEvent e) { var teamId = e.LastTouchTeamId; if (teamId != _lastTouchTeamId) { BallTouchCount = 1; _lastTouchTeamId = teamId; IsServe = false; return; } if (IsServe) { return; } BallTouchCount++; }