public static void Example() { var loader = new JsonLoader(); var data = loader.LoadObject <Data>("TestLoader/config"); foreach (var actor in data.Actors) { Logger.Log($"actor type: {actor.Key}, name: {actor.Value.Name}, age: {actor.Value.Age}"); } }
public static void Example() { var loader = new JsonLoader(); var data = loader.LoadObject <Data>("TestLoader/config"); foreach (var actor in data.Actors) { Logger.Log(actor.Value.GetType().ToString()); } var zombie = data.Actors.Values.First(actor => actor is Zombie) as Zombie; Logger.Log(zombie?.SomeZombieField); }
private void TestWithRemoteConfig() { LoadConfig(); void LoadConfig() { var loader = new JsonLoader(); var data = loader.LoadObject <ConfigData>("config");//objects creating by factory inside TypeBaseConverter foreach (var item in data.Components) { Logger.Log(item.Value.GetType().ToString()); } } }