示例#1
0
        public MapCell(Terrain terrain)
        {
            Continent = null;
            _pt.X = 0;
            _pt.Y = 0;
            _terrain = terrain;
            _improvements = new List<Improvement>();

            _spotted = new BitArray(MaxPlayerId, false);
            _discovered = new BitArray(MaxPlayerId, false);
        }
示例#2
0
        public static void TestRiverFlowsNorthAndSouth()
        {
            Terrain terrain = new Terrain();
            MapCell d1 = new MapCell(terrain);

            d1.SetWOfRiver(true, FlowDirectionType.North);
            d1.SetWOfRiver(true, FlowDirectionType.South);

            Assert.IsFalse(d1.IsNEOfRiver, "Should be no river NE");
            Assert.IsFalse(d1.IsNWOfRiver, "Should be no river NW");
            Assert.IsTrue(d1.IsWOfRiver, "Should be river W");
            Assert.AreEqual("000011", d1.FlowString, "FlowString should be 000011");
        }
示例#3
0
        public static void TestRiverFlowSouthEast()
        {
            Terrain terrain = new Terrain();
            MapCell d1 = new MapCell(terrain);

            d1.SetNEOfRiver(true, FlowDirectionType.SouthEast);

            Assert.IsTrue(d1.IsNEOfRiver, "Should be river NE");
            Assert.IsFalse(d1.IsNWOfRiver, "Should be no river NW");
            Assert.IsFalse(d1.IsWOfRiver, "Should be no river W");
        }
示例#4
0
        public static void TestNoRiver()
        {
            Terrain terrain = new Terrain();
            MapCell d1 = new MapCell(terrain);
            d1.River = 0;

            Assert.IsFalse(d1.IsNEOfRiver, "Should be no river NE");
            Assert.IsFalse(d1.IsNWOfRiver, "Should be no river NW");
            Assert.IsFalse(d1.IsWOfRiver, "Should be no river W");
            Assert.AreEqual("000000", d1.FlowString, "FlowString should be 000000");
        }