Ejemplo n.º 1
0
        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();
            }
        }
Ejemplo n.º 2
0
        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++;
        }