Exemple #1
0
        /*
         * This method is responsible for creating players. The types of players
         * as well as the controller and controller scheme are a must when calling
         * this method.
         * */
        private void CreatePlayer(PlayerTypes humanOrAI, PlayerTypes pacOrGhost, ControllerTypes controller, ControllerScheme scheme)
        {
            Element player;

            if (pacOrGhost == PlayerTypes.PacPlayer)
                player = new PacPlayer();
            else
                player = new Ghost();

            if (humanOrAI == PlayerTypes.Human)
            {
                if (controller == ControllerTypes.Keyboard)
                    player.AddController(new KeyboardController(scheme));
                else
                    player.AddController(new XboxController(scheme));
            }
            else
            {
                if (pacOrGhost == PlayerTypes.PacPlayer)
                    player.AddController(new PacplayerAIController());
                else
                    player.AddController(new GhostAIController());
            }

            players.Add(player);
        }
 public ThumbnailBubble(MediaInfo mediaInfo) : this()
 {
     if (mediaInfo == null)
     {
         throw new NullReferenceException("MediaInfo cannot be null.");
     }
     this.IsVideoThumbnail = PacPlayer.IsSupport(mediaInfo.FileName);
     this.FileName         = mediaInfo.FileName;
     this.FileID           = mediaInfo.FileID;
     this.StreamURL        = mediaInfo.StreamURL;
     this.ThumbnailUrl     = mediaInfo.ThumbURL;
 }
Exemple #3
0
        /*
         * This method is responsible for creating players. The types of players
         * as well as the controller and controller scheme are a must when calling
         * this method.
         * */
        private void CreatePlayer(PlayerTypes humanOrAI, PlayerTypes pacOrGhost, ControllerTypes controller, ControllerScheme scheme)
        {
            Element player;

            if (pacOrGhost == PlayerTypes.PacPlayer)
            {
                player = new PacPlayer();
            }
            else
            {
                player = new Ghost();
            }

            if (humanOrAI == PlayerTypes.Human)
            {
                if (controller == ControllerTypes.Keyboard)
                {
                    player.AddController(new KeyboardController(scheme));
                }
                else
                {
                    player.AddController(new XboxController(scheme));
                }
            }
            else
            {
                if (pacOrGhost == PlayerTypes.PacPlayer)
                {
                    player.AddController(new PacplayerAIController());
                }
                else
                {
                    player.AddController(new GhostAIController());
                }
            }

            players.Add(player);
        }