Exemplo n.º 1
0
        public SimulationScene(SimulationWindow wnd, Simulation sim)
        {
            this.wnd = wnd;
            this.sim = sim;

            this.InitializeSettings();
        }
Exemplo n.º 2
0
        public ConfigWindow()
        {
            this.InitializeComponent();

            this.renderer = new SimulationWindow(this);
            this.renderer.Initialize();

            this.renderer.WindowOpened += (s, e) => {
                var renderWindowHwnd = ((SimulationWindow) s).RenderWindow.SystemHandle;
                this.Dispatcher.Invoke(new Action(() => { var helper = new WindowInteropHelper(this) {Owner = renderWindowHwnd}; }));
            };

            this.renderer.WindowClosed += (s, e) => this.Dispatcher.Invoke(new Action(this.Close));

            this.txt_RuleString.Text = this.renderer.Simulation.Rule.ToString();

            this.btn_ApplyWorldSettings_Click(this, new RoutedEventArgs());

            this.BgColorSetter.SelectedColor = ColorConvert.SFML2WPF(this.renderer.Scene.BgColor);
            this.CellColorSetter.SelectedColor = ColorConvert.SFML2WPF(this.renderer.Scene.CellColor);

            this.WindowContainer.Background = new SolidColorBrush(ColorConvert.SFML2WPF(this.renderer.Scene.BgColor));
            this.WindowContainer.BorderBrush = new SolidColorBrush(ColorConvert.SFML2WPF(this.renderer.Scene.CellColor));

            this.renderer.Scene.CenterCursor();
        }