예제 #1
0
 public ChunkTracker(int sx, int sy)
 {
     SX     = sx;
     SY     = sy;
     mapGen = new MapDataGenerator(SX, SY);
     Map    = mapGen.map;
 }
예제 #2
0
        /// <summary>
        /// Creates maps based on surface results. The maps can be displayed in the documentation.
        /// </summary>
        /// <param name="element">Revit element for which result document is built</param>
        /// <param name="resultsInPoints">Result in point collection</param>
        /// <param name="resultTypes">The type of results, values and description that can be displayed on the maps.</param>
        /// <returns>Returns list of documets maps based on results that can be displayed in the documentation</returns>
        private List <DocumentMap> CreateResultMapSeriesForSurfaceElements(Element element, ICollection <ResultInPointSurface> resultsInPoints, IEnumerable <Tuple <ResultTypeSurface, string> > resultTypes)
        {
            List <DocumentMap> vDocMap   = new List <DocumentMap>();
            MapDataGenerator   mapPoints = new MapDataGenerator();

            foreach (Tuple <ResultTypeSurface, string> forceDesc in resultTypes)
            {
                List <double> resData = resultsInPoints.Select(s => s[forceDesc.Item1]).ToList();
                if (resData.Max(s => (Math.Abs(s))) < 1.0e-8)
                {
                    continue;
                }
                AnalyticalModel slab        = element as AnalyticalModel;
                DisplayUnit     displayUnit = DisplayUnit.IMPERIAL;
                if (Server.UnitSystem == Autodesk.Revit.DB.ResultsBuilder.UnitsSystem.Metric)
                {
                    displayUnit = DisplayUnit.METRIC;
                }
                ElementAnalyser elementAnalyser = new ElementAnalyser(displayUnit);
                ElementInfo     info            = elementAnalyser.Analyse(element);
                XYZ             xyz             = new XYZ();
                if (info != null)
                {
                    foreach (ResultInPointSurface resInPt in resultsInPoints)
                    {
                        mapPoints.AddPoint(new XYZ(resInPt[ResultTypeSurface.X], resInPt[ResultTypeSurface.Y], resInPt[ResultTypeSurface.Z]), resInPt[forceDesc.Item1]);
                    }
                    var contourAndHoles = getContourAndHolePoints(info);
                    contourAndHoles.Item1.ForEach(s => mapPoints.AddPointToContour(s));
                    contourAndHoles.Item2.ForEach(s => mapPoints.AddHole(s));
                    UnitType    ut     = forceDesc.Item1.GetUnitType();
                    DocumentMap docMap = new DocumentMap(ut, UnitsConverter.GetInternalUnit(ut));
                    docMap.Title = forceDesc.Item2;
                    int nofPoints = mapPoints.Count;
                    for (int ptId = 0; ptId < nofPoints; ptId++)
                    {
                        UV pt = mapPoints.GetPoint(ptId);
                        docMap.AddPoint(pt.U, pt.V, mapPoints.GetValue(ptId));
                    }
                    List <List <int> > holes = mapPoints.Holes;
                    foreach (List <int> hole in holes)
                    {
                        docMap.AddHole(hole);
                    }
                    docMap.DefineContour(mapPoints.Contour);
                    vDocMap.Add(docMap);
                }
                mapPoints.Clear();
            }
            return(vDocMap);
        }
    void Start()
    {
        player           = GameObject.Find("Player");
        currentTargetIdx = 0;
        moveTimer        = 0f;

        mapDataGenerator       = GameObject.Find("MapManager").GetComponent <MapDataGenerator>();
        costMap                = new int[MapDataGenerator.MAX_MAP_WIDTH, MapDataGenerator.MAX_MAP_LENGTH];
        playerState            = GameObject.FindWithTag("Player").GetComponent <PlayerState>();
        enemyState             = GetComponent <EnemyState>();
        enemyState.enemyFacing = EnemyState.EnemyFacing.UP;

        meshRenderer = transform.GetChild(0).GetComponent <MeshRenderer>();
    }
예제 #4
0
        private void GenerateData()
        {
            MapDataGenerator mapDataGenerator = new MapDataGenerator(sizeX, sizeY, maxHeight, generatorFrequency);

            _tileMapData = mapDataGenerator.GenerateMapData();
        }
예제 #5
0
파일: Program.cs 프로젝트: tuita520/RaidBot
 private static void GenerateD2p(string path)
 {
     mMapsGenerator = new MapDataGenerator(path);
     mMapsGenerator.Generate();
     mMapsGenerator.Stats.PropertyChanged += ActualizeInterface;
 }