Пример #1
0
        public void CreateLocation(string locationID, Vector3 position)
        {
            var locationInfo = modData.LocationInfos.Where(o => o.ID == locationID).FirstOrDefault();

            if (locationInfo != null)
            {
                var modelTypeInfo = modData.ModModelTypes.Where(o => o.Name == locationInfo.Model.Type).FirstOrDefault();
                if (modelTypeInfo != null)
                {
                    var model = modData.ModelInfos.Where(o => o.ID == locationInfo.Model.Resource).FirstOrDefault();
                    model.ModelType = modelTypeInfo;

                    GameLocation location = new GameLocation(world, locationInfo);
                    location.Spawn();
                    location.ID = locations.Count;
                    locations.Add(location);
                }
            }
        }