public void ERBridgeEqualTest()
        {
            ProgressionMap map = new ProgressionMap("Local Sector");
            LocalSectorMap c   = new LocalSectorMap(map);

            c.CreateLocalSector();

            ERBridge bridge1 = map.Bridges.Values.First();

            StarSystem system1 = map.Get <StarSystem>(bridge1.Portals[0].StarIdentifier);
            StarSystem system2 = map.Get <StarSystem>(bridge1.Portals[1].StarIdentifier);
            ERBridge   bridge2 = new ERBridge(bridge1.BridgeType, system1, system2);

            // ok force them equal because of identifiers lol
            bridge2.ParentIdentifier = bridge1.ParentIdentifier;
            bridge2.Identifier       = bridge1.Identifier;
            bridge2.Portals[0].ERBridgeIdentifier = bridge1.Portals[0].ERBridgeIdentifier;
            bridge2.Portals[1].ERBridgeIdentifier = bridge1.Portals[1].ERBridgeIdentifier;

            if (bridge1.BasicProperties.ContainsKey(Constants.PropertyNames.Distance))
            {
                bridge2.BasicProperties.Add(Constants.PropertyNames.Distance, bridge1.BasicProperties[Constants.PropertyNames.Distance]);
            }

            Assert.IsTrue(ERBridgeEqualityComparer.Comparer.Equals(bridge1, bridge2));
        }
        public void ERBridgeNotEqualTest()
        {
            ProgressionMap map = new ProgressionMap("Local Sector");
            LocalSectorMap c   = new LocalSectorMap(map);

            c.CreateLocalSector();

            ERBridge bridge1 = map.Bridges.Values.First();

            StarSystem system1 = map.Get <StarSystem>(bridge1.Portals[0].StarIdentifier);
            StarSystem system2 = map.Get <StarSystem>(bridge1.Portals[1].StarIdentifier);
            ERBridge   bridge2 = new ERBridge(bridge1.BridgeType, system1, system2);

            // ok force them equal because of identifiers lol
            bridge2.ParentIdentifier = bridge1.ParentIdentifier;
            bridge2.Identifier       = bridge1.Identifier;
            bridge2.Portals[0].ERBridgeIdentifier = bridge1.Portals[0].ERBridgeIdentifier;
            // except Portal 2 bridge identifier
            //bridge2.Portals[1].ERBridgeIdentifier = bridge1.Portals[1].ERBridgeIdentifier;

            Assert.IsFalse(ERBridgeEqualityComparer.Comparer.Equals(bridge1, bridge2));
        }
示例#3
0
        public Cluster CreateSolCluster()
        {
            Cluster solCluster = new Cluster("Sol Cluster");

            Map.Add(solCluster);

            StarSystem      system = null;
            ProgressionStar star   = null;
            IDictionary <string, string> catalogue = null;

            system = CreateSolSystem();
            solCluster.Add(system);

            #region Bernard's Star
            system = new StarSystem("Bernard");
            system.BasicProperties.Add(Constants.PropertyNames.Designation, "Gl 699");
            system.BasicProperties.Add(Constants.PropertyNames.Position, new Point3d(1.5, 0.9, 0.4).ToString());
            Map.Add(system);
            star = new ProgressionStar("Bernard's Star");
            star.BasicProperties.Add(Constants.PropertyNames.Designation, "Gl 699");
            star.BasicProperties.Add(Constants.PropertyNames.StellarClass, "sdM4");
            catalogue = new Dictionary <string, string>();
            catalogue.Add("HabHyg", "4");
            catalogue.Add("Hip", "87937");
            star.Properties.AddGroup("Catalogue", catalogue);
            system.Add(star);
            solCluster.Add(system);
            #endregion

            #region Epsilon Eridani
            system = new StarSystem("Epsilon Eridani");
            system.BasicProperties.Add(Constants.PropertyNames.Designation, "Gl 144");
            system.BasicProperties.Add(Constants.PropertyNames.Position, new Point3d(-2.1, -0.6, -2.4).ToString());
            Map.Add(system);
            star = new ProgressionStar("Epsilon Eridani");
            star.BasicProperties.Add(Constants.PropertyNames.Designation, "Gl 144");
            star.BasicProperties.Add(Constants.PropertyNames.StellarClass, "K2V");
            catalogue = new Dictionary <string, string>();
            catalogue.Add("HabHyg", "13");
            catalogue.Add("Hip", "16537");
            star.Properties.AddGroup("Catalogue", catalogue);
            system.Add(star);
            solCluster.Add(system);
            #endregion

            #region Procyon
            system = new StarSystem("Procyon");
            system.BasicProperties.Add(Constants.PropertyNames.Designation, "Gl 280");
            system.BasicProperties.Add(Constants.PropertyNames.Position, new Point3d(-2.8, -1.9, 0.8).ToString());
            Map.Add(system);
            star = new ProgressionStar("Procyon");
            star.BasicProperties.Add(Constants.PropertyNames.Designation, "Gl 280");
            star.BasicProperties.Add(Constants.PropertyNames.StellarClass, "F5IV-V");
            catalogue = new Dictionary <string, string>();
            catalogue.Add("HabHyg", "18");
            catalogue.Add("Hip", "37279");
            star.Properties.AddGroup("Catalogue", catalogue);
            system.Add(star);
            solCluster.Add(system);
            #endregion

            #region Ross
            system = new StarSystem("Ross");
            system.BasicProperties.Add(Constants.PropertyNames.Designation, "Gl 447");
            system.BasicProperties.Add(Constants.PropertyNames.Position, new Point3d(0, -1.7, 2.9).ToString());
            Map.Add(system);
            star = new ProgressionStar("Pocks");
            star.BasicProperties.Add(Constants.PropertyNames.Designation, "Gl 447/Ross 128");
            star.BasicProperties.Add(Constants.PropertyNames.StellarClass, "M4.5V");
            catalogue = new Dictionary <string, string>();
            catalogue.Add("HabHyg", "14");
            catalogue.Add("Hip", "57548");
            star.Properties.AddGroup("Catalogue", catalogue);
            system.Add(star);
            solCluster.Add(system);
            #endregion

            #region Ceti
            system = new StarSystem("Ceti");
            system.BasicProperties.Add(Constants.PropertyNames.Designation, "Gl 65");
            system.BasicProperties.Add(Constants.PropertyNames.Position, new Point3d(-0.6, 0.1, -2.5).ToString());
            Map.Add(system);
            star = new ProgressionStar("BL");
            star.BasicProperties.Add(Constants.PropertyNames.Designation, "Gl 65 A");
            star.BasicProperties.Add(Constants.PropertyNames.StellarClass, "dM5.5V");
            catalogue = new Dictionary <string, string>();
            catalogue.Add("HabHyg", "7");
            catalogue.Add("Hip", "-1");
            star.Properties.AddGroup("Catalogue", catalogue);
            system.Add(star);
            star = new ProgressionStar("UV");
            star.BasicProperties.Add(Constants.PropertyNames.Designation, "Gl 65 B");
            star.BasicProperties.Add(Constants.PropertyNames.StellarClass, "dM5.5V");
            catalogue = new Dictionary <string, string>();
            catalogue.Add("HabHyg", "7");
            catalogue.Add("Hip", "-1");
            star.Properties.AddGroup("Catalogue", catalogue);
            system.Add(star);
            solCluster.Add(system);
            #endregion

            #region Bridges
            // Add Bridges
            ERBridge bridge = ERBridgeHelper.CreateStarSystemBridge(Map, solCluster, "Sol", "Bernard");
            solCluster.Add(bridge);
            bridge = ERBridgeHelper.CreateStarSystemBridge(Map, solCluster, "Sol", "Epsilon Eridani");
            solCluster.Add(bridge);
            bridge = ERBridgeHelper.CreateStarSystemBridge(Map, solCluster, "Sol", "Procyon");
            solCluster.Add(bridge);
            bridge = ERBridgeHelper.CreateStarSystemBridge(Map, solCluster, "Bernard", "Ross");
            solCluster.Add(bridge);
            bridge = ERBridgeHelper.CreateStarSystemBridge(Map, solCluster, "Procyon", "Ceti");
            solCluster.Add(bridge);
            #endregion

            return(solCluster);
        }