Selaa lähdekoodia

调整黄冈晃晃组件名称,太长看起来比较费劲

johnclot69 1 viikko sitten
vanhempi
commit
69a7fa367b

+ 11 - 11
DotNet/Hotfix/Helper/ProtoHelper.cs

@@ -39,17 +39,17 @@ namespace ET.Server
             info.RoomId = room.RoomId;
             info.Type = room.Type;
             info.OwnerId = room.OwnerId;
-            HGHuangHuangComponent hgHuangHuangComponent = room.GetComponent<HGHuangHuangComponent>();
-            if (hgHuangHuangComponent != null)
+            HGHHComponent hghhComponent = room.GetComponent<HGHHComponent>();
+            if (hghhComponent != null)
             {
-                info.State = hgHuangHuangComponent.State;
-                info.Time = hgHuangHuangComponent.Time;
-                info.Rand1 = hgHuangHuangComponent.Rand[0];
-                info.Rand2 = hgHuangHuangComponent.Rand[1];
-                info.CardNum = hgHuangHuangComponent.CardList.Count;
+                info.State = hghhComponent.State;
+                info.Time = hghhComponent.Time;
+                info.Rand1 = hghhComponent.Rand[0];
+                info.Rand2 = hghhComponent.Rand[1];
+                info.CardNum = hghhComponent.CardList.Count;
                 info.OpId = opPlayer?.Id ?? -1;
                 info.OpPos = opPlayer?.Pos ?? -1;
-                info.CurDisCard = hgHuangHuangComponent.DisCard;
+                info.CurDisCard = hghhComponent.DisCard;
             }
             // 本人信息
             info.MyInfo = PlayerInfoToProto(room, player, true);
@@ -86,10 +86,10 @@ namespace ET.Server
             {
                 info.cardInfo.RemainCards = new List<int>(player.RemainCards);
                 
-                HGHuangHuangComponent hgHuangHuangComponent = room.GetComponent<HGHuangHuangComponent>();
-                if (hgHuangHuangComponent != null)
+                HGHHComponent hghhComponent = room.GetComponent<HGHHComponent>();
+                if (hghhComponent != null)
                 {
-                    info.cardInfo.DrawCard = hgHuangHuangComponent.DrawCard;
+                    info.cardInfo.DrawCard = hghhComponent.DrawCard;
                 }
                 
                 info.cardInfo.Acts = player.Act.ToList();

+ 4 - 4
DotNet/Hotfix/Scenes/Game/Handler/C2G_HGHHDisCardHandler.cs

@@ -43,8 +43,8 @@ namespace ET.Server
             }
             
             // 玩家房间是否已开始
-            HGHuangHuangComponent hgHuangHuangComponent = room.GetComponent<HGHuangHuangComponent>();
-            if (hgHuangHuangComponent != null && hgHuangHuangComponent.State != 2)
+            HGHHComponent hghhComponent = room.GetComponent<HGHHComponent>();
+            if (hghhComponent != null && hghhComponent.State != 2)
             {
                 response.Error = ErrorCode.ERR_OperationError;
                 response.Message = "房间不在游戏中,不可出牌...";
@@ -70,7 +70,7 @@ namespace ET.Server
             }
             
             // 判断玩家是否可出牌
-            if (hgHuangHuangComponent.CurrentPlayer.Id != player.Id)
+            if (hghhComponent.CurrentPlayer.Id != player.Id)
             {
                 response.Error = ErrorCode.ERR_OperationError;
                 response.Message = "不是当前操作玩家,出牌错误...";
@@ -88,7 +88,7 @@ namespace ET.Server
             }
             
             // 出牌
-            hgHuangHuangComponent.DisCard(room, player, request.Card, false);
+            hghhComponent.DisCard(room, player, request.Card, false);
             
             // 返回
             reply();

+ 2 - 2
DotNet/Hotfix/Scenes/Game/Handler/C2G_HGHHKickHandler.cs

@@ -68,8 +68,8 @@ namespace ET.Server
 			}
 			
 			// 状态是否可踢人
-			HGHuangHuangComponent hgHuangHuangComponent = room.GetComponent<HGHuangHuangComponent>();
-			if (hgHuangHuangComponent != null && hgHuangHuangComponent.State != 0)
+			HGHHComponent hghhComponent = room.GetComponent<HGHHComponent>();
+			if (hghhComponent != null && hghhComponent.State != 0)
 			{
 				response.Error = ErrorCode.ERR_ParameterError;
 				response.Message = "游戏进行中,不可踢人...";

+ 8 - 8
DotNet/Hotfix/Scenes/Game/Handler/C2G_HGHHOperationHandler.cs

@@ -43,8 +43,8 @@ namespace ET.Server
             }
             
             // 玩家房间是否已开始
-            HGHuangHuangComponent hgHuangHuangComponent = room.GetComponent<HGHuangHuangComponent>();
-            if (hgHuangHuangComponent != null && hgHuangHuangComponent.State != 2)
+            HGHHComponent hghhComponent = room.GetComponent<HGHHComponent>();
+            if (hghhComponent != null && hghhComponent.State != 2)
             {
                 response.Error = ErrorCode.ERR_OperationError;
                 response.Message = "房间不在游戏中,不可操作...";
@@ -78,7 +78,7 @@ namespace ET.Server
             }
             
             // 判断玩家是否可操作
-            if (!hgHuangHuangComponent.OperableList.Contains(player.Id))
+            if (!hghhComponent.OperableList.Contains(player.Id))
             {
                 response.Error = ErrorCode.ERR_OperationError;
                 response.Message = "不可操作...";
@@ -91,19 +91,19 @@ namespace ET.Server
                 switch (request.OpType)
                 {
                     case (int)OperationType.CHI:
-                        hgHuangHuangComponent.Chi(room, player, request.Card);
+                        hghhComponent.Chi(room, player, request.Card);
                         break;
                     case (int)OperationType.PENG:
-                        hgHuangHuangComponent.Peng(room, player);
+                        hghhComponent.Peng(room, player);
                         break;
                     case (int)OperationType.GANG:
-                        hgHuangHuangComponent.Gang(room, player, request.Card);
+                        hghhComponent.Gang(room, player, request.Card);
                         break;
                     case (int)OperationType.HU:
-                        hgHuangHuangComponent.Hu(room, player);
+                        hghhComponent.Hu(room, player);
                         break;
                     case (int)OperationType.GUO:
-                        hgHuangHuangComponent.Guo(room, player);
+                        hghhComponent.Guo(room, player);
                         break;
                 }
             }

+ 2 - 2
DotNet/Hotfix/Scenes/Game/Handler/C2G_HGHHReadyHandler.cs

@@ -43,8 +43,8 @@ namespace ET.Server
             }
             
             // 玩家房间是否已开始
-            HGHuangHuangComponent hgHuangHuangComponent = room.GetComponent<HGHuangHuangComponent>();
-            if (hgHuangHuangComponent != null && hgHuangHuangComponent.State != 0)
+            HGHHComponent hghhComponent = room.GetComponent<HGHHComponent>();
+            if (hghhComponent != null && hghhComponent.State != 0)
             {
                 response.Error = ErrorCode.ERR_OperationError;
                 response.Message = "房间已开始,不可准备...";

+ 2 - 2
DotNet/Hotfix/Scenes/Game/Handler/C2G_JoinRoomHandler.cs

@@ -62,8 +62,8 @@ namespace ET.Server
             }
             
             // 房间状态是否可进入
-            HGHuangHuangComponent hgHuangHuangComponent = room.GetComponent<HGHuangHuangComponent>();
-            if (hgHuangHuangComponent != null && hgHuangHuangComponent.State != 0)
+            HGHHComponent hghhComponent = room.GetComponent<HGHHComponent>();
+            if (hghhComponent != null && hghhComponent.State != 0)
             {
                 response.Error = ErrorCode.ERR_OperationError;
                 response.Message = "房间已开始,不可进入...";

+ 30 - 30
DotNet/Hotfix/Scenes/Game/Room/HGHuangHuangComponentSystem.cs → DotNet/Hotfix/Scenes/Game/Room/HGHHComponentSystem.cs

@@ -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;

+ 2 - 2
DotNet/Hotfix/Scenes/Game/Room/RoomSystem.cs

@@ -25,7 +25,7 @@ namespace ET.Server
                 {
                     case 1:
                         // 黄冈晃晃
-                        self.AddComponent<HGHuangHuangComponent>();
+                        self.AddComponent<HGHHComponent>();
                         break;
                     case 2:
                         break;
@@ -79,7 +79,7 @@ namespace ET.Server
         public static void Add(this Room self, Player player)
         {
             self.Players.Add(player.Id, player);
-            HGHuangHuangComponent hgHuangHuangComponent = self.GetComponent<HGHuangHuangComponent>();
+            HGHHComponent hgHuangHuangComponent = self.GetComponent<HGHHComponent>();
             if (hgHuangHuangComponent == null)
             {
                 return;

+ 1 - 1
DotNet/Model/Scenes/Game/Room/HGHuangHuangComponent.cs → DotNet/Model/Scenes/Game/Room/HGHHComponent.cs

@@ -3,7 +3,7 @@
 namespace ET.Server
 {
     [ComponentOf(typeof(Room))]
-    public class HGHuangHuangComponent: Entity, IAwake, IDestroy, IUpdate
+    public class HGHHComponent: Entity, IAwake, IDestroy, IUpdate
     {
         /** 检测标记 **/
         public bool Flag { get; set; }