Advertisement
443eb9

Untitled

Sep 10th, 2023
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.63 KB | None | 0 0
  1. using HexagonSurvive.Map.Properties;
  2. using HexagonSurvive.Map.Settings;
  3. using Unity.Collections;
  4. using Unity.Entities;
  5. using Unity.Mathematics;
  6.  
  7. namespace HexagonSurvive.Map.Components
  8. {
  9.     [ChunkSerializable]
  10.     public struct HexMapData : IComponentData
  11.     {
  12.         public MapBasicProperties basicProp;
  13.         public TerrainNoiseProperties tnProp;
  14.         public BiomeNoiseProperties bnProp;
  15.  
  16.         public NativeHashMap<int3, Entity> units;
  17.  
  18.         public HexMapData(MapBasicSettings basicSettings, TerrainNoiseSettings tnSettings, BiomeNoiseSettings bnSettings)
  19.         {
  20.             basicProp.seed = basicSettings.seed;
  21.             basicProp.mapRadius = basicSettings.mapRadius;
  22.             basicProp.chunkRadius = basicSettings.chunkRadius;
  23.             basicProp.position = basicSettings.position;
  24.  
  25.             tnProp.terrainSteps = tnSettings.terrainSteps;
  26.             tnProp.altitudePerStep = tnSettings.altitudePerStep;
  27.             tnProp.stepHeight = tnSettings.stepHeight;
  28.             tnProp.baseHeight = tnSettings.baseHeight;
  29.             tnProp.seaLevel = tnSettings.seaLevel;
  30.             tnProp.snowLine = tnSettings.snowLine;
  31.             tnProp.altitudeMultiplier = tnSettings.altitudeMultiplier;
  32.  
  33.             tnProp.baseTerrain = tnSettings.baseTerrain;
  34.             tnProp.ridged = tnSettings.ridged;
  35.             tnProp.river = tnSettings.river;
  36.  
  37.             bnProp.treeDensity = bnSettings.treeDensity;
  38.             bnProp.treeSpawnThreshold = bnSettings.treeSpawnThreshold;
  39.             bnProp.treeNoise = bnSettings.treeNoise;
  40.  
  41.             units = new NativeHashMap<int3, Entity>();
  42.         }
  43.     }
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement