示例#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));
 }
示例#2
0
 public InputResult <bool> TriggerPressed()
 {
     foreach (var playerController in UserPlayers)
     {
         var result = playerController.TriggerPressed();
         if (result.IsHandled)
         {
             return(result);
         }
     }
     return(AiPlayer.TriggerPressed());
 }
示例#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));
        }
示例#4
0
 public PlayerOrAi(bool isSide, params IPlayerController[] userPlayer)
 {
     AiPlayer    = new AiPlayer(isSide);
     UserPlayers = userPlayer;
 }