Exemple #1
0
    public bool ChangeDotColor(int _iIndex, int _iFullCount, bool _bInterigens = true)
    {
        Dot dot = m_DotList [_iIndex];

        DefineProject.DOT_COLOR eDotColor = dot.GetDotColor();

        DefineProject.DOT_COLOR eNextDotColor = GetNextDotColor(eDotColor);

        if (_bInterigens)
        {
            // 白になってたらもう終わらせる
            while (eNextDotColor != DefineProject.DOT_COLOR.WHITE)
            {
                int iCount = GetCount(eNextDotColor);
                if (iCount < _iFullCount)
                {
                    break;
                }
                eNextDotColor = GetNextDotColor(eNextDotColor);
            }
        }

        bool bRet = (eNextDotColor != eDotColor);

        if (bRet)
        {
            dot.SetDotColor(eNextDotColor);
        }

        // 違う色になってたら真
        return(bRet);
    }
Exemple #2
0
    public int GetNumber(DefineProject.DOT_COLOR _eColor)
    {
        int iRet = 0;

        foreach (Dot dot in m_DotList)
        {
            if (dot.GetDotColor() == _eColor)
            {
                iRet += dot.Number;
            }
        }
        return(iRet);
    }
Exemple #3
0
    public int GetCount(DefineProject.DOT_COLOR _eDotColor)
    {
        int iCount = 0;

        foreach (Dot dot in m_DotList)
        {
            if (dot.GetDotColor() == _eDotColor)
            {
                iCount += 1;
            }
        }
        return(iCount);
    }
Exemple #4
0
    public void SetDotColor(DefineProject.DOT_COLOR _eColor)
    {
        if (m_eDotColor != _eColor)
        {
            //Debug.Log (string.Format ("change color : {0}", _eColor));
            //iTween.ColorTo (m_sprBackBoard.gameObject, DefineProject.GetColor (_eColor), DefineProject.COLOR_CHANGE_TIME);

            TweenColor.Begin(m_sprBackBoard.gameObject, DefineProject.COLOR_CHANGE_TIME, DefineProject.GetColor(_eColor));
            m_eDotColor = _eColor;
        }
        else
        {
            //Debug.Log ("same color");
        }
        return;
    }
Exemple #5
0
    public DefineProject.DOT_COLOR GetNextDotColor(DefineProject.DOT_COLOR _eDotColor)
    {
        DefineProject.DOT_COLOR eRet = DefineProject.DOT_COLOR.WHITE;
        switch (_eDotColor)
        {
        case DefineProject.DOT_COLOR.WHITE:
            eRet = DefineProject.DOT_COLOR.RED;
            break;

        case DefineProject.DOT_COLOR.RED:
            eRet = DefineProject.DOT_COLOR.BLUE;
            break;

        case DefineProject.DOT_COLOR.BLUE:
            eRet = DefineProject.DOT_COLOR.WHITE;
            break;

        default:
            eRet = DefineProject.DOT_COLOR.WHITE;
            break;
        }
        return(eRet);
    }
Exemple #6
0
 public void SetDotColor(int _iIndex, DefineProject.DOT_COLOR _eDotColor)
 {
     // require range check
     m_DotList [_iIndex].SetDotColor(_eDotColor);
     return;
 }