Esempio n. 1
0
    public SmartCPUBehaviour(IGrid grid, ISetting setting, CPUMode difficulty)
    {
        _grid             = grid;
        _gridSimulator    = new GridSimulator(grid, setting);
        _outputter        = new OutputBestMovement(_gridSimulator);
        _grid.OnGroupAdd += new OnGroupAddEventHandler(OnGroupAddEvent);

        Debug.Log("difficulty " + difficulty + "set");
        switch (difficulty)
        {
        case CPUMode.Easy:
            timeBeforeAction   = 0.5f;
            timeBetweenActions = 0.5f;
            break;

        case CPUMode.Normal:
            timeBeforeAction   = 0.5f;
            timeBetweenActions = 0.3f;
            break;

        case CPUMode.Hard:
            timeBeforeAction   = 0.2f;
            timeBetweenActions = 0.1f;
            break;

        case CPUMode.Kusotuyo:
            timeBeforeAction   = 0f;
            timeBetweenActions = 0f;
            break;
        }
    }
Esempio n. 2
0
    public SmartCPUBehaviour(IGrid grid, ISetting setting, CPUMode difficulty)
    {
        _grid = grid;
        _gridSimulator = new GridSimulator(grid, setting);
        _outputter = new OutputBestMovement(_gridSimulator);
        _grid.OnGroupAdd += new OnGroupAddEventHandler(OnGroupAddEvent);

        Debug.Log("difficulty " + difficulty + "set");
        switch(difficulty)
        {
            case CPUMode.Easy:
                timeBeforeAction = 0.5f;
                timeBetweenActions = 0.5f;
                break;
            case CPUMode.Normal:
                timeBeforeAction = 0.5f;
                timeBetweenActions = 0.3f;
                break;
            case CPUMode.Hard:
                timeBeforeAction = 0.2f;
                timeBetweenActions = 0.1f;
                break;
            case CPUMode.Kusotuyo:
                timeBeforeAction = 0f;
                timeBetweenActions = 0f;
                break;
        }
    }
Esempio n. 3
0
    public void InitializeGridSimulator()
    {
        blockPattern = Substitute.For<IBlockPattern>();
        blockTypeMock = new BlockType[]
        {
            BlockType.One,
            BlockType.Six,
            BlockType.Three,
            BlockType.Five,
        };
        blockPattern.Types.Returns(blockTypeMock);

        group = groupFactory.Create(setting, blockPattern, groupPattern);

        gridSimulator = new GridSimulator(grid, setting);
    }
Esempio n. 4
0
    public void InitializeGridSimulator()
    {
        blockPattern  = Substitute.For <IBlockPattern>();
        blockTypeMock = new BlockType[]
        {
            BlockType.One,
            BlockType.Six,
            BlockType.Three,
            BlockType.Five,
        };
        blockPattern.Types.Returns(blockTypeMock);

        group = groupFactory.Create(setting, blockPattern, groupPattern);

        gridSimulator = new GridSimulator(grid, setting);
    }
Esempio n. 5
0
 public OutputBestMovement(IGridSimulator simulator)
 {
     _simulator = simulator;
 }
Esempio n. 6
0
 public OutputBestMovement(IGridSimulator simulator)
 {
     _simulator = simulator;
 }