Work on architecture. A lot of refractoring. Updated to unity 5.
This commit is contained in:
@ -11,7 +11,7 @@ namespace TransportGame.Business
|
||||
{
|
||||
public static class BiomeManager
|
||||
{
|
||||
private static Dictionary<string, Biome> biomes = new Dictionary<string, Biome>();
|
||||
private static List<Biome> biomes = new List<Biome>();
|
||||
|
||||
/// <summary>
|
||||
/// Gets all the loaded biomes
|
||||
@ -20,7 +20,7 @@ namespace TransportGame.Business
|
||||
{
|
||||
get
|
||||
{
|
||||
return biomes.Values;
|
||||
return biomes;
|
||||
}
|
||||
}
|
||||
|
||||
@ -41,7 +41,7 @@ namespace TransportGame.Business
|
||||
var biome = (Biome)serializer.Deserialize(stream);
|
||||
|
||||
// Add it to biome list
|
||||
biomes.Add(file, biome);
|
||||
biomes.Add(biome);
|
||||
Logger.Info("Loaded biome '{0}' from file '{1}'.", biome.Name, file);
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
@ -1,8 +1,11 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Xml.Serialization;
|
||||
using Assets.Scripts.Model.Config;
|
||||
using TransportGame.Utils;
|
||||
|
||||
namespace TransportGame.Business
|
||||
{
|
||||
@ -11,10 +14,14 @@ namespace TransportGame.Business
|
||||
public static readonly string BiomeDirectory = "Assets\\Data\\Biomes";
|
||||
public static readonly string ConfigurationDirectory = "Assets\\Data\\Config";
|
||||
|
||||
public static readonly string TerrGenConfigFile = "tergen.xml";
|
||||
|
||||
public static TerrainGeneratorConfig TerrGenConfig { get; private set; }
|
||||
|
||||
public static void LoadConfiguration()
|
||||
{
|
||||
// Load terrgen config
|
||||
TerrGenConfig = XmlHelper.Deserialize<TerrainGeneratorConfig>(Path.Combine(ConfigurationDirectory, TerrGenConfigFile));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user