Exemplo n.º 1
0
        public static LibraryOfIncidents LoadDefaultLibraryFromFile()
        {
            if (false == Directory.Exists(save_file_path)) //if folder does not exist, create it and save files manually
            {
                Directory.CreateDirectory(save_file_path);
                GenerateFilesForDefaultLibrary();
            }

            var collectionNames = new List <string>();

            collectionNames.Add("CharacterDevelopment.xml");
            collectionNames.Add("Generic.xml");
            collectionNames.Add("Action.xml");
            collectionNames.Add("Survival.xml");

            var theLibrary = new LibraryOfIncidents();

            foreach (string name in collectionNames)
            {
                var path          = save_file_path + name;
                var theCollection = CollectionOfIncidentTemplates.LoadFromFile(path);
                theLibrary.AllCollections.Add(theCollection);
            }

            return(theLibrary);
        }
Exemplo n.º 2
0
        public Plot GenerateNewPlot(LibraryOfIncidents givenPossibleIncidents, SocietySnapshot startingCast = null, int?maxIncidentCount = null)
        {
            Random rng = new Random();

            this.possibleIncidents = givenPossibleIncidents;

            currentCast = startingCast != null ? startingCast : GetStartingCast(rng);
            int maxIncidents = maxIncidentCount != null ? maxIncidentCount.Value : MAX_INCIDENT_COUNT;

            plotInProgress = new Plot(currentCast);

            CreateSequenceOfEvents(maxIncidents, rng);

            return(plotInProgress);
        }
 public void TestInitialize()
 {
     theLibrary = new LibraryOfIncidents();
     throw new NotImplementedException();
 }