Beispiel #1
0
    /// <summary>
    /// 麻雀ルール格納
    /// </summary>
    private void SetMahjongInGameData(string scoLineText, AdvDefine.CMD_TYPE scoCmdType)
    {
        Debug.Log("//-*SetMahjongInGameData(" + scoLineText + "," + scoCmdType + ")..." + m_gameData);
        if (m_gameData == null)
        {
            return;
        }
        var stageAndRule = GetScoCmdNo(scoLineText, scoCmdType).Split(AdvDefine.SCO_CMD_SPLIT);
        int stNo         = -1;
        int ruleNo       = -1;

        if (stageAndRule != null)
        {
            if (!string.IsNullOrEmpty(stageAndRule[0]) && int.TryParse(stageAndRule[0], out stNo))
            {
                m_gameData.BattleStage = stNo;
            }
            if (!string.IsNullOrEmpty(stageAndRule[1]) && int.TryParse(stageAndRule[0], out ruleNo))
            {
                m_gameData.BattleRule = ruleNo;
            }
        }
        Debug.Log("//-*(stNo:" + stNo + ", ruleNo:" + ruleNo + ")");
        // Const.MahjongInGameData
    }
Beispiel #2
0
    /// <summary>
    /// シナリオコマンド用処理:コマンド以降の文取得
    /// </summary>
    private string GetScoCmdChoiceSentence(string scoLineText, AdvDefine.CMD_TYPE scoCmdType)
    {
        //-*コマンド以降の文取得
        var sentence = scoLineText.Replace(AdvDefine.CmdDir[scoCmdType], "");

        //-*todo:何か処理が有れば
        return(sentence);
    }
Beispiel #3
0
    /// <summary>
    /// シナリオコマンド用処理:コマンド以降の番号取得
    /// </summary>
    private string GetScoCmdNo(string scoLineText, AdvDefine.CMD_TYPE scoCmdType)
    {
        //-*番号の抜き出し
        var no   = scoLineText.Replace(AdvDefine.CmdDir[scoCmdType], "");
        int temp = -1;

        //-*不正な番号
        if (!int.TryParse(no, out temp))
        {
            return("err:NotNumber:" + no);                                      //-*番号ではない
        }
        if (temp < 0)
        {
            return("err:IllegalNumber:" + temp);                //-*番号が負数
        }
        //-*背景番号が10未満なら文字追加
        if (temp < 10)
        {
             no = "0" + no;
        }

        Debug.Log("//-*" + scoCmdType + " = " + no);
        return(no);
    }