Example #1
0
        public void DiscoveryModel_ParseFromString()
        {
            dm = new DiscoveryModel(validStrings[2].Item1, dc.ParseToString());

            HashSet <int> disc = dm.GetDiscovered();

            Assert.AreEqual(8, disc.Count, "Should contain 8 elements");
            for (int i = 1; i < 9; i++)
            {
                Assert.IsTrue(disc.Contains(i), i + "should be discovered");
            }
            Assert.AreEqual(dm.GetDiscoveryCatalogue().ParseToString(), dc.ParseToString(), "Catalgoues should be equal");
        }
Example #2
0
        public List <Discovery.Discovery> GetDiscovered(GameState gs)
        {
            DiscoveryModel             dm         = gs.GetDM();
            HashSet <int>              discovered = dm.GetDiscovered();
            List <Discovery.Discovery> discs      = new List <Discovery.Discovery>();

            foreach (int disc in discovered)
            {
                var d = dm.GetDiscoveryCatalogue().GetDiscovery(disc);
                if (d != null)
                {
                    discs.Add(d);
                }
            }
            return(discs);
        }