Files
hjha-server/GameFix/Common/Card/StyleChecker/Helper/CardStyle111222Helper.cs
xiaoou e9616125ce feat: initial commit - HJHA game server full source
6 major server modules (PdkFriendServer/GlobalSever/ServerCore/GameModule/GameNetModule) +
game logic (GameFix/GameDAL/ServerData) +
network layer (NetWorkMessage) +
data layer (ObjectModel) +
utilities (MrWu/Core/Config/CloudAPI/dll) +
adapters (zyxAdapter/base)

.NET 8.0 C# solution, 16 projects, 958 source files
2026-07-07 12:02:15 +08:00

88 lines
3.4 KiB
C#

using System.Collections.Generic;
using System.Linq;
using GameMessage;
namespace GameFix.Poker
{
public class CardStyle111222Helper : CardStyleBaseHelper
{
public override int CardStyle => DataCardConst.CardStyle111222;
public override int CardCnt => 6;
internal override bool CheckStyleNormal(CardBaseGroup group, out CardStyleInfo cardStyleInfo)
{
cardStyleInfo = null;
if (group.Cards.Count >= CardCnt && group.Cards.Count % 3 == 0)
{
if (IsContinuous(group.CardGroupList, 3, out var shunCnt)
&& shunCnt.Count * 3 == group.Cards.Count)
{
cardStyleInfo = CardStyleHelper.CreateCardStyleInfo(CardStyle, group.Cards);
return true;
}
}
return false;
}
internal override bool CheckStyleWithLZ(CardBaseGroup group, out CardStyleInfo cardStyleInfo)
{
cardStyleInfo = null;
if (group.Cards.Count >= CardCnt && group.Cards.Count % 3 == 0)
{
if (IsAllSame(group.NoLZCards)) return false;
if (IsMaxContinuousByLZ(group.CardGroupList, 3, group.LZCards.Count,
out var shunValueList, out var lackValueList))
{
if (shunValueList.Count * 3 == group.Cards.Count)
{
cardStyleInfo = new CardStyleInfo(CardStyle, shunValueList[0], shunValueList.Count * 3);
cardStyleInfo.CardLackValues = lackValueList.ToArray();
return true;
}
}
}
return false;
}
internal override List<CardGroupList> GetAllEatTipGroup(CardBaseGroup group, CardStyleInfo eatStyleInfo)
{
var groupCnt = group.CardGroupList.Count;
var groupList = new List<CardGroupList>(groupCnt);
var minValue = eatStyleInfo != null ? eatStyleInfo.CardValue + 1 : 3;
var continuousCnt = eatStyleInfo?.CardCnt ?? -1;
List<Card> continuousList = new List<Card>();
for (int i = minValue; i < group.CardGroupList.Count; i++)
{
continuousList.Clear();
for (int j = 0; j < group.CardGroupList.Count; j++)
{
if (i + j >= group.CardGroupList.Count)
break;
if (group.CardGroupList[i + j].Count <= 2)
break;
continuousList.AddRange(group.CardGroupList[i + j].GetRange(0, 3));
if (continuousList.Count >= CardCnt && continuousList.Count % 3 == 0)
{
if (continuousCnt == -1 || continuousCnt == continuousList.Count)
{
groupList.Add(new CardGroupList(continuousList));
}
}
}
}
return groupList;
}
internal override List<CardGroupList> GetAllEatTipGroupWithLZ(CardBaseGroup group, CardStyleInfo eatStyleInfo)
{// 这里不处理直接找炸弹
return new List<CardGroupList>();
}
}
}