Beispiel #1
0
    public void Triangulate()
    {
        // clear old data
        terrain.Clear();
        rivers.Clear();
        roads.Clear();
        water.Clear();
        waterShore.Clear();
        estuaries.Clear();
        features.Clear();
        // triangulate cells
        for (int i = 0; i < cells.Length; ++i)
        {
            Triangulate(cells[i]);
        }

        //reset mesh
        terrain.Apply();
        rivers.Apply();
        roads.Apply();
        water.Apply();
        waterShore.Apply();
        estuaries.Apply();
        features.Apply();
    }
Beispiel #2
0
    public void TriangulateAllCells()
    {
        // This method could be invoked at any time, even when cells have already been triangulated earlier.
        // So we should begin by clearing the old data.
        Terrain.Clear();
        Rivers.Clear();
        Roads.Clear();
        Water.Clear();
        WaterShore.Clear();
        Estuaries.Clear();
        Features.Clear();

        for (int i = 0; i < _cells.Length; i++)
        {
            Precalculation(_cells[i]);
        }

        for (int i = 0; i < _cells.Length; i++)
        {
            TriangulateCell(_cells[i]);
            AddFeatures(_cells[i]);
        }

        Terrain.Apply();
        Rivers.Apply();
        Roads.Apply();
        Water.Apply();
        WaterShore.Apply();
        Estuaries.Apply();
        Features.Apply();
    }
Beispiel #3
0
        public void Clear_TwoFeatures_ReturnsZero()
        {
            // arrange
            FeatureManager featureManager = new FeatureManager();

            featureManager.Add(new Feature <int>("F1"));
            featureManager.Add(new Feature <double>("F2"));

            // act
            featureManager.Clear();
            int qty = featureManager.Count();

            // assert
            Assert.AreEqual(0, qty);
        }
Beispiel #4
0
 public void Triangulate()
 {
     terrain.Clear();
     rivers.Clear();
     roads.Clear();
     water.Clear();
     waterShore.Clear();
     estuaries.Clear();
     features.Clear();
     politicalBorders.Clear();
     for (int i = 0; i < cells.Length; i++)
     {
         Triangulate(cells[i]);
     }
     terrain.Apply();
     rivers.Apply();
     roads.Apply();
     water.Apply();
     waterShore.Apply();
     estuaries.Apply();
     features.Apply();
     politicalBorders.Apply();
 }