Exemple #1
0
 /*
  * @name    ShowPlayer, ShowCP1, ShowCP2, ShowCP3, S
  * @purpose disables and all canvases and shows the correct one based off of wich method
  *
  * @return  Void
  */
 //shows person player
 public void ShowPlayer()
 {
     ShowNone();
     PersonCG.alpha          = 1f;
     PersonCG.blocksRaycasts = true;
     PersonCG.interactable   = true;
     ShowPerson.SetActive(true);
 }
Exemple #2
0
    //will show none
    public void ShowNone() //disables all canvases
    {
        //disables person
        PersonCG.alpha          = 0f;
        PersonCG.blocksRaycasts = false;
        PersonCG.interactable   = false;
        ShowPerson.SetActive(false);

        //disables CP1
        Cp1CG.alpha          = 0f;
        Cp1CG.blocksRaycasts = false;
        Cp1CG.interactable   = false;
        ShowCP11.SetActive(false);

        //disables cp2
        Cp2CG.alpha          = 0f;
        Cp2CG.blocksRaycasts = false;
        Cp2CG.interactable   = false;
        ShowCP21.SetActive(false);

        //disables cp3
        Cp3CG.alpha          = 0f;
        Cp3CG.blocksRaycasts = false;
        Cp3CG.interactable   = false;
        ShowCP31.SetActive(false);

        //disables pause
        PauseCG.alpha          = 0f;
        PauseCG.blocksRaycasts = false;
        PauseCG.interactable   = false;
        ShowPause1.SetActive(false);

        //disables deck discard
        ShowDeckDiscardCG.alpha          = 0f;
        ShowDeckDiscardCG.blocksRaycasts = false;
        ShowDeckDiscardCG.interactable   = false;
        ShowDeckDiscard1.SetActive(false);

        //disables card info panel
        CardInfoPanelCG.alpha          = 0f;
        CardInfoPanelCG.blocksRaycasts = false;
        CardInfoPanelCG.interactable   = false;
        ShowCardInfoPanel.SetActive(false);

        //disables acidic waters
        AcidicWatersCG.alpha          = 0f;
        AcidicWatersCG.blocksRaycasts = false;
        AcidicWatersCG.interactable   = false;
        ShowAcidicWaters1.SetActive(false);

        //disables learn to play
        LearnToPlayCG.alpha          = 0f;
        LearnToPlayCG.blocksRaycasts = false;
        LearnToPlayCG.interactable   = false;
        ShowLearnToPlay1.SetActive(false);
    }
Exemple #3
0
        public virtual async Task ScrapeData()
        {
            Console.WriteLine("Started TvMazeScrape job");

            var latestShowId = ShowsRepository.GetLatestAddedShowId();
            int nextPage     = 0;

            if (latestShowId > 0)
            {
                decimal pageNr = latestShowId / 250;
                nextPage = (int)Math.Floor(pageNr);
            }

            var shows = await TvMazeApi.GetShows(nextPage);

            Console.WriteLine("Loaded 250 shows");

            foreach (var show in shows)
            {
                var existingShow = DbContext.Shows.Where(s => s.ShowId.Equals(show.Id)).FirstOrDefault();
                if (existingShow != null)
                {
                    continue;
                }

                var castResponse = await TvMazeApi.GetCastMembers((int)show.Id);

                Console.WriteLine("Received cast for show");

                var newShow = new Show()
                {
                    ShowId = (int)show.Id,
                    Name   = show.Name
                };

                await ShowsRepository.AddShow(newShow);

                HashSet <long> AddedPersons = new HashSet <long>();

                foreach (var castMember in castResponse)
                {
                    // Some shows contain dubplicates
                    if (AddedPersons.Contains(castMember.Person.Id))
                    {
                        continue;
                    }

                    var person = PersonRepository.CreateOrGet(new Person()
                    {
                        PersonId = (int)castMember.Person.Id,
                        Name     = castMember.Person.Name,
                        Birthday = castMember.Person.Birthday?.DateTime ?? new DateTime(1970, 1, 1)
                    });

                    var showPerson = new ShowPerson()
                    {
                        PersonId = person.PersonId,
                        ShowId   = newShow.ShowId
                    };
                    Console.WriteLine($"ShowId {newShow.ShowId}, PersonId {person.PersonId}");
                    DbContext.ShowPersons.Add(showPerson);
                    AddedPersons.Add(castMember.Person.Id);
                }
                DbContext.SaveChanges();

                Console.WriteLine($"Added show {newShow.Name}");

                System.Threading.Thread.Sleep(1000);
            }
        }