Example #1
0
 public DiscoveryCatalogue(String toParse)
 {
     discoveries = new SortedList <int, Discovery>();
     String[] cataElements = toParse.Split('#');
     for (int i = 1; i < cataElements.Length; i++)
     {
         Discovery temp = new Discovery(cataElements[i]);
         discoveries.Add(temp.GetDiscoveryID(), temp);
     }
 }
Example #2
0
        /// <summary>
        /// Gets a new discovery
        /// </summary>
        /// <param name="numOfVisited">Number of visited locations</param>
        /// <returns>Discovery text if one is found (ie not previously found and requirements met)</returns>
        public String GetNewDiscovery(int numOfVisited)
        {
            Discovery disc = dc.GetRandomDiscovery();

            if (discovered.Count == 0)
            {
                disc = dc.GetDiscovery(1);
            }
            if (discovered.Contains(disc.GetDiscoveryID()) || !disc.IsDiscoverable(numOfVisited))
            {
                return("");
            }

            discovered.Add(disc.GetDiscoveryID());
            return(disc.GetDiscoveryText());
        }