Пример #1
0
 public static IEnumerable <ILegacyStarMapObject> CreateStarSystem(
     Random random,
     Matrix worldTransform,
     Kerberos.Sots.Data.StarMapFramework.StarSystem systemParams,
     LegacyTerrain parentTerrain)
 {
     return((IEnumerable <ILegacyStarMapObject>) new ILegacyStarMapObject[1]
     {
         (ILegacyStarMapObject)StarSystemHelper.CreateStarSystem(random, worldTransform, systemParams, parentTerrain)
     });
 }
Пример #2
0
        public static IEnumerable <ILegacyStarMapObject> CreateTerrain(
            Random random,
            Matrix worldTransform,
            Kerberos.Sots.Data.StarMapFramework.Terrain terrainParams,
            LegacyStarMap map)
        {
            LegacyTerrain parentTerrain = new LegacyTerrain();
            List <ILegacyStarMapObject> legacyStarMapObjectList = new List <ILegacyStarMapObject>();

            foreach (Feature feature in terrainParams.Features)
            {
                Matrix worldTransform1 = feature.LocalSpace * worldTransform;
                legacyStarMapObjectList.AddRange(LegacyStarMap.CreateFeature(random, worldTransform1, feature, map, parentTerrain));
            }
            parentTerrain.Name   = terrainParams.Name;
            parentTerrain.Origin = new Vector3(worldTransform.M41, worldTransform.M42, worldTransform.M43);
            map._terrain.Add(parentTerrain);
            map._nodelines.AddRange((IEnumerable <NodeLine>)terrainParams.NodeLines);
            map._provinces.AddRange((IEnumerable <Province>)terrainParams.Provinces);
            return((IEnumerable <ILegacyStarMapObject>)legacyStarMapObjectList);
        }
Пример #3
0
 public static IEnumerable <ILegacyStarMapObject> CreateFeature(
     Random random,
     Matrix worldTransform,
     Feature featureParams,
     LegacyStarMap map,
     LegacyTerrain parentTerrain)
 {
     if (featureParams.GetType() == typeof(Kerberos.Sots.Data.StarMapFramework.Terrain))
     {
         return(LegacyStarMap.CreateTerrain(random, worldTransform, featureParams as Kerberos.Sots.Data.StarMapFramework.Terrain, map));
     }
     if (featureParams.GetType() == typeof(Kerberos.Sots.Data.StarMapFramework.StarSystem))
     {
         return(LegacyStarMap.CreateStarSystem(random, worldTransform, featureParams as Kerberos.Sots.Data.StarMapFramework.StarSystem, parentTerrain));
     }
     if (featureParams.GetType() == typeof(StellarBody))
     {
         return(LegacyStarMap.CreateStellarObject(random, worldTransform, featureParams as StellarBody));
     }
     throw new ArgumentException(string.Format("Unsupported starmap feature '{0}'.", (object)featureParams.GetType()));
 }