public static SimulationForm CreateSimulationForm(SimulationPlugin simulationPlugin, string pluginName, ISpaceTemplateFactory spaceTemplateFactory, SimulationModelConfiguration modelConfiguration, int animationInterval) { var method = typeof(SimulationTemplate).GetMethods(BindingFlags.Static | BindingFlags.Public).Where(m => m.Name == nameof(CreateSimulationForm)).Skip(1).First(); method = method.MakeGenericMethod(simulationPlugin.GetType(), simulationPlugin.AgentType); return(method.Invoke(null, new object[] { simulationPlugin, pluginName, spaceTemplateFactory, modelConfiguration, animationInterval }) as SimulationForm); }
public static ISimulation CreateSimulation(SimulationPlugin plugin, string pluginName, ISpaceTemplateFactory spaceTemplateFactory, SimulationModelConfiguration modelConfiguration) { var method = typeof(SimulationTemplate).GetMethods(BindingFlags.Static | BindingFlags.Public).Where(m => m.Name == nameof(CreateSimulation)).Skip(1).First(); method = method.MakeGenericMethod(plugin.GetType(), plugin.AgentType); return(method.Invoke(null, new object[] { plugin, pluginName, spaceTemplateFactory, modelConfiguration }) as ISimulation); }