/// <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); } } }
/// <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)); }
/// <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); }
public DiscoveryModel() { discovered = new HashSet <int>(); dc = new DiscoveryCatalogue(); }