예제 #1
0
    public void HighlightSlot(int slotIndex)
    {
        UISudokuSlot slot = GetUISlot(slotIndex);

        if (slot == null)
        {
            return;
        }

        slot.PlayTweenHighlight();
    }
예제 #2
0
    private void SlotOnClick(UISudokuSlot slot)
    {
        if (slot == null)
        {
            return;
        }

        if (_onClickAction == null)
        {
            return;
        }

        _onClickAction(slot);
    }
예제 #3
0
    private void FillSolutionIntoSlot(int rowIndex, int columnIndex, int value, FillReason reason)
    {
        int slotIndex = rowIndex * SudokuUtility.PUZZLE_LENGTH + columnIndex;

        // Update data
        _sData.SetSlotValueAndReason(slotIndex, value, reason);

        UISudokuSlot uiSlot = _uiSlotBoard.GetUISlot(slotIndex);

        //// Add to undo
        //if (_undoIndex >= _undoCmdList.Count) {
        //    _undoCmdList.Add(new UndoCommand());
        //}
        //_undoCmdList[_undoIndex].AddNewCommand(uiSlot.Value, uiSlot.FillReason, slotIndex);

        uiSlot.SetValueAndReason(value, reason);

        //if (reason != FillReason.QuestionInput) {
        //    AddSolutionLog(rowIndex, columnIndex, value, reason);
        //}
    }
예제 #4
0
    public void ButtonSlotOnClick(UISudokuSlot slot)
    {
        if (!_isQuizGenerated)
        {
            return;
        }

        if (!_isResolving)
        {
            return;
        }

        if (slot == null)
        {
            return;
        }

        if (slot.FillReason == FillReason.QuestionInput)
        {
            return;
        }

        if (_selectingInput == null)
        {
            return;
        }

        int inputValue = _selectingInput.InputValue;

        if (slot.Value == inputValue)
        {
            inputValue = 0;
        }

        FillSolutionIntoSlot(slot.SlotIndex, inputValue, FillReason.PlayerInput);
        //_undoIndex += 1;

        //RefreshUndoButton();
    }
예제 #5
0
    public void ButtonSlotOnClick(UISudokuSlot slot)
    {
        if (slot == null)
        {
            return;
        }

        if (_selectingInput == null)
        {
            return;
        }

        int inputValue = _selectingInput.InputValue;

        if (slot.Value == inputValue)
        {
            inputValue = 0;
        }

        FillSolutionIntoSlot(slot.SlotIndex, inputValue, FillReason.QuestionInput);
        _undoIndex += 1;

        Refresh();
    }