public void TestSerializeScenario() { var scenario = new Tutorial1_Movement().GenerateScenario(); var json = ConfigurationSerializer.SerializeScenario(scenario); // TODO: this will fail because of the use of generic func<T> which cannot currently be deseiralized // this can be replaced by some types implementing IPlayerConfigFactory, but this rather restricts the signature and lightweightness of the configuration // thid might not be such an issue with reference preservation in the serializer var scenarioCopy = ConfigurationSerializer.DeserializeScenario <SimulationScenario>(json); }
//public static SimulationRoot CreateSimulationRoot(string simulationConfigurationJson, DiContainer container = null) //{ // var simulationConfiguration = ConfigurationSerializer.DeserializeConfiguration<SimulationConfiguration>(simulationConfigurationJson); // return CreateECSRoot(simulationConfiguration, container); //} public static SimulationRoot CreateSimulationRoot(string simulationScenarioJson, DiContainer container = null) { var simulationScenario = ConfigurationSerializer.DeserializeScenario <SimulationScenario>(simulationScenarioJson); return(CreateECSRoot(simulationScenario, container)); }