Exemplo n.º 1
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);
    }
Exemplo n.º 2
0
 public MachineTestRound(CoreMachine machine, MachineTestConfig config, MachineTestIndieGameManager indieGameManager)
 {
     _machine          = machine;
     _config           = config;
     _indieGameManager = indieGameManager;
 }