Esempio n. 1
0
    private bool IsAblePutDown(int pCellIdx)
    {
        this.nowData = InfoHelper.DataTable.TenByTenDataList[this.arrExamIdx[pCellIdx]];
        for (int i = 0; i < this.nowData.checkList.Count; ++i)
        {
            if (!IsUseAblePiece(this.nowData.checkList[i].row + this.nowPivotRow, this.nowData.checkList[i].col + this.nowPivotCol))
            {
                return(false);
            }
        }

        return(true);
    }
Esempio n. 2
0
    public void SetData(TenByTenData pData)
    {
        this.data = pData;

        OnResetExamContent();

        int row, col;

        for (int i = 0; i < pData.examList.Count; ++i)
        {
            row = pData.examList[i].row;
            col = pData.examList[i].col;
            if (IsUseExam(row, col))
            {
                this.arrRow[row].arrColumn[col].SetActive(true);
            }
        }

        OnResetExamLocation();
    }
Esempio n. 3
0
    private void UpdateTenByTenDataList(List <Dictionary <string, object> > pDicList)
    {
        this.tenByTenDataList.Clear();

        for (int i = 0; i < pDicList.Count; ++i)
        {
            TenByTenData data = new TenByTenData();

            string[] strsCheckList = pDicList[i]["check_list"].ToString().Split('/');
            int      row, col;
            for (int j = 0; j < strsCheckList.Length; ++j)
            {
                string[] strsCheck = strsCheckList[j].Split('&');
                if (strsCheck.Length != 2)
                {
                    DebugX.Log($"Error Check List : {j} type");
                    break;
                }

                if (!int.TryParse(strsCheck[0], out col))
                {
                    DebugX.Log($"Error Check x : {j} type");
                    break;
                }

                if (!int.TryParse(strsCheck[1], out row))
                {
                    DebugX.Log($"Error Check y : {j} type");
                    break;
                }

                data.checkList.Add(new TenByTenData.Piece(row, col));
            }

            string[] strsExamList = pDicList[i]["exam_list"].ToString().Split('/');
            for (int j = 0; j < strsExamList.Length; ++j)
            {
                string[] strsCheck = strsExamList[j].Split('&');
                if (strsCheck.Length != 2)
                {
                    DebugX.Log($"Error Exam List : {j} type");
                    break;
                }

                if (!int.TryParse(strsCheck[0], out col))
                {
                    DebugX.Log($"Error Exam x : {j} type");
                    break;
                }

                if (!int.TryParse(strsCheck[1], out row))
                {
                    DebugX.Log($"Error Exam y : {j} type");
                    break;
                }

                data.examList.Add(new TenByTenData.Piece(row, col));
            }

            string[] strsExamPivot = pDicList[i]["exam_pivot"].ToString().Split('&');
            if (!int.TryParse(strsExamPivot[0], out col))
            {
                DebugX.Log("Error Exam Pivot x");
                break;
            }

            if (!int.TryParse(strsExamPivot[1], out row))
            {
                DebugX.Log("Error Exam Pivot y");
                break;
            }

            data.pivotExam = new TenByTenData.Piece(row, col);
            this.tenByTenDataList.Add(data);
        }
    }