Пример #1
0
        /// <summary>
        /// Initialises a new instance of the <see cref="Program"/> class,
        /// </summary>
        static Program()
        {
            ReadConfigFile();

            bodies       = BodyGenerator.GenerateBodies(configuration.BodyCount, true);
            bodyShapeMap = BodyGenerator.GenerateShapes(bodies, BodyGenerator.DefaultRadiusDelegate, BodyGenerator.RainbowColourDelegate);

            UpdateDelegate bodyPositionUpdater = BodyUpdater.UpdateBodiesBarnesHut;

            ContextSettings customContextSettings = new ContextSettings {
                AntialiasingLevel = 8, DepthBits = 24, StencilBits = 8
            };

            RenderWindow simulationWindow =
                new RenderWindow(VideoMode.DesktopMode, "N-Body Simulation: FPS ", Styles.Default, customContextSettings);

            PrintContextSettings(customContextSettings);

            IInputHandler simulationInputHandler = new SimulationInputHandler(ref bodies);

            simulationScreen = new SimulationScreen(simulationWindow, simulationInputHandler, ref bodies, ref bodyShapeMap, bodyPositionUpdater)
            {
                Configuration = configuration,
            };
        }