|
@@ -5,13 +5,13 @@ using System.Linq;
|
|
|
|
|
|
namespace ET.Server
|
|
|
{
|
|
|
- [FriendOf(typeof (HGHuangHuangComponent))]
|
|
|
- public static class HGHuangHuangComponentSystem
|
|
|
+ [FriendOf(typeof (HGHHComponent))]
|
|
|
+ public static class HGHHComponentSystem
|
|
|
{
|
|
|
[ObjectSystem]
|
|
|
- public class HGHuangHuangComponentAwakeSystem: AwakeSystem<HGHuangHuangComponent>
|
|
|
+ public class HGHuangHuangComponentAwakeSystem: AwakeSystem<HGHHComponent>
|
|
|
{
|
|
|
- protected override void Awake(HGHuangHuangComponent self)
|
|
|
+ protected override void Awake(HGHHComponent self)
|
|
|
{
|
|
|
Room room = self.GetParent<Room>();
|
|
|
if (room == null)
|
|
@@ -52,9 +52,9 @@ namespace ET.Server
|
|
|
}
|
|
|
|
|
|
[ObjectSystem]
|
|
|
- public class HGHuangHuangComponentDestroySystem: DestroySystem<HGHuangHuangComponent>
|
|
|
+ public class HGHHComponentDestroySystem: DestroySystem<HGHHComponent>
|
|
|
{
|
|
|
- protected override void Destroy(HGHuangHuangComponent self)
|
|
|
+ protected override void Destroy(HGHHComponent self)
|
|
|
{
|
|
|
Log.Info($"销毁黄冈晃晃主逻辑组件...");
|
|
|
}
|
|
@@ -62,9 +62,9 @@ namespace ET.Server
|
|
|
|
|
|
[ObjectSystem]
|
|
|
[FriendOf(typeof(Room))]
|
|
|
- public class HGHuangHuangComponentUpdateSystem : UpdateSystem<HGHuangHuangComponent>
|
|
|
+ public class HGHuangHuangComponentUpdateSystem : UpdateSystem<HGHHComponent>
|
|
|
{
|
|
|
- protected override void Update(HGHuangHuangComponent self)
|
|
|
+ protected override void Update(HGHHComponent self)
|
|
|
{
|
|
|
long timeNow = TimeHelper.ClientNow();
|
|
|
// 每秒执行一次
|
|
@@ -193,7 +193,7 @@ namespace ET.Server
|
|
|
/// <param name="self"></param>
|
|
|
/// <param name="room"></param>
|
|
|
/// <returns></returns>
|
|
|
- private static bool CheckReadyStart(this HGHuangHuangComponent self, Room room)
|
|
|
+ private static bool CheckReadyStart(this HGHHComponent self, Room room)
|
|
|
{
|
|
|
if (!room.IsStart() || self.State != 0)
|
|
|
{
|
|
@@ -215,7 +215,7 @@ namespace ET.Server
|
|
|
/// </summary>
|
|
|
/// <param name="self"></param>
|
|
|
/// <param name="room"></param>
|
|
|
- private static void SendCard(this HGHuangHuangComponent self, Room room)
|
|
|
+ private static void SendCard(this HGHHComponent self, Room room)
|
|
|
{
|
|
|
foreach (Player player in room.GetAllPlayers().Values.Where(player => player != null))
|
|
|
{
|
|
@@ -233,7 +233,7 @@ namespace ET.Server
|
|
|
/// </summary>
|
|
|
/// <param name="self"></param>
|
|
|
/// <param name="room"></param>
|
|
|
- private static void Start(this HGHuangHuangComponent self, Room room)
|
|
|
+ private static void Start(this HGHHComponent self, Room room)
|
|
|
{
|
|
|
self.CurrentRound += 1;
|
|
|
// 摇骰子
|
|
@@ -265,7 +265,7 @@ namespace ET.Server
|
|
|
/// </summary>
|
|
|
/// <param name="self"></param>
|
|
|
/// <param name="room"></param>
|
|
|
- private static void DrawCard(this HGHuangHuangComponent self, Room room)
|
|
|
+ private static void DrawCard(this HGHHComponent self, Room room)
|
|
|
{
|
|
|
// 2个以上玩家认输或牌库没牌了直接结束
|
|
|
if (self.AdmitDefeatList.Count > 2 || self.CardList.Count <= 0)
|
|
@@ -345,7 +345,7 @@ namespace ET.Server
|
|
|
/// <param name="player"></param>
|
|
|
/// <param name="card">出的牌(0.当前摸牌玩家自动出牌 -1.非当前摸牌玩家自动出牌 >0.玩家手动出牌)</param>
|
|
|
/// <param name="flag">是否自动出牌</param>
|
|
|
- public static async void DisCard(this HGHuangHuangComponent self, Room room, Player player, int card, bool flag)
|
|
|
+ public static async void DisCard(this HGHHComponent self, Room room, Player player, int card, bool flag)
|
|
|
{
|
|
|
if (player == null)
|
|
|
{
|
|
@@ -578,7 +578,7 @@ namespace ET.Server
|
|
|
/// <param name="self"></param>
|
|
|
/// <param name="player"></param>
|
|
|
/// <returns></returns>
|
|
|
- private static bool IsCanChi(this HGHuangHuangComponent self, Player player)
|
|
|
+ private static bool IsCanChi(this HGHHComponent self, Player player)
|
|
|
{
|
|
|
if (self.ClickHuIds.Count > 0)
|
|
|
{
|
|
@@ -624,7 +624,7 @@ namespace ET.Server
|
|
|
/// <param name="room"></param>
|
|
|
/// <param name="player"></param>
|
|
|
/// <param name="card"></param>
|
|
|
- public static void Chi(this HGHuangHuangComponent self, Room room, Player player, int card)
|
|
|
+ public static void Chi(this HGHHComponent self, Room room, Player player, int card)
|
|
|
{
|
|
|
if (!self.IsCanChi(player))
|
|
|
{
|
|
@@ -676,7 +676,7 @@ namespace ET.Server
|
|
|
/// <param name="self"></param>
|
|
|
/// <param name="player"></param>
|
|
|
/// <returns></returns>
|
|
|
- private static bool IsCanPengGang(this HGHuangHuangComponent self, Player player)
|
|
|
+ private static bool IsCanPengGang(this HGHHComponent self, Player player)
|
|
|
{
|
|
|
if (!self.CanPgIds.Contains(player.Id))
|
|
|
{
|
|
@@ -702,7 +702,7 @@ namespace ET.Server
|
|
|
/// <param name="self"></param>
|
|
|
/// <param name="room"></param>
|
|
|
/// <param name="player"></param>
|
|
|
- public static void Peng(this HGHuangHuangComponent self, Room room, Player player)
|
|
|
+ public static void Peng(this HGHHComponent self, Room room, Player player)
|
|
|
{
|
|
|
if (!self.IsCanPengGang(player))
|
|
|
{
|
|
@@ -759,7 +759,7 @@ namespace ET.Server
|
|
|
/// <param name="player"></param>
|
|
|
/// <param name="card"></param>
|
|
|
/// <returns></returns>
|
|
|
- private static int GangPaiDraw(this HGHuangHuangComponent self, Room room, Player player, int card)
|
|
|
+ private static int GangPaiDraw(this HGHHComponent self, Room room, Player player, int card)
|
|
|
{
|
|
|
int type = (int)HGHHConst.KeziType.DEFAULT;
|
|
|
int[] remainCards = player.RemainCards;
|
|
@@ -817,7 +817,7 @@ namespace ET.Server
|
|
|
/// <param name="player"></param>
|
|
|
/// <param name="card"></param>
|
|
|
/// <returns></returns>
|
|
|
- private static int GangPaiDisCard(this HGHuangHuangComponent self, Room room, Player player, int card)
|
|
|
+ private static int GangPaiDisCard(this HGHHComponent self, Room room, Player player, int card)
|
|
|
{
|
|
|
const int type = (int)HGHHConst.KeziType.DEFAULT;
|
|
|
if (self.DisCardPlayer == null)
|
|
@@ -847,7 +847,7 @@ namespace ET.Server
|
|
|
/// <param name="player"></param>
|
|
|
/// <param name="card">杠的牌</param>
|
|
|
/// <returns></returns>
|
|
|
- private static bool CheckQangGangHu(this HGHuangHuangComponent self, Room room, Player player, int card)
|
|
|
+ private static bool CheckQangGangHu(this HGHHComponent self, Room room, Player player, int card)
|
|
|
{
|
|
|
bool flag = false;
|
|
|
int[] nextPos = room.GetSorcPos(player.Pos);
|
|
@@ -887,7 +887,7 @@ namespace ET.Server
|
|
|
/// <param name="room"></param>
|
|
|
/// <param name="player"></param>
|
|
|
/// <param name="card"></param>
|
|
|
- public static void Gang(this HGHuangHuangComponent self, Room room, Player player, int card)
|
|
|
+ public static void Gang(this HGHHComponent self, Room room, Player player, int card)
|
|
|
{
|
|
|
if (card > 0 && self.IsCanPengGang(player))
|
|
|
{
|
|
@@ -939,7 +939,7 @@ namespace ET.Server
|
|
|
/// <param name="self"></param>
|
|
|
/// <param name="room"></param>
|
|
|
/// <param name="player"></param>
|
|
|
- private static void ZimoHuPai(this HGHuangHuangComponent self, Room room, Player player)
|
|
|
+ private static void ZimoHuPai(this HGHHComponent self, Room room, Player player)
|
|
|
{
|
|
|
if (self.OperableList.Contains(player.Id) && self.CanHuIds.Contains(player.Id))
|
|
|
{
|
|
@@ -982,7 +982,7 @@ namespace ET.Server
|
|
|
/// <param name="player"></param>
|
|
|
/// <param name="huType">牌型</param>
|
|
|
/// <param name="isGangHu">是否抢杠胡</param>
|
|
|
- private static void DianPaoHuPaiBroadcast(this HGHuangHuangComponent self, Room room, Player player, int huType, bool isGangHu)
|
|
|
+ private static void DianPaoHuPaiBroadcast(this HGHHComponent self, Room room, Player player, int huType, bool isGangHu)
|
|
|
{
|
|
|
if (isGangHu)
|
|
|
{
|
|
@@ -1028,7 +1028,7 @@ namespace ET.Server
|
|
|
/// <param name="self"></param>
|
|
|
/// <param name="room"></param>
|
|
|
/// <param name="player"></param>
|
|
|
- private static void DianPaoHuPai(this HGHuangHuangComponent self, Room room, Player player)
|
|
|
+ private static void DianPaoHuPai(this HGHHComponent self, Room room, Player player)
|
|
|
{
|
|
|
int card = 0;
|
|
|
bool isGangHU = false;
|
|
@@ -1089,7 +1089,7 @@ namespace ET.Server
|
|
|
/// <param name="self"></param>
|
|
|
/// <param name="room"></param>
|
|
|
/// <param name="player"></param>
|
|
|
- public static void Hu(this HGHuangHuangComponent self, Room room, Player player)
|
|
|
+ public static void Hu(this HGHHComponent self, Room room, Player player)
|
|
|
{
|
|
|
int r = player.RemainCards.Length % 3;
|
|
|
switch (r)
|
|
@@ -1109,7 +1109,7 @@ namespace ET.Server
|
|
|
/// <param name="self"></param>
|
|
|
/// <param name="room"></param>
|
|
|
/// <param name="player"></param>
|
|
|
- public static void Guo(this HGHuangHuangComponent self, Room room, Player player)
|
|
|
+ public static void Guo(this HGHHComponent self, Room room, Player player)
|
|
|
{
|
|
|
// 玩家必须在可操作列表里
|
|
|
if (!self.OperableList.Contains(player.Id))
|
|
@@ -1235,7 +1235,7 @@ namespace ET.Server
|
|
|
/// <param name="self"></param>
|
|
|
/// <param name="curPos">当前玩家位置</param>
|
|
|
/// <returns></returns>
|
|
|
- private static Player GetNextPlayer(this HGHuangHuangComponent self, int curPos)
|
|
|
+ private static Player GetNextPlayer(this HGHHComponent self, int curPos)
|
|
|
{
|
|
|
return self.Players[(curPos + 1) % self.GetParent<Room>().MaxNum];
|
|
|
}
|
|
@@ -1244,7 +1244,7 @@ namespace ET.Server
|
|
|
/// 清空玩家可操作动作
|
|
|
/// </summary>
|
|
|
/// <param name="self"></param>
|
|
|
- private static void CleanUserAct(this HGHuangHuangComponent self) {
|
|
|
+ private static void CleanUserAct(this HGHHComponent self) {
|
|
|
foreach (Player player in self.Players)
|
|
|
{
|
|
|
if (player != null)
|
|
@@ -1258,7 +1258,7 @@ namespace ET.Server
|
|
|
/// 胡牌结算
|
|
|
/// </summary>
|
|
|
/// <param name="self"></param>
|
|
|
- private static void SettlementHu(this HGHuangHuangComponent self)
|
|
|
+ private static void SettlementHu(this HGHHComponent self)
|
|
|
{
|
|
|
|
|
|
}
|
|
@@ -1268,7 +1268,7 @@ namespace ET.Server
|
|
|
/// </summary>
|
|
|
/// <param name="self"></param>
|
|
|
/// <param name="room"></param>
|
|
|
- private static void GameOver(this HGHuangHuangComponent self, Room room)
|
|
|
+ private static void GameOver(this HGHHComponent self, Room room)
|
|
|
{
|
|
|
self.State = 3;
|
|
|
self.Time = 60;
|