Beispiel #1
0
        /// <summary>
        /// Constructor for loading from save game
        /// </summary>
        /// <param name="discovered">Discovered string</param>
        /// <param name="catalogue">Discovery catalogue string</param>
        public DiscoveryModel(String discovered, String catalogue)
        {
            this.discovered = new HashSet <int>();
            dc = new DiscoveryCatalogue(catalogue);

            String[] discoveredElems = discovered.Split(':');
            for (int i = 1; i < discoveredElems.Length; i++)
            {
                int id;
                if (int.TryParse(discoveredElems[i], out id))
                {
                    this.discovered.Add(id);
                }
            }
        }
Beispiel #2
0
 /// <summary>
 /// Checks if a string is a valid discovery catalogue
 /// </summary>
 /// <param name="toTest">String to check</param>
 /// <returns>If it is valid or not</returns>
 public static bool IsValidDiscoveryCatalogue(String toTest)
 {
     return(DiscoveryCatalogue.IsValidDiscoveryCatalogue(toTest));
 }
Beispiel #3
0
 /// <summary>
 /// Constructor for new game
 /// </summary>
 /// <param name="catalogue">Discovery Catalogue string</param>
 public DiscoveryModel(String catalogue)
 {
     discovered = new HashSet <int>();
     dc         = new DiscoveryCatalogue(catalogue);
 }
Beispiel #4
0
 public DiscoveryModel()
 {
     discovered = new HashSet <int>();
     dc         = new DiscoveryCatalogue();
 }