コード例 #1
0
        public SwitchPropertiesModel(Configuration config, TriggerAction saveTrigger, List <string> logos)
        {
            _trigger             = saveTrigger;
            TriggerConfigCommand = new RelayCommand(OnTriggerConfig);
            FadeDuration         = config.CrossFadeDuration.ToString("F2");

            if (CheckProperty(config.Cam1Source))
            {
                Cam1Source = config.Cam1Source;
            }

            if (CheckProperty(config.Cam2Source))
            {
                Cam2Source = config.Cam2Source;
            }

            if (CheckProperty(config.NoteBookSource))
            {
                NoteBookSource = config.NoteBookSource;
            }

            if (CheckProperty(config.LogoSource))
            {
                LogoSource = config.LogoSource;
            }

            foreach (string item in logos)
            {
                Logos.Add(item);
            }
        }
コード例 #2
0
 private void CreateLogos()
 {
     _greenRangerLogo = new Logos(new Rectangle(GameWorld.WorldCenter, _greenRangerSize), ZeldaGraphics.GreenRangerLogo);
     _superGoonLogo   = new Logos(new Rectangle(GameWorld.WorldCenter, _superGoonLogoSize), ZeldaGraphics.SuperGoonLogo);
     _greenRangerLogo.SpriteComponent.Opacity = 0;
     _superGoonLogo.SpriteComponent.Opacity   = 0;
 }
コード例 #3
0
 public Channel GetSuggestedChannel(out SuggestionType suggestionType)
 {
     if (Channels.Count > 0)
     {
         suggestionType = SuggestionType.Channel;
         return(Channels.First());
     }
     else if (Logos.Count > 0)
     {
         suggestionType = SuggestionType.Logo;
         return(Logos.First().Channels.First());
     }
     else
     {
         suggestionType = SuggestionType.Alias;
         return(Aliases.First().Channel);
     }
 }
コード例 #4
0
        private void SetPlayerName()
        {
            Logos.PrintLambda();

            Console.WriteLine("What are you called?");
            PlayerName = Console.ReadLine();

            while (PlayerName == "")
            {
                Logos.PrintLambda();
                Console.WriteLine("I'm sorry, I did not get that. Can you repeat your name?");
                PlayerName = Console.ReadLine();
            }
            Logos.PrintLambda();
            Console.WriteLine($"Hello {PlayerName}! Lets get started.");
            Console.WriteLine("Press any key to start.");
            var start = Console.ReadLine();

            Console.Clear();
        }
コード例 #5
0
        public Image GetImageById(int id)
        {
            Image image = null;

            if (Logos?.Count() > 0)
            {
                image = Logos.FirstOrDefault(x => x.Id == id);
            }
            if (image != null)
            {
                return(image);
            }
            if (Carousels?.Count() > 0)
            {
                image = Carousels.FirstOrDefault(x => x.Id == id);
            }
            if (image != null)
            {
                return(image);
            }
            return(image = Groups.Select(group => group.Images.Where(img => img.Id == id))?.FirstOrDefault()?.FirstOrDefault());
        }
コード例 #6
0
        /// <summary>
        ///
        /// </summary>
        private void DrawLogoAndName()
        {
            Logo logo = new Logos().GetRandomLogo();

            if (logo.ImageName != string.Empty)
            {
                image.Source = new BitmapImage(
                    new Uri("/PcgTools;component/Help/External Links/" + logo.ImageName, UriKind.Relative));

                /* Adapt size to a maximum of ImagePixelArea:
                 * 1. nw * nh = 10.000
                 * 2. nw / nh = ow / oh               where nw = new width, nh = new height, ow = org width, oh = org height
                 * 3. nw / nh = ow / oh => nw = ow / oh * nh
                 * Combine 3 with 1: ow / oh * nh * nh = 10000 => nh * nh = 10000 / (ow / oh) =>
                 *                   nh = sqrt(10000 / (ow / oh))
                 *           with 1: nw = 10000 / nh
                 */
                image.Height = Math.Sqrt(ImagePixelArea / (image.Source.Width / image.Source.Height));
                image.Width  = ImagePixelArea / image.Height;
            }

            labelVersion.Content     = MainViewModel.Version;
            labelSponsorName.Content = logo.Name;
        }
コード例 #7
0
        public void MoveToDirection(EDirection direction)
        {
            var validDirection = _currentRoom.ConnectedRooms.TryGetValue(direction, out Room room); //give back bool

            if (validDirection == true)
            {
                var result   = _currentRoom.ConnectedRooms[direction]; //gives back room
                var lastRoom = _currentRoom;
                _currentRoom = result;

                //               if ((_currentRoom.Name == "Door") || (_currentRoom.Name == "Window"))
                //              {
                //                   Console.WriteLine("You found a way out!!");
                //                   Console.WriteLine($"There are still ghosts in the house. Do you want to leave? (y/n)");
//
//                   var answer = Console.ReadLine();
//                   if ((answer == "yes") || (answer == "y"))
//                   {
//                       Console.WriteLine("You are a coward.");
//                   }
//                   else if ((answer == "no") || (answer == "n"))
//                   {
//                       Console.WriteLine("Choose a different direction.");
//                   }
//               }

                Console.Clear();
                Logos.LogoGame();

                switch (direction)
                {
                case EDirection.North:
                    direction = EDirection.South;
                    break;

                case EDirection.East:
                    direction = EDirection.West;
                    break;

                case EDirection.South:
                    direction = EDirection.North;
                    break;

                case EDirection.West:
                    direction = EDirection.East;
                    break;

                case EDirection.Up:
                    direction = EDirection.Down;
                    break;

                case EDirection.Down:
                    direction = EDirection.Up;
                    break;

                default:
                    break;
                }

                Console.WriteLine($"-- You came from the {lastRoom.Name} from {direction} direction. --");
            }
            else
            {
                Console.WriteLine("You walked into a wall. Try again");
                Console.WriteLine();
            }
        }
コード例 #8
0
        private void Initialize()
        {
            Logos.LogoGame();

            SetPlayerName();
        }
コード例 #9
0
        private void SetEpisode(VM_AnimeEpisode_User ep)
        {
            if (ep == null)
            {
                return;
            }

            /*AniDB_AnimeVM anime = ep.AnimeSeries.AniDB_Anime;
             *
             *    Dictionary<int, TvDB_Episode> dictTvDBEpisodes = anime.DictTvDBEpisodes;
             *    Dictionary<int, int> dictTvDBSeasons = anime.DictTvDBSeasons;
             *    Dictionary<int, int> dictTvDBSeasonsSpecials = anime.DictTvDBSeasonsSpecials;
             *    CrossRef_AniDB_TvDBVM tvDBCrossRef = anime.CrossRefTvDB;
             *    ep.SetTvDBInfo(dictTvDBEpisodes, dictTvDBSeasons, dictTvDBSeasonsSpecials, tvDBCrossRef);*/


            clearGUIProperty("Watching.Series.Title");
            clearGUIProperty("Watching.Series.Description");
            clearGUIProperty("Watching.Series.LastWatched");
            clearGUIProperty("Watching.Series.EpisodesAvailable");
            clearGUIProperty("Watching.Episode.Title");
            clearGUIProperty("Watching.Episode.AirDate");
            clearGUIProperty("Watching.Episode.RunTime");
            clearGUIProperty("Watching.Episode.FileInfo");
            clearGUIProperty("Watching.Episode.Overview");
            clearGUIProperty("Watching.Episode.Image");
            clearGUIProperty("Watching.Episode.Logos");


            setGUIProperty("Watching.Series.Title", ep.AnimeSeries.SeriesName);
            setGUIProperty("Watching.Series.Description", ep.AnimeSeries.Description);
            setGUIProperty("Watching.Series.LastWatched", ep.AnimeSeries.WatchedDate.HasValue ? ep.AnimeSeries.WatchedDate.Value.ToString("dd MMM yy", Globals.Culture) : "-");
            setGUIProperty("Watching.Series.EpisodesAvailable", ep.AnimeSeries.UnwatchedEpisodeCount.ToString());

            setGUIProperty("Watching.Episode.Title", ep.EpisodeNumberAndNameWithType);
            setGUIProperty("Watching.Episode.AirDate", ep.AirDateAsString);
            setGUIProperty("Watching.Episode.RunTime", Utils.FormatSecondsToDisplayTime(ep.AniDB_LengthSeconds));


            setGUIProperty("Watching.Series.Poster", ImageAllocator.GetSeriesImageAsFileName(ep.AnimeSeries, GUIFacadeControl.Layout.List));

            if (ep.EpisodeImageLocation.Length > 0)
            {
                setGUIProperty("Watching.Episode.Image", ep.EpisodeImageLocation);
            }

            try
            {
                Fanart fanart = new Fanart(ep.AnimeSeries);
                if (!string.IsNullOrEmpty(fanart.FileName))
                {
                    setGUIProperty("Watching.Series.Fanart", fanart.FileName);
                }
                else
                {
                    setGUIProperty("Watching.Series.Fanart", "-");
                }
            }
            catch (Exception ex)
            {
                BaseConfig.MyAnimeLog.Write(ep.AnimeSeries.SeriesName + " - " + ex);
            }

            // Overview
            string overview = ep.EpisodeOverview;

            if (BaseConfig.Settings.HidePlot)
            {
                if (ep.EpisodeOverview.Trim().Length > 0 && ep.IsWatched())
                {
                    overview = "*** Hidden to prevent spoilers ***";
                }
            }
            setGUIProperty("Watching.Episode.Overview", overview);

            // File Info
            List <VM_VideoDetailed> filesForEpisode = VM_ShokoServer.Instance.ShokoServices.GetFilesForEpisode(ep.AnimeEpisodeID,
                                                                                                               VM_ShokoServer.Instance.CurrentUser.JMMUserID).CastList <VM_VideoDetailed>();


            string finfo = "";

            foreach (VM_VideoDetailed vid in filesForEpisode)
            {
                finfo = vid.FileSelectionDisplay;
            }

            if (filesForEpisode.Count > 1)
            {
                finfo = filesForEpisode.Count + " Files Available";
            }

            setGUIProperty("Watching.Episode.FileInfo", finfo);

            // Logos
            string logos = Logos.buildLogoImage(ep);

            BaseConfig.MyAnimeLog.Write(logos);
            setGUIProperty("Watching.Episode.Logos", logos);
        }
コード例 #10
0
        private void DisplayEpisode()
        {
            if (MainWindow.RandomWindow_CurrentEpisode == null)
            {
                SetGUIProperty(GuiProperty.Random_Status, Translation.NoMatchesFound);
                MainWindow.RandomWindow_MatchesFound   = 0;
                MainWindow.RandomWindow_CurrentSeries  = null;
                MainWindow.RandomWindow_CurrentEpisode = null;
            }
            else
            {
                SetGUIProperty(GuiProperty.Random_Series_Description, MainWindow.RandomWindow_CurrentSeries.Description);
                SetGUIProperty(GuiProperty.Random_Series_Title, MainWindow.RandomWindow_CurrentSeries.SeriesName);
                SetGUIProperty(GuiProperty.Random_Series_LastWatched, MainWindow.RandomWindow_CurrentSeries.WatchedDate.HasValue ? MainWindow.RandomWindow_CurrentSeries.WatchedDate.Value.ToString("dd MMM yy", Globals.Culture) : "-");
                SetGUIProperty(GuiProperty.Random_Series_EpisodesWatched, MainWindow.RandomWindow_CurrentSeries.WatchedEpisodeCount.ToString(Globals.Culture));
                SetGUIProperty(GuiProperty.Random_Series_EpisodesUnwatched, MainWindow.RandomWindow_CurrentSeries.UnwatchedEpisodeCount.ToString(Globals.Culture));
                SetGUIProperty(GuiProperty.Random_Series_Poster, ImageAllocator.GetSeriesImageAsFileName(MainWindow.RandomWindow_CurrentSeries, GUIFacadeControl.Layout.List));

                SetGUIProperty(GuiProperty.Random_Episode_Title, MainWindow.RandomWindow_CurrentEpisode.EpisodeNumberAndNameWithType);
                SetGUIProperty(GuiProperty.Random_Episode_AirDate, MainWindow.RandomWindow_CurrentEpisode.AirDateAsString);
                SetGUIProperty(GuiProperty.Random_Episode_RunTime, Utils.FormatSecondsToDisplayTime(MainWindow.RandomWindow_CurrentEpisode.AniDB_LengthSeconds));


                if (MainWindow.RandomWindow_CurrentEpisode.EpisodeImageLocation.Length > 0)
                {
                    SetGUIProperty(GuiProperty.Random_Episode_Image, MainWindow.RandomWindow_CurrentEpisode.EpisodeImageLocation);
                }
                else
                {
                    ClearGUIProperty(GuiProperty.Random_Episode_Image);
                }

                // Overview
                string overview = MainWindow.RandomWindow_CurrentEpisode.EpisodeOverview;
                if (BaseConfig.Settings.HidePlot)
                {
                    if (MainWindow.RandomWindow_CurrentEpisode.EpisodeOverview.Trim().Length > 0 &&
                        !MainWindow.RandomWindow_CurrentEpisode.IsWatched())
                    {
                        overview = "*** " + Translation.HiddenToPreventSpoiles + " ***";
                    }
                    SetGUIProperty(GuiProperty.Random_Episode_Overview, overview);
                }

                // File Info
                List <VM_VideoDetailed> filesForEpisode =
                    VM_ShokoServer.Instance.ShokoServices.GetFilesForEpisode(
                        MainWindow.RandomWindow_CurrentEpisode.AnimeEpisodeID,
                        VM_ShokoServer.Instance.CurrentUser.JMMUserID).CastList <VM_VideoDetailed>();


                string finfo = "";
                foreach (VM_VideoDetailed vid in filesForEpisode)
                {
                    finfo = vid.FileSelectionDisplay;
                }

                if (filesForEpisode.Count > 1)
                {
                    finfo = filesForEpisode.Count.ToString(Globals.Culture) + " " + Translation.FilesAvailable;
                }

                SetGUIProperty(GuiProperty.Random_Episode_FileInfo, finfo);
                // Logos
                string logos = Logos.buildLogoImage(MainWindow.RandomWindow_CurrentEpisode);

                BaseConfig.MyAnimeLog.Write(logos);
                SetGUIProperty(GuiProperty.Random_Episode_Logos, logos);

                dummyNoData.Visible = false;
            }
        }
コード例 #11
0
        private void DisplayEpisode()
        {
            clearGUIProperty("Series.Title");
            clearGUIProperty("Series.Description");
            clearGUIProperty("Series.LastWatched");
            clearGUIProperty("Series.EpisodesWatched");
            clearGUIProperty("Series.EpisodesUnwatched");
            clearGUIProperty("Series.Poster");

            clearGUIProperty("NumberOfMatches");

            clearGUIProperty("Episode.Title");
            clearGUIProperty("Episode.AirDate");
            clearGUIProperty("Episode.RunTime");
            clearGUIProperty("Episode.FileInfo");
            clearGUIProperty("Episode.Overview");
            clearGUIProperty("Episode.Image");
            clearGUIProperty("Episode.Logos");

            if (MainWindow.RandomWindow_CurrentEpisode == null)
            {
                setGUIProperty("Status", "No Matches Found");
                MainWindow.RandomWindow_MatchesFound   = 0;
                MainWindow.RandomWindow_CurrentSeries  = null;
                MainWindow.RandomWindow_CurrentEpisode = null;
            }
            else
            {
                setGUIProperty("Series.Title", MainWindow.RandomWindow_CurrentSeries.SeriesName);
                setGUIProperty("Series.Description", MainWindow.RandomWindow_CurrentSeries.Description);
                setGUIProperty("Series.LastWatched", MainWindow.RandomWindow_CurrentSeries.WatchedDate.HasValue ? MainWindow.RandomWindow_CurrentSeries.WatchedDate.Value.ToString("dd MMM yy", Globals.Culture) : "-");
                setGUIProperty("Series.EpisodesWatched", MainWindow.RandomWindow_CurrentSeries.WatchedEpisodeCount.ToString());
                setGUIProperty("Series.EpisodesUnwatched", MainWindow.RandomWindow_CurrentSeries.UnwatchedEpisodeCount.ToString());
                setGUIProperty("Series.Poster", ImageAllocator.GetSeriesImageAsFileName(MainWindow.RandomWindow_CurrentSeries, GUIFacadeControl.Layout.List));

                setGUIProperty("Episode.Title", MainWindow.RandomWindow_CurrentEpisode.EpisodeNumberAndNameWithType);
                setGUIProperty("Episode.AirDate", MainWindow.RandomWindow_CurrentEpisode.AirDateAsString);
                setGUIProperty("Episode.RunTime", Utils.FormatSecondsToDisplayTime(MainWindow.RandomWindow_CurrentEpisode.AniDB_LengthSeconds));


                if (MainWindow.RandomWindow_CurrentEpisode.EpisodeImageLocation.Length > 0)
                {
                    setGUIProperty("Episode.Image", MainWindow.RandomWindow_CurrentEpisode.EpisodeImageLocation);
                }

                // Overview
                string overview = MainWindow.RandomWindow_CurrentEpisode.EpisodeOverview;
                if (BaseConfig.Settings.HidePlot)
                {
                    if (MainWindow.RandomWindow_CurrentEpisode.EpisodeOverview.Trim().Length > 0 && MainWindow.RandomWindow_CurrentEpisode.IsWatched == 0)
                    {
                        overview = "*** Hidden to prevent spoilers ***";
                    }
                }
                setGUIProperty("Episode.Overview", overview);

                // File Info
                List <VideoDetailedVM> filesForEpisode = new List <VideoDetailedVM>();
                List <JMMServerBinary.Contract_VideoDetailed> contracts = JMMServerVM.Instance.clientBinaryHTTP.GetFilesForEpisode(MainWindow.RandomWindow_CurrentEpisode.AnimeEpisodeID,
                                                                                                                                   JMMServerVM.Instance.CurrentUser.JMMUserID);

                foreach (JMMServerBinary.Contract_VideoDetailed fi in contracts)
                {
                    filesForEpisode.Add(new VideoDetailedVM(fi));
                }

                string finfo = "";
                foreach (VideoDetailedVM vid in filesForEpisode)
                {
                    finfo = vid.FileSelectionDisplay;
                }

                if (filesForEpisode.Count > 1)
                {
                    finfo = filesForEpisode.Count.ToString() + " Files Available";
                }

                setGUIProperty("Episode.FileInfo", finfo);

                // Logos
                string logos = Logos.buildLogoImage(MainWindow.RandomWindow_CurrentEpisode);

                BaseConfig.MyAnimeLog.Write(logos);
                setGUIProperty("Episode.Logos", logos);

                dummyNoData.Visible = false;
            }
        }
コード例 #12
0
        public static void Main()
        {
            var    done = false;
            string answerExit;
            var    game = new Game();


            game.InitializeAndStartGame();

            while (!done)
            {
                game.DescribeLocation();

                if (game.ShouldEnd())
                {
                    break;
                }

                Logos.PrintLambda();

                var    input = Console.ReadLine();
                string args  = "";
                if (input.Contains(" "))
                {
                    var splitted = input.Split(" ");
                    input = splitted[0];
                    args  = splitted[1];
                }

                switch (input.ToLower())
                {
                case "pick":
                {
                    PlayerCommands.PickUp();
                    break;
                }

                case "status":
                {
                    PlayerCommands.PrintStatus();
                    break;
                }

                case "inventory":
                {
                    PlayerCommands.PrintInventory();
                    break;
                }

                case "view":
                {
                    EViewCommands view;
                    PlayerCommands.PrintNotValidView();
                    break;
                }

                case "move":
                {
                    EDirection direction;
                    if (Enum.TryParse <EDirection>(args, true, out direction))
                    {
                        game.MoveToDirection(direction);
                    }
                    else
                    {
                        PlayerCommands.PrintNotValidDirection();
                    }
                    break;
                }

                case "look":
                {
                    game.LookAround();
                    break;
                }

                case "help":
                {
                    PlayerCommands.PrintHelp();
                    break;
                }

                case "exit":
                {
                    Console.WriteLine("Are you sure you want to quit? (y/n)");
                    Logos.PrintLambda();
                    answerExit = Console.ReadLine();
                    //TODO; set anserExit to lowercase
                    if ((answerExit == "yes") || (answerExit == "y"))
                    {
                        done = true;
                    }
                    else if ((answerExit == "no") || (answerExit == "n"))
                    {
                        Console.WriteLine("Oke, lets continue");
                    }
                    else
                    {
                        Console.WriteLine("Not a valid answer. You will continue HAHA.");
                    }
                    break;
                }

                default:
                {
                    PlayerCommands.PrintCommandNotFound();
                    PlayerCommands.PrintHelp();
                    break;
                }
                }
            }

            game.End();

            Console.WriteLine("<press any key to exit>");
            Console.ReadKey();
        }