public ChangeParameterSelectionAction(
     IFractalContext context,
     Expression <Func <IFractalContext, T> > targetPropertyExpression,
     T newValue)
 {
     this.context        = context;
     this.targetProperty = ResolveTargetProperty(targetPropertyExpression);
     this.newValue       = newValue;
 }
Example #2
0
        public ConsoleRenderer(
            IAlgorithmRegistry algorithmRegistry,
            IShaderRegistry shaderRegistry,
            IFractalContextFactory contextFactory,
            IScreen screen)
        {
            this.context = contextFactory.Create(screen);

            // TODO: make configurable
            this.context.CurrentAlgorithm = algorithmRegistry.GetAll().First(r => r.ToString().StartsWith("Mandel"));
            this.context.CurrentShader    = shaderRegistry.GetAll().First();
            this.context.MaxIterations    = 1500;
        }
Example #3
0
        public Form1(
            IAlgorithmRegistry algorithmRegistry,
            IShaderRegistry shaderRegistry,
            IFractalContextFactory contextFactory,
            IUndoStack undoStack,
            IParameterActionFactory parameterActionFactory)
        {
            this.InitializeComponent();

            this.algorithmRegistry       = algorithmRegistry;
            this.shaderRegistry          = shaderRegistry;
            this.undoStack               = undoStack;
            this.parameterActionFactory  = parameterActionFactory;
            this.undoStack.StackChanged += this.OnUndoSackChanged;

            this.context = contextFactory.Create(this.Screen);
            this.context.StatusChanged += this.OnStatusChanged;

            this.InitializeOptions();
        }
Example #4
0
 public ZoomInAction(IFractalContext context, Rectangle <int> selection)
 {
     this.context   = context;
     this.selection = selection;
 }
Example #5
0
 public IAction CreateChangeAlgorithmAction(IFractalContext context, IFractalAlgorithm algorithm)
 {
     return(new ChangeParameterSelectionAction <IFractalAlgorithm>(context, c => c.CurrentAlgorithm, algorithm));
 }
Example #6
0
 public IAction CreateChangeIterationsAction(IFractalContext context, int iterations)
 {
     return(new ChangeParameterSelectionAction <int>(context, c => c.MaxIterations, iterations));
 }
Example #7
0
 public IAction CreateChangeShaderAction(IFractalContext context, IShader shader)
 {
     return(new ChangeParameterSelectionAction <IShader>(context, c => c.CurrentShader, shader));
 }
Example #8
0
 public DrawAction(IFractalContext context)
 {
     this.context = context;
 }