Exemplo n.º 1
0
 public InputResult UpdateAcceleration(Sprite sprite, Ball ball)
 {
     foreach (var playerController in UserPlayers)
     {
         var result = playerController.UpdateAcceleration(sprite, ball);
         if (result.IsHandled)
         {
             return(result);
         }
     }
     return(AiPlayer.UpdateAcceleration(sprite, ball));
 }
Exemplo n.º 2
0
 public InputResult <bool> TriggerPressed()
 {
     foreach (var playerController in UserPlayers)
     {
         var result = playerController.TriggerPressed();
         if (result.IsHandled)
         {
             return(result);
         }
     }
     return(AiPlayer.TriggerPressed());
 }
Exemplo n.º 3
0
        public InputResult <Vector2> GetDirectional(Vector2 defaultVector2)
        {
            foreach (var items in UserPlayers)
            {
                var d = items.GetDirectional(defaultVector2);
                if (d.IsHandled)
                {
                    return(d);
                }
            }

            return(AiPlayer.GetDirectional(defaultVector2));
        }
Exemplo n.º 4
0
 public PlayerOrAi(bool isSide, params IPlayerController[] userPlayer)
 {
     AiPlayer    = new AiPlayer(isSide);
     UserPlayers = userPlayer;
 }