public static AppointmentDataManager AppointmentDataInstance() { if (instance_ == null) { instance_ = new AppointmentDataManager(); } return(instance_); }
/// <summary> /// 获得约据游戏自定义规则。 /// </summary> /// <param name="RuleTextData">游戏规则</param> /// <param name="GameID">游戏ID</param> public static void GetAppointmentRuleTextData(ref string RuleTextData, GameKind_Enum GameID) { AppointmentData data = AppointmentDataManager.AppointmentDataInstance().GetCurrentAppointment(); RuleTextData = ""; if (data == null) { return; } if (GameID == GameKind_Enum.GameKind_LandLords) { if (data.maxpower == 250) { RuleTextData = "打" + data.playtimes.ToString() + "局 不封顶"; } else { RuleTextData = "打" + data.playtimes.ToString() + "局 最高" + data.maxpower + "倍"; } } else if (GameID == GameKind_Enum.GameKind_GuanDan) { GuanDanAppointmentData appointmentData = (GuanDanAppointmentData)data; if (appointmentData.terData_.playType == TePlayType.Times) { if (appointmentData.terData_.cp == CurrentPoker.Two) { RuleTextData = "打" + appointmentData.terData_.times.ToString() + "局 双下" + appointmentData.terData_.score.ToString() + "分 打2"; } else { RuleTextData = "打" + appointmentData.terData_.times.ToString() + "局 双下" + appointmentData.terData_.score.ToString() + "分 随机打"; } } else { if (appointmentData.terData_.vectory == 1) { RuleTextData = "连续打 过A胜利"; } else { RuleTextData = "连续打 过" + appointmentData.terData_.vectory.ToString() + "胜利"; } } } else if (GameID == GameKind_Enum.GameKind_Mahjong || GameID == GameKind_Enum.GameKind_YcMahjong || GameID == GameKind_Enum.GameKind_CzMahjong) { if (data.maxpower == 250 || data.maxpower == 0) { RuleTextData = "打" + data.playtimes.ToString() + "局 不封顶"; } else { RuleTextData = "打" + data.playtimes.ToString() + "局 最高" + data.maxpower + "倍"; } if (GameID == GameKind_Enum.GameKind_Mahjong) { MahjongAppointmentData mahjongData = (MahjongAppointmentData)data; RuleTextData += GameKind.HasFlag(0, mahjongData.palyType) ? "\n自摸加底" : "\n自摸加翻"; RuleTextData += GameKind.HasFlag(1, mahjongData.palyType) ? "\n点杠花(点炮)\n" : "\n点杠花(自摸)\n"; RuleTextData += GameKind.HasFlag(2, mahjongData.palyType) ? " 幺九将对" : ""; RuleTextData += GameKind.HasFlag(3, mahjongData.palyType) ? " 门清中张" : ""; RuleTextData += GameKind.HasFlag(4, mahjongData.palyType) ? " 天地胡" : ""; } else if (GameID == GameKind_Enum.GameKind_CzMahjong) { CzMahjongAppointmentData mahjongData = (CzMahjongAppointmentData)data; RuleTextData += "\n"; string[] wanFaName = { "包三口", " 包四口", " 擦背", " 吃" }; for (int index = 0; index < 4; ++index) { if (GameKind.HasFlag(index, mahjongData.wanFa)) { RuleTextData += wanFaName[index]; } } string[] qiHuName = { "", "\n一番起胡", "\n硬一番起胡", "\n3花起胡", "\n4花起胡" }; RuleTextData += qiHuName.Count() > 5 ? "" : qiHuName[mahjongData.qiHu]; RuleTextData += "\n" + mahjongData.diHua + "底花"; } } else if (GameID == GameKind_Enum.GameKind_GouJi) { GoujiAppointmentData gouJiData = (GoujiAppointmentData)(data); RuleTextData = "打" + gouJiData.playtimes.ToString() + "局 \n"; string[] wanFaName = { "宣点\n", "开点发4\n", "憋三\n", "大王二杀一\n", "进贡\n" }; for (int index = 0; index < 5; ++index) { if (GameKind.HasFlag(index, gouJiData.wanFa)) { RuleTextData += wanFaName[index]; } } } else if (GameID == GameKind_Enum.GameKind_HongZhong) { HzMahjongAppointmentData mahjongData = (HzMahjongAppointmentData)(data); RuleTextData = "打" + mahjongData.playtimes.ToString() + "局 \n" + "抓鸟" + mahjongData.birdNum + "张 \n"; string[] wanFaName = { "红中是赖子\n", "可以点炮\n", }; for (int index = 0; index < 2; ++index) { if (GameKind.HasFlag(index, mahjongData.wanFa)) { RuleTextData += wanFaName[index]; } } } else if (GameID == GameKind_Enum.GameKind_Chess) { ChessAppointmentData chessData = (ChessAppointmentData)(data); RuleTextData = "打" + chessData.playtimes.ToString() + "局 局时 " + chessData.ChessTime + "分"; } }