예제 #1
0
 public MachineTestUserResult(CoreMachine machine, int userIndex, int spinCount, uint startSeed)
 {
     _machine      = machine;
     _userIndex    = userIndex;
     _startSeed    = startSeed;
     _roundResults = new List <MachineTestRoundResult>(spinCount);
 }
예제 #2
0
    public MachineTestIndieGameManager(CoreMachine machine)
    {
        _machine = machine;

        InitTapBox();
        InitWheel();
    }
예제 #3
0
    private MachineTestUserResult RunSingleUser(string machineName, int userIndex)
    {
        uint startSeed = GetUserRandSeed(userIndex);

        // set longLucky first, then init machine
        UserBasicData.Instance.SetLongLucky(_config._initLucky, false);

        // reset pay protection
        bool bakcupPayProtectionState = ResetUserDataPayProtection();

        CoreMachine machine = new CoreMachine(machineName, startSeed);

        MachineTestUserResult userResult = RunSingleUserResult(machine, userIndex, startSeed);

        // recovery pay protection
        RecoveryUserDataPayProtection(bakcupPayProtectionState);

        return(userResult);
    }
예제 #4
0
    private MachineTestUserResult RunSingleUserResult(CoreMachine machine, int userIndex, uint startSeed)
    {
        MachineTestUserResult userResult = new MachineTestUserResult(machine, userIndex, _config._spinCount, startSeed);

        MachineTestIndieGameManager indieGameManager = new MachineTestIndieGameManager(machine);
        MachineTestRound            round            = new MachineTestRound(machine, _config, indieGameManager);
        MachineTestInput            input            = null;
        MachineTestOutput           output           = null;

        for (int i = 0; i < _config._spinCount; i++)
        {
            bool canRun = true;
            do
            {
                input  = round.ConstructInput(output);
                canRun = round.CanRun(input);
                if (canRun)
                {
                    output = round.Run(input);
                    MachineTestRoundResult roundResult = new MachineTestRoundResult(input, output);
                    userResult.AddRoundResult(roundResult);
                }
                else
                {
                    break;
                }
            } while(output._shouldRespin);

            if (!canRun)
            {
                break;
            }
        }

        return(userResult);
    }
예제 #5
0
 public MachineTestRound(CoreMachine machine, MachineTestConfig config, MachineTestIndieGameManager indieGameManager)
 {
     _machine          = machine;
     _config           = config;
     _indieGameManager = indieGameManager;
 }