private void UpdateSettingModeEvent_EA_SUB(bool isSettings)
 {
     _isAllowShuffel          = !isSettings;
     _isAllowResetAndSolution = !isSettings && _isAllowResetAndSolution;
     ResetCommand.RaiseCanExecuteChanged();
     ShowSolutionCommand.RaiseCanExecuteChanged();
     ShuffleCommand.RaiseCanExecuteChanged();
 }
 private void IsAllowResetAndSolutionEvent_EA_SUB(bool obj)
 {
     _isAllowResetAndSolution = true;
     _isAllowShuffel          = true;
     ResetCommand.RaiseCanExecuteChanged();
     ShowSolutionCommand.RaiseCanExecuteChanged();
     ShuffleCommand.RaiseCanExecuteChanged();
 }
Example #3
0
    bool ProveA()
    {
        var reversed = new ShuffleCommand[] {
            DealIntoNewStack()
        };

        var cut3 = new ShuffleCommand[] {
            CutN(3)
        };
        var cutNeg4 = new ShuffleCommand[] {
            CutN(-4)
        };

        var incN = new ShuffleCommand[] {
            DealWithIncrementN(3)
        };

        var ex1 = new ShuffleCommand[] {
            DealWithIncrementN(7),
            DealIntoNewStack(),
            DealIntoNewStack()
        };

        var ex2 = new ShuffleCommand[] {
            CutN(6),
            DealWithIncrementN(7),
            DealIntoNewStack()
        };
        var ex3 = new ShuffleCommand[] {
            DealWithIncrementN(7),
            DealWithIncrementN(9),
            CutN(-2)
        };

        var ex4 = new ShuffleCommand[] {
            DealIntoNewStack(),
            CutN(-2),
            DealWithIncrementN(7),
            CutN(8),
            CutN(-4),
            DealWithIncrementN(7),
            CutN(3),
            DealWithIncrementN(9),
            DealWithIncrementN(3),
            CutN(-1)
        };

        return
            (Expect(6, reversed) &&
             Expect(0, cut3) &&
             Expect(7, cutNeg4) &&
             Expect(9, incN) &&
             Expect(1, ex1) &&
             Expect(0, ex2) &&
             Expect(1, ex3) &&
             Expect(8, ex4));
    }
 private void ShowSolution()
 {
     _isAllowShuffel          = false;
     _isAllowResetAndSolution = false;
     ShuffleCommand.RaiseCanExecuteChanged();
     ResetCommand.RaiseCanExecuteChanged();
     ShowSolutionCommand.RaiseCanExecuteChanged();
     _eventAggregator.GetEvent <ShowSolutionClickEvent>().Publish(true);
 }
Example #5
0
 private long Apply(ShuffleCommand command, long pos, long length, bool invert)
 {
     if (invert)
     {
         return(0); // Not impl
     }
     else
     {
         return(mod((command.a * pos + command.b), length));
     }
 }
Example #6
0
    public void Init()
    {
        InitCardCommand initCardCommand = new InitCardCommand(this);

        initCardCommand.Execute();

        //洗牌
        ShuffleCommand ShuffleCommand = new ShuffleCommand(this);

        ShuffleCommand.Execute();
    }