Пример #1
0
 public Level()
 {
     Entities = new List<Entity>();
     Fog = new Fog();
     Lightmap = new LightmapInfo();
     StartDateTime = DateTime.Now.ToString("d", new CultureInfo("en-US"));
 }
Пример #2
0
        private LightmapInfo GetLightmaps(BsonDocument bsonDoc)
        {
            LightmapInfo lightmap = new LightmapInfo();

            if (bsonDoc != null)
            {
                // Load Lightmap Informations
                lightmap.lightmapsMode = bsonDoc.Contains(DbConstants.LevelFieldLightmapsMode) ? bsonDoc[DbConstants.LevelFieldLightmapsMode].AsString : "";
                int lightMapCount = bsonDoc.Contains(DbConstants.LevelFieldLightmapsCount) ? int.Parse(bsonDoc[DbConstants.LevelFieldLightmapsCount].AsString) : 0;

                if (lightMapCount > 0)
                {
                    for (int lcount = 0; lcount < lightMapCount; lcount++)
                    {
                        string nearField = DbConstants.LevelFieldLightmapsNear + lcount.ToString(); // This should be in the format: near_x
                        string farField = DbConstants.LevelFieldLightmapsFar + lcount.ToString();   // This should be in the format: far_x

                        string near = bsonDoc.Contains(nearField) ? bsonDoc[nearField].AsString : "";
                        string far = bsonDoc.Contains(farField) ? bsonDoc[farField].AsString : "";

                        LightmapDataInfo lmData = new LightmapDataInfo(near, far);
                        lightmap.lightmaps.Add(lmData);
                    }
                }
            }

            return lightmap;
        }