Пример #1
0
        public void OnLoad(object sender, RoutedEventArgs routedEventArgs)
        {
            Pause(null, null);

            var fileDialog = new System.Windows.Forms.OpenFileDialog();
            var result     = fileDialog.ShowDialog();

            switch (result)
            {
            case System.Windows.Forms.DialogResult.OK:
                var file = fileDialog.FileName;

                Anthill.Anthill anthill = (Anthill.Anthill)App.AnthillModel.Anthill.Load(file);
                App.AnthillModel.Anthill      = anthill;
                App.AnthillModel.CurrentWorld = anthill.GetWorld();

                ResetBindings(App.AnthillModel.CurrentWorld);
                Draw();
                break;

            case System.Windows.Forms.DialogResult.Cancel:
            default:
                break;
            }
        }
Пример #2
0
        public static void ResetSimulation(CustomAnthillFactory customAnthillFactory)
        {
            Anthill.Anthill anthill = new Anthill.Anthill(customAnthillFactory);

            AnthillModel.Anthill      = anthill;
            AnthillModel.CurrentWorld = anthill.GetWorld();
        }