Пример #1
0
 private bool shouldTeachLocation()
 {
     if (mySceneCatalogue.getKnownLocations().Count - 4 < myVictoryCoach.getNumberOfAchievedExperiences())
     {
         return(true);
     }
     return(false);
 }
Пример #2
0
    public void disburseCharacters(List <Character> charactersToInclude = default(List <Character>), List <string> characterNamesToExclude = default(List <string>))
    {
        System.Random   random         = new System.Random();
        List <Location> knownLocations = mySceneCatalogue.getKnownLocations();

        foreach (Character chara in charactersToInclude)
        {
            if (characterNamesToExclude != null && characterNamesToExclude.Contains(chara.givenName.ToLower()))
            {
                continue;
            }

            for (int i = 0; i < 3; i++)
            {
                string destination;
                bool   indoorDestination;
                bool   toBeActive;

                while (true)
                {
                    destination       = knownLocations[random.Next(knownLocations.Count)].locationName;
                    indoorDestination = random.Next(2) == 0 ? false : true;
                    toBeActive        = random.Next(2) == 0 ? false : true;

                    if ((destination == "Residential District" && indoorDestination == true))
                    {
                        continue;
                    }
                    else
                    {
                        chara.locations[i].locationName = destination;
                        chara.locations[i].isInside     = indoorDestination;
                        chara.locations[i].isActive     = toBeActive;
                        break;
                    }
                }
            }
        }
    }