From 8b69478158c09e0ab0d47c9c9c5638816333a698 Mon Sep 17 00:00:00 2001 From: Timothy Liu Date: Sat, 9 Mar 2024 22:05:20 +0800 Subject: [PATCH 01/16] chore: use multiline sttring literal for welcome string --- logic/Server/Program.cs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/logic/Server/Program.cs b/logic/Server/Program.cs index 1d25457f..43623e1e 100755 --- a/logic/Server/Program.cs +++ b/logic/Server/Program.cs @@ -6,14 +6,17 @@ namespace Server { public class Program { - const string welcome = - @" + /// + /// Generated by http://www.network-science.de/ascii/ with font "standard" + /// + const string welcome = """ _____ _ _ _ _ _ ___ _____ |_ _| | | | | | | / \ |_ _|___ | | | | |_| | | | |/ _ \ | | / / | | | _ | |_| / ___ \ | | / / |_| |_| |_|\___/_/ \_\___|/_/ - "; + """; + static ServerBase CreateServer(ArgumentOptions options) { return options.Playback ? new PlaybackServer(options) : new GameServer(options); From b0a6847a2e27fbc198fea23e0c6f2f355167916a Mon Sep 17 00:00:00 2001 From: Timothy Liu Date: Sat, 9 Mar 2024 22:16:59 +0800 Subject: [PATCH 02/16] chore: use multiline sttring literal for welcome string --- logic/Server/Program.cs | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/logic/Server/Program.cs b/logic/Server/Program.cs index 43623e1e..a85fe979 100755 --- a/logic/Server/Program.cs +++ b/logic/Server/Program.cs @@ -10,11 +10,18 @@ public class Program /// Generated by http://www.network-science.de/ascii/ with font "standard" /// const string welcome = """ - _____ _ _ _ _ _ ___ _____ - |_ _| | | | | | | / \ |_ _|___ | - | | | |_| | | | |/ _ \ | | / / - | | | _ | |_| / ___ \ | | / / - |_| |_| |_|\___/_/ \_\___|/_/ + ______________ ___ ____ ___ _____ .____________ + \__ ___/ | \| | \/ _ \ | \______ \ + | | / ~ \ | / /_\ \| | / / + | | \ Y / | / | \ | / / + |____| \___|_ /|______/\____|__ /___| /____/ + \/ \/ + _________ __ __ __ + / _____// |______ _______ / \ / \_____ _______ + \_____ \\ __\__ \\_ __ \ \ \/\/ /\__ \\_ __ \ + / \| | / __ \| | \/ \ / / __ \| | \/ + /_______ /|__| (____ /__| \__/\ / (____ /__| + \/ \/ \/ \/ """; static ServerBase CreateServer(ArgumentOptions options) From c4bde78975af8c4112321ea153fdb0f69d32ba92 Mon Sep 17 00:00:00 2001 From: 964293341 Date: Sat, 9 Mar 2024 23:04:55 +0800 Subject: [PATCH 03/16] style: :art: fix autopep8 error & python code format --- CAPI/python/PyAPI/API.py | 5 +- CAPI/python/PyAPI/Communication.py | 20 +++----- CAPI/python/PyAPI/Interface.py | 6 +-- CAPI/python/PyAPI/logic.py | 82 ++++++++++++------------------ CAPI/python/PyAPI/main.py | 19 +++---- CAPI/python/PyAPI/utils.py | 16 +++--- map-generator/Python/main.py | 2 +- 7 files changed, 63 insertions(+), 87 deletions(-) diff --git a/CAPI/python/PyAPI/API.py b/CAPI/python/PyAPI/API.py index 083e84d2..9c243cad 100644 --- a/CAPI/python/PyAPI/API.py +++ b/CAPI/python/PyAPI/API.py @@ -104,8 +104,9 @@ def GetScore(self) -> int: return self.__logic.GetScore() def HaveView(self, gridX: int, gridY: int) -> bool: - return self.__logic.HaveView(gridX, gridY, self.GetSelfInfo().x, - self.GetSelfInfo().y, self.GetSelfInfo().viewRange) + return self.__logic.HaveView(gridX, gridY, + self.GetSelfInfo().x, self.GetSelfInfo().y, + self.GetSelfInfo().viewRange) def Print(self, cont: str) -> None: pass diff --git a/CAPI/python/PyAPI/Communication.py b/CAPI/python/PyAPI/Communication.py index 1a8798f5..98076bb9 100644 --- a/CAPI/python/PyAPI/Communication.py +++ b/CAPI/python/PyAPI/Communication.py @@ -33,10 +33,8 @@ def __init__(self, sIP: str, sPort: str): def Move(self, time: int, angle: float, playerID: int) -> bool: try: with self.__mtxLimit: - if ( - self.__counter >= self.__limit - or self.__counterMove >= self.__moveLimit - ): + if (self.__counter >= self.__limit + or self.__counterMove >= self.__moveLimit): return False self.__counter += 1 self.__counterMove += 1 @@ -55,8 +53,8 @@ def SendMessage(self, toID: int, message: Union[str, bytes], playerID: int, team return False self.__counter += 1 sendResult: Message2Clients.BoolRes = self.__THUAI7Stub.Send( - THUAI72Proto.THUAI72ProtobufSendMsg( - playerID, toID, teamID, message, True if isinstance(message, bytes) else False) + THUAI72Proto.THUAI72ProtobufSendMsg(playerID, toID, teamID, message, + True if isinstance(message, bytes) else False) ) except grpc.RpcError: return False @@ -136,10 +134,8 @@ def Construct(self, constructionType: THUAI7.ConstructionType, playerID: int, te def EndAllAction(self, playerID: int, teamID: int) -> bool: try: with self.__mtxLimit: - if ( - self.__counter >= self.__limit - or self.__counterMove >= self.__moveLimit - ): + if (self.__counter >= self.__limit + or self.__counterMove >= self.__moveLimit): return False self.__counter += 1 self.__counterMove += 1 @@ -158,8 +154,8 @@ def SendMessage(self, toID: int, message: Union[str, bytes], playerID: int, team return False self.__counter += 1 sendResult: Message2Clients.BoolRes = self.__THUAI7Stub.Send( - THUAI72Proto.THUAI72ProtobufSendMsg( - playerID, toID, teamID, message, True if isinstance(message, bytes) else False) + THUAI72Proto.THUAI72ProtobufSendMsg(playerID, toID, teamID, message, + True if isinstance(message, bytes) else False) ) except grpc.RpcError: return False diff --git a/CAPI/python/PyAPI/Interface.py b/CAPI/python/PyAPI/Interface.py index 8b4ef123..ed0de006 100644 --- a/CAPI/python/PyAPI/Interface.py +++ b/CAPI/python/PyAPI/Interface.py @@ -119,9 +119,7 @@ def Attack(self, angle: float) -> bool: pass @abstractmethod - def HaveView( - self, gridX: int, gridY: int, selfX: int, selfY: int, viewRange: int - ) -> bool: + def HaveView(self, gridX: int, gridY: int, selfX: int, selfY: int, viewRange: int) -> bool: pass @abstractmethod @@ -296,7 +294,7 @@ def Construct(self, constructionType: THUAI7.ConstructionType) -> Future[bool]: pass @abstractmethod - def GetSelfInfo(self) -> Union[THUAI7.Student, THUAI7.Tricker]: + def GetSelfInfo(self) -> THUAI7.Ship: pass @abstractmethod diff --git a/CAPI/python/PyAPI/logic.py b/CAPI/python/PyAPI/logic.py index 92576053..b65bb72d 100644 --- a/CAPI/python/PyAPI/logic.py +++ b/CAPI/python/PyAPI/logic.py @@ -295,10 +295,7 @@ def LoadBuffer(self, message: Message2Clients.MessageToClient) -> None: self.__LoadBufferCase(item) if Setting.asynchronous(): with self.__mtxState: - self.__currentState, self.__bufferState = ( - self.__bufferState, - self.__currentState, - ) + self.__currentState, self.__bufferState = self.__bufferState, self.__currentState self.__counterState = self.__counterBuffer self.__logger.info("Update state!") self.__freshed = True @@ -345,18 +342,14 @@ def __LoadBufferCase(self, item: Message2Clients.MessageOfObj) -> None: item.bullet_message.y, self.__bufferState.gameMap, ): - self.__bufferState.bullets.append( - Proto2THUAI7.Protobuf2THUAI7Bullet(item.bullet_message) - ) + self.__bufferState.bullets.append(Proto2THUAI7.Protobuf2THUAI7Bullet(item.bullet_message)) self.__logger.debug("Add Bullet!") elif item.WhichOneof("message_of_obj") == "factory_message": if AssistFunction.HaveView(self.__bufferState.self.viewRange, self.__bufferState.self.x, self.__bufferState.self.y, item.factory_message.x, item.factory_message.y, self.__bufferState.gameMap): - pos = ( - AssistFunction.GridToCell( - item.factory_message.x), AssistFunction.GridToCell( - item.factory_message.y)) + pos = (AssistFunction.GridToCell(item.factory_message.x), + AssistFunction.GridToCell(item.factory_message.y)) if pos not in self.__bufferState.mapInfo.factoryState: self.__bufferState.mapInfo.factoryState[pos] = item.factory_message.hp self.__logger.debug("New Factory") @@ -373,10 +366,8 @@ def __LoadBufferCase(self, item: Message2Clients.MessageOfObj) -> None: item.community_message.y, self.__bufferState.gameMap, ): - pos = ( - AssistFunction.GridToCell( - item.community_message.x), AssistFunction.GridToCell( - item.community_message.y)) + pos = (AssistFunction.GridToCell(item.community_message.x), + AssistFunction.GridToCell(item.community_message.y)) if pos not in self.__bufferState.mapInfo.communityState: self.__bufferState.mapInfo.communityState[pos] = item.community_message.hp self.__logger.debug("New Community") @@ -385,9 +376,12 @@ def __LoadBufferCase(self, item: Message2Clients.MessageOfObj) -> None: self.__logger.debug("Update Community") elif item.WhichOneof("message_of_obj") == "fort_message": - if AssistFunction.HaveView(self.__bufferState.self.viewRange, self.__bufferState.self.x, - self.__bufferState.self.y, item.fort_message.x, item.fort_message.y, self.__bufferState.gameMap): - pos = (AssistFunction.GridToCell(item.fort_message.x), AssistFunction.GridToCell(item.fort_message.y)) + if AssistFunction.HaveView(self.__bufferState.self.viewRange, + self.__bufferState.self.x, self.__bufferState.self.y, + item.fort_message.x, item.fort_message.y, + self.__bufferState.gameMap): + pos = (AssistFunction.GridToCell(item.fort_message.x), + AssistFunction.GridToCell(item.fort_message.y)) if pos not in self.__bufferState.mapInfo.fortState: self.__bufferState.mapInfo.fortState[pos] = item.fort_message.hp self.__logger.debug("New Fort") @@ -396,41 +390,38 @@ def __LoadBufferCase(self, item: Message2Clients.MessageOfObj) -> None: self.__logger.debug("Update Fort") elif item.WhichOneof("message_of_obj") == "wormhole_message": - pos = ( - AssistFunction.GridToCell( - item.wormhole_message.x), AssistFunction.GridToCell( - item.wormhole_message.y)) + pos = (AssistFunction.GridToCell(item.wormhole_message.x), + AssistFunction.GridToCell(item.wormhole_message.y)) self.__bufferState.mapInfo.wormholeState[pos] = item.wormhole_message.hp self.__logger.debug("Update Wormhole") elif item.WhichOneof("message_of_obj") == "home_message": - if AssistFunction.HaveView(self.__bufferState.self.viewRange, self.__bufferState.self.x, - self.__bufferState.self.y, item.home_message.x, item.home_message.y, self.__bufferState.gameMap): - pos = (AssistFunction.GridToCell(item.home_message.x), AssistFunction.GridToCell(item.home_message.y)) + if AssistFunction.HaveView(self.__bufferState.self.viewRange, + self.__bufferState.self.x, self.__bufferState.self.y, + item.home_message.x, item.home_message.y, + self.__bufferState.gameMap): + pos = (AssistFunction.GridToCell(item.home_message.x), + AssistFunction.GridToCell(item.home_message.y)) self.__bufferState.mapInfo.homeState[pos] = item.home_message.hp self.__logger.debug("Update Home") elif item.WhichOneof("message_of_obj") == "resource_message": - if AssistFunction.HaveView(self.__bufferState.self.viewRange, self.__bufferState.self.x, - self.__bufferState.self.y, item.resource_message.x, item.resource_message.y, self.__bufferState.gameMap): - pos = ( - AssistFunction.GridToCell( - item.resource_message.x), AssistFunction.GridToCell( - item.resource_message.y)) + if AssistFunction.HaveView(self.__bufferState.self.viewRange, + self.__bufferState.self.x, self.__bufferState.self.y, + item.resource_message.x, item.resource_message.y, + self.__bufferState.gameMap): + pos = (AssistFunction.GridToCell(item.resource_message.x), + AssistFunction.GridToCell(item.resource_message.y)) self.__bufferState.mapInfo.resourceState[pos] = item.resource_message.progress self.__logger.debug("Update Resource") elif item.WhichOneof("message_of_obj") == "news_message": if item.news_message.to_id == self.__playerID: if item.news_message.WhichOneof("news") == "text_message": - self.__messageQueue.put( - (item.news_message.from_id, item.news_message.text_message) - ) + self.__messageQueue.put((item.news_message.from_id, item.news_message.text_message)) self.__logger.debug("Add News!") elif item.news_message.WhichOneof("news") == "binary_message": - self.__messageQueue.put( - (item.news_message.from_id, item.news_message.binary_message) - ) + self.__messageQueue.put((item.news_message.from_id, item.news_message.binary_message)) self.__logger.debug("Add News!") else: self.__logger.error("Unknown News!") @@ -465,10 +456,7 @@ def __Update(self) -> None: with self.__cvBuffer: self.__cvBuffer.wait_for(lambda: self.__bufferUpdated) with self.__mtxState: - self.__bufferState, self.__currentState = ( - self.__currentState, - self.__bufferState, - ) + self.__bufferState, self.__currentState = self.__currentState, self.__bufferState self.__counterState = self.__counterBuffer self.__bufferUpdated = False self.__logger.info("Update state!") @@ -499,13 +487,9 @@ def Main( # os.path.realpath(__file__))) + "/logs") if platform.system().lower() == "windows": - os.system( - f'mkdir "{os.path.dirname(os.path.dirname(os.path.realpath(__file__)))}\\logs"' - ) + os.system(f'mkdir "{os.path.dirname(os.path.dirname(os.path.realpath(__file__)))}\\logs"') else: - os.system( - f'mkdir -p "{os.path.dirname(os.path.dirname(os.path.realpath(__file__)))}/logs"' - ) + os.system(f'mkdir -p "{os.path.dirname(os.path.dirname(os.path.realpath(__file__)))}/logs"') fileHandler = logging.FileHandler( os.path.dirname(os.path.dirname(os.path.realpath(__file__))) @@ -565,9 +549,7 @@ def AIThread(): self.__timer.EndTimer() if self.__TryConnection(): - self.__logger.info( - "Connect to the server successfully, AI thread will be started." - ) + self.__logger.info("Connect to the server successfully, AI thread will be started.") self.__threadAI = threading.Thread(target=AIThread) self.__threadAI.start() self.__ProcessMessage() diff --git a/CAPI/python/PyAPI/main.py b/CAPI/python/PyAPI/main.py index cd1180cd..1708e0d8 100644 --- a/CAPI/python/PyAPI/main.py +++ b/CAPI/python/PyAPI/main.py @@ -1,16 +1,17 @@ -import PyAPI.structures as THUAI7 -import platform -import argparse from typing import List, Callable -from PyAPI.logic import Logic -from PyAPI.AI import AI -from PyAPI.Interface import IAI +import argparse +import platform import os import sys sys.path.append(os.path.dirname(os.path.dirname(os.path.realpath(__file__)))) sys.path.append(os.path.dirname(os.path.dirname(os.path.realpath(__file__))) + "/proto") +import PyAPI.structures as THUAI7 # NOQA: E402 +from PyAPI.logic import Logic # NOQA: E402 +from PyAPI.AI import AI # NOQA: E402 +from PyAPI.Interface import IAI # NOQA: E402 + def PrintWelcomeString() -> None: # Generated by http://www.network-science.de/ascii/ with font "standard" @@ -92,11 +93,11 @@ def THUAI7Main(argv: List[str], AIBuilder: Callable) -> None: file = args.file screen = args.screen warnOnly = args.warnOnly - playerType = THUAI7.PlayerType(0) + playerType = THUAI7.PlayerType.NullPlayerType if pID == 4: - playerType = THUAI7.PlayerType(1) + playerType = THUAI7.PlayerType.Ship else: - playerType = THUAI7.PlayerType(2) + playerType = THUAI7.PlayerType.Team if platform.system().lower() == "windows": PrintWelcomeString() diff --git a/CAPI/python/PyAPI/utils.py b/CAPI/python/PyAPI/utils.py index 8b367c7f..e7a9c917 100644 --- a/CAPI/python/PyAPI/utils.py +++ b/CAPI/python/PyAPI/utils.py @@ -44,10 +44,8 @@ def HaveView( for _ in range(divide): selfX += dx selfY += dy - if ( - map[AssistFunction.GridToCell(int(selfX))][AssistFunction.GridToCell(int(selfY))] - != THUAI7.PlaceType.Shadow - ): + if (map[AssistFunction.GridToCell(int(selfX))][AssistFunction.GridToCell(int(selfY))] + != THUAI7.PlaceType.Shadow): return False else: return True @@ -55,10 +53,8 @@ def HaveView( for _ in range(divide): selfX += dx selfY += dy - if ( - map[AssistFunction.GridToCell(int(selfX))][AssistFunction.GridToCell(int(selfY))] - == THUAI7.PlaceType.Ruin - ): + if (map[AssistFunction.GridToCell(int(selfX))][AssistFunction.GridToCell(int(selfY))] + == THUAI7.PlaceType.Ruin): return False else: return True @@ -507,5 +503,7 @@ def THUAI72ProtobufPlayerMsg( ) @staticmethod - def THUAI72ProtobufRecoverMsg(playerID: int, recover: int, teamID: int) -> Message2Server.RecoverMsg: + def THUAI72ProtobufRecoverMsg( + playerID: int, recover: int, teamID: int + ) -> Message2Server.RecoverMsg: return Message2Server.RecoverMsg(player_id=playerID, team_id=teamID, recover=recover) diff --git a/map-generator/Python/main.py b/map-generator/Python/main.py index db90c938..1da807b6 100644 --- a/map-generator/Python/main.py +++ b/map-generator/Python/main.py @@ -5,7 +5,7 @@ from easygui import multenterbox -import CLR_IMPORT +import CLR_IMPORT # NOQA: E402 import SETTINGS from GameClass.MapGenerator import MapStruct from Classes.MapRenderer import MapRenderer From 9eb1391691ef5a39e5e86a2e235a065c2152affe Mon Sep 17 00:00:00 2001 From: 964293341 Date: Sun, 10 Mar 2024 14:58:46 +0800 Subject: [PATCH 04/16] fix(PyAPI): :bug: fix the mismatch between ILogic & Logic --- CAPI/python/PyAPI/Interface.py | 8 ++---- CAPI/python/PyAPI/logic.py | 49 +++++++++++++++++----------------- 2 files changed, 26 insertions(+), 31 deletions(-) diff --git a/CAPI/python/PyAPI/Interface.py b/CAPI/python/PyAPI/Interface.py index ed0de006..095f4f4a 100644 --- a/CAPI/python/PyAPI/Interface.py +++ b/CAPI/python/PyAPI/Interface.py @@ -23,11 +23,7 @@ def GetBullets(self) -> List[THUAI7.Bullet]: pass @abstractmethod - def ShipGetSelfInfo(self) -> THUAI7.Ship: - pass - - @abstractmethod - def TeamGetSelfInfo(self) -> THUAI7.Team: + def GetSelfInfo(self)->Union[THUAI7.Ship, THUAI7.Team]: pass @abstractmethod @@ -71,7 +67,7 @@ def GetScore(self) -> int: pass @abstractmethod - def Send(self, toPlayerID: int, message: str, binary: bool) -> bool: + def SendMessage(self, toID: int, message: Union[str, bytes]) -> bool: pass @abstractmethod diff --git a/CAPI/python/PyAPI/logic.py b/CAPI/python/PyAPI/logic.py index b65bb72d..bfac055e 100644 --- a/CAPI/python/PyAPI/logic.py +++ b/CAPI/python/PyAPI/logic.py @@ -18,6 +18,7 @@ class Logic(ILogic): + # TODO: Mismatch between logic.py & main.py def __init__(self, playerID: int, shipType: THUAI7.ShipType, teamID: int, x: int, y: int) -> None: self.__playerID: int = playerID self.__teamID: int = teamID @@ -42,7 +43,7 @@ def __init__(self, playerID: int, shipType: THUAI7.ShipType, teamID: int, x: int self.__counterState: int = 0 self.__counterBuffer: int = 0 - self.__gameState: THUAI7.GameState = THUAI7.GameState(0) + self.__gameState: THUAI7.GameState = THUAI7.GameState.NullGameState self.__AILoop: bool = True @@ -170,6 +171,13 @@ def GetMoney(self) -> int: return copy.deepcopy(self.__currentState.gameInfo.blueMoney if self.__teamID == 1 else self.__currentState.gameInfo.redMoney) + + def GetScore(self) -> int: + with self.__mtxState: + self.__logger.debug("Called GetScore") + return copy.deepcopy(self.__currentState.gameInfo.blueScore + if self.__teamID == 1 + else self.__currentState.gameInfo.redScore) def Attack(self, angle: float) -> int: self.__logger.debug("Called Attack") @@ -226,12 +234,12 @@ def messageThread(): self.__comm.AddPlayer(self.__playerID, self.__teamID, self.__shipType, self.__x, self.__y) self.__logger.info("Player added") - while self.__gameState != THUAI7.GameState(3): + while self.__gameState != THUAI7.GameState.GameEnd: clientMsg = self.__comm.GetMessage2Client() self.__logger.debug("Get message from server") self.__gameState = Proto2THUAI7.gameStateDict[clientMsg.game_state] - if self.__gameState == THUAI7.GameState(1): + if self.__gameState == THUAI7.GameState.GameStart: self.__logger.info("Game start!") for obj in clientMsg.obj_message: @@ -253,7 +261,7 @@ def messageThread(): self.__AILoop = True self.__UnBlockAI() - elif self.__gameState == THUAI7.GameState(2): + elif self.__gameState == THUAI7.GameState.GameRunning: # 读取玩家的GUID self.__LoadBuffer(clientMsg) else: @@ -325,29 +333,24 @@ def __LoadBufferCase(self, item: Message2Clients.MessageOfObj) -> None: if item.WhichOneof("message_of_obj") == "ship_message": if item.ship_message.team_id != self.__teamID: if AssistFunction.HaveView(self.__bufferState.self.viewRange, - self.__bufferState.self.x, - self.__bufferState.self.y, - item.ship_message.x, - item.ship_message.y, + self.__bufferState.self.x, self.__bufferState.self.y, + item.ship_message.x, item.ship_message.y, self.__bufferState.gameMap): self.__bufferState.enemyShips.append(Proto2THUAI7.Protobuf2THUAI7Ship(item.ship_message)) self.__logger.debug("Load enemy ship") elif item.WhichOneof("message_of_obj") == "bullet_message": - if AssistFunction.HaveView( - self.__bufferState.self.viewRange, - self.__bufferState.self.x, - self.__bufferState.self.y, - item.bullet_message.x, - item.bullet_message.y, - self.__bufferState.gameMap, - ): + if AssistFunction.HaveView(self.__bufferState.self.viewRange, + self.__bufferState.self.x, self.__bufferState.self.y, + item.bullet_message.x, item.bullet_message.y, + self.__bufferState.gameMap): self.__bufferState.bullets.append(Proto2THUAI7.Protobuf2THUAI7Bullet(item.bullet_message)) self.__logger.debug("Add Bullet!") elif item.WhichOneof("message_of_obj") == "factory_message": if AssistFunction.HaveView(self.__bufferState.self.viewRange, self.__bufferState.self.x, - self.__bufferState.self.y, item.factory_message.x, item.factory_message.y, self.__bufferState.gameMap): + self.__bufferState.self.y, item.factory_message.x, item.factory_message.y, + self.__bufferState.gameMap): pos = (AssistFunction.GridToCell(item.factory_message.x), AssistFunction.GridToCell(item.factory_message.y)) if pos not in self.__bufferState.mapInfo.factoryState: @@ -358,14 +361,10 @@ def __LoadBufferCase(self, item: Message2Clients.MessageOfObj) -> None: self.__logger.debug("Update Factory") elif item.WhichOneof("message_of_obj") == "community_message": - if AssistFunction.HaveView( - self.__bufferState.self.viewRange, - self.__bufferState.self.x, - self.__bufferState.self.y, - item.community_message.x, - item.community_message.y, - self.__bufferState.gameMap, - ): + if AssistFunction.HaveView(self.__bufferState.self.viewRange, + self.__bufferState.self.x, self.__bufferState.self.y, + item.community_message.x, item.community_message.y, + self.__bufferState.gameMap): pos = (AssistFunction.GridToCell(item.community_message.x), AssistFunction.GridToCell(item.community_message.y)) if pos not in self.__bufferState.mapInfo.communityState: From 76d228d955ba35ad7e729fbd942c81d770ecacdc Mon Sep 17 00:00:00 2001 From: 964293341 Date: Sun, 10 Mar 2024 15:00:24 +0800 Subject: [PATCH 05/16] style(PyAPI): :art: fix format --- CAPI/python/PyAPI/Interface.py | 2 +- CAPI/python/PyAPI/logic.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CAPI/python/PyAPI/Interface.py b/CAPI/python/PyAPI/Interface.py index 095f4f4a..bbafe3eb 100644 --- a/CAPI/python/PyAPI/Interface.py +++ b/CAPI/python/PyAPI/Interface.py @@ -23,7 +23,7 @@ def GetBullets(self) -> List[THUAI7.Bullet]: pass @abstractmethod - def GetSelfInfo(self)->Union[THUAI7.Ship, THUAI7.Team]: + def GetSelfInfo(self) -> Union[THUAI7.Ship, THUAI7.Team]: pass @abstractmethod diff --git a/CAPI/python/PyAPI/logic.py b/CAPI/python/PyAPI/logic.py index bfac055e..9f02a325 100644 --- a/CAPI/python/PyAPI/logic.py +++ b/CAPI/python/PyAPI/logic.py @@ -171,7 +171,7 @@ def GetMoney(self) -> int: return copy.deepcopy(self.__currentState.gameInfo.blueMoney if self.__teamID == 1 else self.__currentState.gameInfo.redMoney) - + def GetScore(self) -> int: with self.__mtxState: self.__logger.debug("Called GetScore") From a647cc9f2945864a9307d1c3a370dc4760aa8ce9 Mon Sep 17 00:00:00 2001 From: sigureling <1678348940@qq.com> Date: Mon, 11 Mar 2024 19:57:53 +0800 Subject: [PATCH 06/16] =?UTF-8?q?format:=E2=9A=A1=20Rename=20relative=20ob?= =?UTF-8?q?ject?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CAPI/cpp/API/include/AI.h | 4 +- CAPI/cpp/API/include/API.h | 86 +- CAPI/cpp/API/include/Communication.h | 6 +- CAPI/cpp/API/include/constants.h | 24 +- CAPI/cpp/API/include/logic.h | 18 +- CAPI/cpp/API/include/state.h | 6 +- CAPI/cpp/API/include/structures.h | 114 +- CAPI/cpp/API/include/utils.hpp | 196 +-- CAPI/cpp/API/src/AI.cpp | 12 +- CAPI/cpp/API/src/API.cpp | 98 +- CAPI/cpp/API/src/Communication.cpp | 10 +- CAPI/cpp/API/src/DebugAPI.cpp | 122 +- CAPI/cpp/API/src/logic.cpp | 244 ++-- CAPI/cpp/API/src/main.cpp | 10 +- CAPI/cpp/proto/Message2Clients.pb.cc | 1244 ++++++++--------- CAPI/cpp/proto/Message2Clients.pb.h | 1758 ++++++++++++------------ CAPI/cpp/proto/Message2Server.pb.cc | 195 +-- CAPI/cpp/proto/Message2Server.pb.h | 190 +-- CAPI/cpp/proto/MessageType.pb.cc | 95 +- CAPI/cpp/proto/MessageType.pb.h | 104 +- CAPI/cpp/proto/Services.grpc.pb.cc | 32 +- CAPI/cpp/proto/Services.grpc.pb.h | 124 +- CAPI/cpp/proto/Services.pb.cc | 11 +- dependency/proto/Message2Clients.proto | 32 +- dependency/proto/Message2Server.proto | 6 +- dependency/proto/MessageType.proto | 32 +- dependency/proto/Services.proto | 2 +- 27 files changed, 2390 insertions(+), 2385 deletions(-) diff --git a/CAPI/cpp/API/include/AI.h b/CAPI/cpp/API/include/AI.h index 53ffd995..10e1a669 100755 --- a/CAPI/cpp/API/include/AI.h +++ b/CAPI/cpp/API/include/AI.h @@ -13,7 +13,7 @@ class IAI public: virtual ~IAI() = default; IAI() = default; - virtual void play(IShipAPI& api) = 0; + virtual void play(ISweeperAPI& api) = 0; virtual void play(ITeamAPI& api) = 0; }; @@ -27,7 +27,7 @@ class AI : public IAI playerID(pID) { } - void play(IShipAPI& api) override; + void play(ISweeperAPI& api) override; void play(ITeamAPI& api) override; private: diff --git a/CAPI/cpp/API/include/API.h b/CAPI/cpp/API/include/API.h index 4f447ed1..3fcc50bd 100755 --- a/CAPI/cpp/API/include/API.h +++ b/CAPI/cpp/API/include/API.h @@ -36,18 +36,18 @@ class ILogic public: // 获取服务器发来的消息 - [[nodiscard]] virtual std::vector> GetShips() const = 0; - [[nodiscard]] virtual std::vector> GetEnemyShips() const = 0; + [[nodiscard]] virtual std::vector> GetSweepers() const = 0; + [[nodiscard]] virtual std::vector> GetEnemySweepers() const = 0; [[nodiscard]] virtual std::vector> GetBullets() const = 0; - [[nodiscard]] virtual std::shared_ptr ShipGetSelfInfo() const = 0; + [[nodiscard]] virtual std::shared_ptr SweeperGetSelfInfo() const = 0; [[nodiscard]] virtual std::shared_ptr TeamGetSelfInfo() const = 0; [[nodiscard]] virtual std::vector> GetFullMap() const = 0; [[nodiscard]] virtual std::shared_ptr GetGameInfo() const = 0; [[nodiscard]] virtual std::vector GetPlayerGUIDs() const = 0; [[nodiscard]] virtual THUAI7::PlaceType GetPlaceType(int32_t cellX, int32_t cellY) const = 0; [[nodiscard]] virtual int32_t GetConstructionHp(int32_t cellX, int32_t cellY) const = 0; - [[nodiscard]] virtual int32_t GetWormHp(int32_t cellX, int32_t cellY) const = 0; - [[nodiscard]] virtual int32_t GetResourceState(int32_t cellX, int32_t cellY) const = 0; + [[nodiscard]] virtual int32_t GetBridgeHp(int32_t cellX, int32_t cellY) const = 0; + [[nodiscard]] virtual int32_t GetGarbageState(int32_t cellX, int32_t cellY) const = 0; [[nodiscard]] virtual int32_t GetHomeHp() const = 0; [[nodiscard]] virtual int32_t GetMoney() const = 0; [[nodiscard]] virtual int32_t GetScore() const = 0; @@ -60,7 +60,7 @@ class ILogic virtual int32_t GetCounter() const = 0; virtual bool EndAllAction() = 0; - // IShipAPI使用的部分 + // ISweeperAPI使用的部分 virtual bool Move(int64_t time, double angle) = 0; virtual bool Recover() = 0; virtual bool Produce() = 0; @@ -72,7 +72,7 @@ class ILogic // Team使用的部分 virtual bool Recycle(int64_t playerID) = 0; virtual bool InstallModule(int64_t playerID, THUAI7::ModuleType moduleType) = 0; - virtual bool BuildShip(THUAI7::ShipType shipType, int32_t cellX, int32_t cellY) = 0; + virtual bool BuildSweeper(THUAI7::SweeperType SweeperType, int32_t cellX, int32_t cellY) = 0; }; class IAPI @@ -91,15 +91,15 @@ class IAPI // 等待下一帧 virtual bool Wait() = 0; virtual std::future EndAllAction() = 0; - [[nodiscard]] virtual std::vector> GetShips() const = 0; - [[nodiscard]] virtual std::vector> GetEnemyShips() const = 0; + [[nodiscard]] virtual std::vector> GetSweepers() const = 0; + [[nodiscard]] virtual std::vector> GetEnemySweepers() const = 0; [[nodiscard]] virtual std::vector> GetBullets() const = 0; [[nodiscard]] virtual std::vector> GetFullMap() const = 0; [[nodiscard]] virtual std::shared_ptr GetGameInfo() const = 0; [[nodiscard]] virtual THUAI7::PlaceType GetPlaceType(int32_t cellX, int32_t cellY) const = 0; [[nodiscard]] virtual int32_t GetConstructionHp(int32_t cellX, int32_t cellY) const = 0; - [[nodiscard]] virtual int32_t GetWormHp(int32_t cellX, int32_t cellY) const = 0; - [[nodiscard]] virtual int32_t GetResourceState(int32_t cellX, int32_t cellY) const = 0; + [[nodiscard]] virtual int32_t GetBridgeHp(int32_t cellX, int32_t cellY) const = 0; + [[nodiscard]] virtual int32_t GetGarbageState(int32_t cellX, int32_t cellY) const = 0; [[nodiscard]] virtual int32_t GetHomeHp() const = 0; [[nodiscard]] virtual int32_t GetMoney() const = 0; [[nodiscard]] virtual int32_t GetScore() const = 0; @@ -122,12 +122,12 @@ class IAPI // 用于DEBUG的输出函数,选手仅在开启Debug模式的情况下可以使用 virtual void Print(std::string str) const = 0; - virtual void PrintShip() const = 0; + virtual void PrintSweeper() const = 0; virtual void PrintTeam() const = 0; virtual void PrintSelfInfo() const = 0; }; -class IShipAPI : public IAPI +class ISweeperAPI : public IAPI { public: virtual std::future Move(int64_t timeInMilliseconds, double angleInRadian) = 0; @@ -141,7 +141,7 @@ class IShipAPI : public IAPI virtual std::future Produce() = 0; virtual std::future Rebuild(THUAI7::ConstructionType constructionType) = 0; virtual std::future Construct(THUAI7::ConstructionType constructionType) = 0; - virtual std::shared_ptr GetSelfInfo() const = 0; + virtual std::shared_ptr GetSelfInfo() const = 0; virtual bool HaveView(int32_t gridX, int32_t gridY) const = 0; }; @@ -151,7 +151,7 @@ class ITeamAPI : public IAPI [[nodiscard]] virtual std::shared_ptr GetSelfInfo() const = 0; virtual std::future InstallModule(int64_t playerID, THUAI7::ModuleType moduletype) = 0; virtual std::future Recycle(int64_t playerID) = 0; - virtual std::future BuildShip(THUAI7::ShipType shipType, int32_t cellX, int32_t cellY) = 0; + virtual std::future BuildSweeper(THUAI7::SweeperType SweeperType, int32_t cellX, int32_t cellY) = 0; }; class IGameTimer @@ -163,10 +163,10 @@ class IGameTimer virtual void Play(IAI& ai) = 0; }; -class ShipAPI : public IShipAPI, public IGameTimer +class SweeperAPI : public ISweeperAPI, public IGameTimer { public: - ShipAPI(ILogic& logic) : + SweeperAPI(ILogic& logic) : logic(logic) { } @@ -198,25 +198,25 @@ class ShipAPI : public IShipAPI, public IGameTimer std::future Rebuild(THUAI7::ConstructionType constructionType) override; std::future Construct(THUAI7::ConstructionType constructionType) override; - [[nodiscard]] std::vector> GetShips() const override; - [[nodiscard]] std::vector> GetEnemyShips() const override; + [[nodiscard]] std::vector> GetSweepers() const override; + [[nodiscard]] std::vector> GetEnemySweepers() const override; [[nodiscard]] std::vector> GetBullets() const override; [[nodiscard]] std::vector> GetFullMap() const override; [[nodiscard]] THUAI7::PlaceType GetPlaceType(int32_t cellX, int32_t cellY) const override; [[nodiscard]] int32_t GetConstructionHp(int32_t cellX, int32_t cellY) const override; - [[nodiscard]] int32_t GetWormHp(int32_t x, int32_t y) const override; - [[nodiscard]] int32_t GetResourceState(int32_t cellX, int32_t cellY) const override; + [[nodiscard]] int32_t GetBridgeHp(int32_t x, int32_t y) const override; + [[nodiscard]] int32_t GetGarbageState(int32_t cellX, int32_t cellY) const override; [[nodiscard]] int32_t GetHomeHp() const override; [[nodiscard]] std::shared_ptr GetGameInfo() const override; [[nodiscard]] std::vector GetPlayerGUIDs() const override; - [[nodiscard]] std::shared_ptr GetSelfInfo() const override; + [[nodiscard]] std::shared_ptr GetSelfInfo() const override; [[nodiscard]] bool HaveView(int32_t gridX, int32_t gridY) const override; [[nodiscard]] int32_t GetMoney() const override; [[nodiscard]] int32_t GetScore() const override; void Print(std::string str) const { } - void PrintShip() const + void PrintSweeper() const { } void PrintTeam() const @@ -254,14 +254,14 @@ class TeamAPI : public ITeamAPI, public IGameTimer bool Wait() override; std::future EndAllAction() override; - [[nodiscard]] std::vector> GetShips() const override; - [[nodiscard]] std::vector> GetEnemyShips() const override; + [[nodiscard]] std::vector> GetSweepers() const override; + [[nodiscard]] std::vector> GetEnemySweepers() const override; [[nodiscard]] std::vector> GetBullets() const override; [[nodiscard]] std::vector> GetFullMap() const override; [[nodiscard]] THUAI7::PlaceType GetPlaceType(int32_t cellX, int32_t cellY) const override; [[nodiscard]] int32_t GetConstructionHp(int32_t cellX, int32_t cellY) const override; - [[nodiscard]] int32_t GetWormHp(int32_t x, int32_t y) const override; - [[nodiscard]] int32_t GetResourceState(int32_t cellX, int32_t cellY) const override; + [[nodiscard]] int32_t GetBridgeHp(int32_t x, int32_t y) const override; + [[nodiscard]] int32_t GetGarbageState(int32_t cellX, int32_t cellY) const override; [[nodiscard]] int32_t GetHomeHp() const override; [[nodiscard]] std::shared_ptr GetGameInfo() const override; [[nodiscard]] std::vector GetPlayerGUIDs() const override; @@ -271,11 +271,11 @@ class TeamAPI : public ITeamAPI, public IGameTimer [[nodiscard]] int32_t GetMoney() const override; std::future InstallModule(int64_t playerID, THUAI7::ModuleType moduleType) override; std::future Recycle(int64_t playerID) override; - std::future BuildShip(THUAI7::ShipType shipType, int32_t cellX, int32_t cellY) override; + std::future BuildSweeper(THUAI7::SweeperType SweeperType, int32_t cellX, int32_t cellY) override; void Print(std::string str) const { } - void PrintShip() const + void PrintSweeper() const { } void PrintTeam() const @@ -289,10 +289,10 @@ class TeamAPI : public ITeamAPI, public IGameTimer ILogic& logic; }; -class ShipDebugAPI : public IShipAPI, public IGameTimer +class SweeperDebugAPI : public ISweeperAPI, public IGameTimer { public: - ShipDebugAPI(ILogic& logic, bool file, bool print, bool warnOnly, int64_t shipID); + SweeperDebugAPI(ILogic& logic, bool file, bool print, bool warnOnly, int64_t SweeperID); void StartTimer() override; void EndTimer() override; void Play(IAI& ai) override; @@ -315,24 +315,24 @@ class ShipDebugAPI : public IShipAPI, public IGameTimer std::future Rebuild(THUAI7::ConstructionType constructionType) override; std::future Construct(THUAI7::ConstructionType constructionType) override; - [[nodiscard]] std::vector> GetShips() const override; - [[nodiscard]] std::vector> GetEnemyShips() const override; + [[nodiscard]] std::vector> GetSweepers() const override; + [[nodiscard]] std::vector> GetEnemySweepers() const override; [[nodiscard]] std::vector> GetBullets() const override; [[nodiscard]] std::vector> GetFullMap() const override; [[nodiscard]] THUAI7::PlaceType GetPlaceType(int32_t cellX, int32_t cellY) const override; [[nodiscard]] int32_t GetConstructionHp(int32_t cellX, int32_t cellY) const override; - [[nodiscard]] int32_t GetWormHp(int32_t x, int32_t y) const override; - [[nodiscard]] int32_t GetResourceState(int32_t cellX, int32_t cellY) const override; + [[nodiscard]] int32_t GetBridgeHp(int32_t x, int32_t y) const override; + [[nodiscard]] int32_t GetGarbageState(int32_t cellX, int32_t cellY) const override; [[nodiscard]] int32_t GetHomeHp() const override; [[nodiscard]] std::shared_ptr GetGameInfo() const override; [[nodiscard]] std::vector GetPlayerGUIDs() const override; - [[nodiscard]] std::shared_ptr GetSelfInfo() const override; + [[nodiscard]] std::shared_ptr GetSelfInfo() const override; [[nodiscard]] bool HaveView(int32_t gridX, int32_t gridY) const override; [[nodiscard]] int32_t GetMoney() const override; [[nodiscard]] int32_t GetScore() const override; void Print(std::string str) const override; - void PrintShip() const override; + void PrintSweeper() const override; void PrintSelfInfo() const override; void PrintTeam() const { @@ -361,14 +361,14 @@ class TeamDebugAPI : public ITeamAPI, public IGameTimer bool Wait() override; std::future EndAllAction() override; - [[nodiscard]] std::vector> GetShips() const override; - [[nodiscard]] std::vector> GetEnemyShips() const override; + [[nodiscard]] std::vector> GetSweepers() const override; + [[nodiscard]] std::vector> GetEnemySweepers() const override; [[nodiscard]] std::vector> GetBullets() const override; [[nodiscard]] std::vector> GetFullMap() const override; [[nodiscard]] THUAI7::PlaceType GetPlaceType(int32_t cellX, int32_t cellY) const override; [[nodiscard]] int32_t GetConstructionHp(int32_t cellX, int32_t cellY) const override; - [[nodiscard]] int32_t GetWormHp(int32_t x, int32_t y) const override; - [[nodiscard]] int32_t GetResourceState(int32_t cellX, int32_t cellY) const override; + [[nodiscard]] int32_t GetBridgeHp(int32_t x, int32_t y) const override; + [[nodiscard]] int32_t GetGarbageState(int32_t cellX, int32_t cellY) const override; [[nodiscard]] int32_t GetHomeHp() const override; [[nodiscard]] std::shared_ptr GetGameInfo() const override; [[nodiscard]] std::vector GetPlayerGUIDs() const override; @@ -378,14 +378,14 @@ class TeamDebugAPI : public ITeamAPI, public IGameTimer [[nodiscard]] int32_t GetMoney() const override; std::future InstallModule(int64_t playerID, THUAI7::ModuleType moduleType) override; std::future Recycle(int64_t playerID) override; - std::future BuildShip(THUAI7::ShipType shipType, int32_t cellX, int32_t cellY) override; + std::future BuildSweeper(THUAI7::SweeperType SweeperType, int32_t cellX, int32_t cellY) override; void Print(std::string str) const override; void PrintSelfInfo() const override; // TODO void PrintTeam() const { } - void PrintShip() const + void PrintSweeper() const { } diff --git a/CAPI/cpp/API/include/Communication.h b/CAPI/cpp/API/include/Communication.h index 9ae1036a..7f111626 100755 --- a/CAPI/cpp/API/include/Communication.h +++ b/CAPI/cpp/API/include/Communication.h @@ -29,9 +29,9 @@ class Communication } bool TryConnection(int64_t playerID, int64_t teamID); protobuf::MessageToClient GetMessage2Client(); - void AddPlayer(int64_t playerID, int64_t teamID, THUAI7::ShipType shipType, int32_t x, int32_t y); + void AddPlayer(int64_t playerID, int64_t teamID, THUAI7::SweeperType SweeperType, int32_t x, int32_t y); bool EndAllAction(int64_t playerID, int64_t teamID); - // Ship + // Sweeper bool Move(int64_t playerID, int64_t teamID, int64_t time, double angle); bool Recover(int64_t playerID, int64_t recover, int64_t teamID); bool Produce(int64_t playerID, int64_t teamID); @@ -41,7 +41,7 @@ class Communication bool Send(int64_t playerID, int64_t toPlayerID, int64_t teamID, std::string message, bool binary); // Team bool InstallModule(int64_t playerID, int64_t teamID, THUAI7::ModuleType moduleType); - bool BuildShip(int64_t teamID, THUAI7::ShipType shipType, int32_t x, int32_t y); + bool BuildSweeper(int64_t teamID, THUAI7::SweeperType SweeperType, int32_t x, int32_t y); bool Recycle(int64_t playerID, int64_t teamID); private: diff --git a/CAPI/cpp/API/include/constants.h b/CAPI/cpp/API/include/constants.h index 733c2627..295ce47c 100755 --- a/CAPI/cpp/API/include/constants.h +++ b/CAPI/cpp/API/include/constants.h @@ -14,11 +14,11 @@ namespace Constants { SCCI int32_t frameDuration = 50; // 每帧毫秒数 // 地图相关 - SCCI int32_t numOfGridPerCell = 1000; // 单位坐标数 - SCCI int32_t rows = 50; // 地图行数 - SCCI int32_t cols = 50; // 地图列数 - SCCI int32_t maxResourceProgress = 200; // 大门最大进度 - SCCI int32_t maxWormholeHp = 18000; + SCCI int32_t numOfGridPerCell = 1000; // 单位坐标数 + SCCI int32_t rows = 50; // 地图行数 + SCCI int32_t cols = 50; // 地图列数 + SCCI int32_t maxGarbageProgress = 200; // 大门最大进度 + SCCI int32_t maxBridgeHp = 18000; SCCI double robPercent = 0.2; // 击杀获得经济比率 SCCI int32_t DestroyBuildingBonus = 200; SCCI double recoverMultiplier = 1.2; @@ -28,16 +28,16 @@ namespace Constants SCCI int32_t maxHp = 24000; SCCI int32_t moneySpeed = 1; }; - struct Factory + struct RecycleBank { SCCI int32_t maxHp = 8000; SCCI int32_t moneySpeed = 3; }; - struct Community + struct ChargeStation { SCCI int32_t maxHp = 6000; }; - struct Fort + struct SignalTower { SCCI int32_t maxHp = 12000; SCCI int32_t attackRange = 8000; @@ -45,8 +45,8 @@ namespace Constants }; // 船 - SCCI int32_t sizeofShip = 800; - struct CivilianShip + SCCI int32_t sizeofSweeper = 800; + struct CivilianSweeper { SCCI int32_t maxHp = 3000; SCCI int32_t basicArmor = 0; @@ -54,7 +54,7 @@ namespace Constants SCCI int32_t Speed = 3000; SCCI int32_t Cost = 40; }; - struct MilitaryShip + struct MilitarySweeper { SCCI int32_t maxHp = 4000; SCCI int32_t basicArmor = 400; @@ -62,7 +62,7 @@ namespace Constants SCCI int32_t Speed = 2800; SCCI int32_t Cost = 120; }; - struct FlagShip + struct FlagSweeper { SCCI int32_t maxHp = 12000; SCCI int32_t basicArmor = 800; diff --git a/CAPI/cpp/API/include/logic.h b/CAPI/cpp/API/include/logic.h index 70c73b81..a79e9fcd 100755 --- a/CAPI/cpp/API/include/logic.h +++ b/CAPI/cpp/API/include/logic.h @@ -50,7 +50,7 @@ class Logic : public ILogic int64_t playerID; int64_t teamID; THUAI7::PlayerTeam playerTeam; - THUAI7::ShipType shipType; + THUAI7::SweeperType SweeperType; std::unique_ptr timer; std::thread tAI; // 用于运行AI的线程 @@ -89,18 +89,18 @@ class Logic : public ILogic // 提供给API使用的函数 - [[nodiscard]] std::vector> GetShips() const; - [[nodiscard]] std::vector> GetEnemyShips() const; + [[nodiscard]] std::vector> GetSweepers() const; + [[nodiscard]] std::vector> GetEnemySweepers() const; [[nodiscard]] std::vector> GetBullets() const; - [[nodiscard]] std::shared_ptr ShipGetSelfInfo() const; + [[nodiscard]] std::shared_ptr SweeperGetSelfInfo() const; [[nodiscard]] std::shared_ptr TeamGetSelfInfo() const; [[nodiscard]] std::vector> GetFullMap() const; [[nodiscard]] std::shared_ptr GetGameInfo() const; [[nodiscard]] THUAI7::PlaceType GetPlaceType(int32_t cellX, int32_t cellY) const; [[nodiscard]] std::vector GetPlayerGUIDs() const; [[nodiscard]] int32_t GetConstructionHp(int32_t cellX, int32_t cellY) const; - [[nodiscard]] int32_t GetWormHp(int32_t cellX, int32_t cellY) const; - [[nodiscard]] int32_t GetResourceState(int32_t cellX, int32_t cellY) const; + [[nodiscard]] int32_t GetBridgeHp(int32_t cellX, int32_t cellY) const; + [[nodiscard]] int32_t GetGarbageState(int32_t cellX, int32_t cellY) const; [[nodiscard]] int32_t GetHomeHp() const; [[nodiscard]] int32_t GetMoney() const; [[nodiscard]] int32_t GetScore() const; @@ -113,7 +113,7 @@ class Logic : public ILogic int32_t GetCounter() const; bool EndAllAction(); - // IShipAPI使用的部分 + // ISweeperAPI使用的部分 bool Move(int64_t time, double angle); bool Recover(); bool Produce(); @@ -125,7 +125,7 @@ class Logic : public ILogic // ITeamAPI bool Recycle(int64_t playerID); bool InstallModule(int64_t playerID, THUAI7::ModuleType moduleType); - bool BuildShip(THUAI7::ShipType shipType, int32_t cellX, int32_t cellY); + bool BuildSweeper(THUAI7::SweeperType SweeperType, int32_t cellX, int32_t cellY); bool TryConnection(); void ProcessMessage(); @@ -146,7 +146,7 @@ class Logic : public ILogic public: // 构造函数还需要传更多参数,有待补充 - Logic(int64_t playerID, int64_t teamID, THUAI7::PlayerType playerType, THUAI7::ShipType shipType); + Logic(int64_t playerID, int64_t teamID, THUAI7::PlayerType playerType, THUAI7::SweeperType SweeperType); ~Logic() { diff --git a/CAPI/cpp/API/include/state.h b/CAPI/cpp/API/include/state.h index e7badfe6..c31ef82d 100755 --- a/CAPI/cpp/API/include/state.h +++ b/CAPI/cpp/API/include/state.h @@ -17,10 +17,10 @@ struct State { // 自身信息,根据playerType的不同,可以调用的值也不同。 - std::shared_ptr shipSelf; + std::shared_ptr SweeperSelf; std::shared_ptr teamSelf; - std::vector> ships; - std::vector> enemyShips; + std::vector> Sweepers; + std::vector> enemySweepers; std::shared_ptr enemyTeam; std::vector> bullets; diff --git a/CAPI/cpp/API/include/structures.h b/CAPI/cpp/API/include/structures.h index aa7a67c4..6160a356 100755 --- a/CAPI/cpp/API/include/structures.h +++ b/CAPI/cpp/API/include/structures.h @@ -30,13 +30,13 @@ namespace THUAI7 { NullPlaceType = 0, Home = 1, - Space = 2, - Ruin = 3, - Shadow = 4, - Asteroid = 5, - Resource = 6, + Ground = 2, + Wall = 3, + Grass = 4, + River = 5, + Garbage = 6, Construction = 7, - Wormhole = 8, + Bridge = 8, }; // 形状标志 @@ -57,16 +57,16 @@ namespace THUAI7 enum class PlayerType : unsigned char { NullPlayerType = 0, - Ship = 1, + Sweeper = 1, Team = 2, }; - enum class ShipType : unsigned char + enum class SweeperType : unsigned char { - NullShipType = 0, - CivilianShip = 1, - MilitaryShip = 2, - FlagShip = 3, + NullSweeperType = 0, + CivilianSweeper = 1, + MilitarySweeper = 2, + FlagSweeper = 3, }; enum class WeaponType : unsigned char @@ -133,7 +133,7 @@ namespace THUAI7 ModuleArcGun = 17, }; - enum class ShipState : unsigned char + enum class SweeperState : unsigned char { NullStatus = 0, Idle = 1, @@ -160,22 +160,22 @@ namespace THUAI7 enum class ConstructionType : unsigned char { NullConstructionType = 0, - Factory = 1, - Community = 2, - Fort = 3, + RecycleBank = 1, + ChargeStation = 2, + SignalTower = 3, }; enum class MessageOfObj : unsigned char { NullMessageOfObj = 0, - ShipMessage = 1, + SweeperMessage = 1, BulletMessage = 2, - FactoryMessage = 3, - CommunityMessage = 4, - FortMessage = 5, - WormholeMessage = 6, + RecycleBankMessage = 3, + ChargeStationMessage = 4, + SignalTowerMessage = 5, + BridgeMessage = 6, HomeMessage = 7, - ResourceMessage = 8, + GarbageMessage = 8, MapMessage = 9, NewsMessage = 10, BombedBulletMessage = 11, @@ -189,7 +189,7 @@ namespace THUAI7 BinaryMessage = 2, }; - struct Ship + struct Sweeper { int32_t x; // x坐标 int32_t y; // y坐标 @@ -199,9 +199,9 @@ namespace THUAI7 int32_t shield; // 护盾 int64_t playerID; // 船的id int64_t teamID; - int64_t guid; // 全局唯一ID - ShipState shipState; // 船所处状态 - ShipType shipType; + int64_t guid; // 全局唯一ID + SweeperState sweeperState; // 船所处状态 + SweeperType sweeperType; int32_t viewRange; ProducerType producerType; ConstructorType constructorType; @@ -256,12 +256,12 @@ namespace THUAI7 struct GameMap { // x,y,id,hp - std::map, std::pair> factoryState; - std::map, std::pair> communityState; - std::map, std::pair> fortState; + std::map, std::pair> recycleBankState; + std::map, std::pair> chargeStationState; + std::map, std::pair> signalTowerState; std::map, std::pair> HomeState; - std::map, int32_t> wormholeState; - std::map, int32_t> resourceState; + std::map, int32_t> bridgeState; + std::map, int32_t> garbageState; }; struct GameInfo @@ -285,23 +285,23 @@ namespace THUAI7 {GameState::GameEnd, "GameEnd"}, }; - inline std::map shipTypeDict{ - {ShipType::NullShipType, "NullShipType"}, - {ShipType::CivilianShip, "CivilianShip"}, - {ShipType::MilitaryShip, "MilitaryShip"}, - {ShipType::FlagShip, "FlagShip"}, + inline std::map SweeperTypeDict{ + {SweeperType::NullSweeperType, "NullSweeperType"}, + {SweeperType::CivilianSweeper, "CivilianSweeper"}, + {SweeperType::MilitarySweeper, "MilitarySweeper"}, + {SweeperType::FlagSweeper, "FlagSweeper"}, }; - inline std::map shipStateDict{ - {ShipState::NullStatus, "NullState"}, - {ShipState::Idle, "Idle"}, - {ShipState::Producing, "Producing"}, - {ShipState::Constructing, "Constructing"}, - {ShipState::Recovering, "Recoverying"}, - {ShipState::Recycling, "Recycling"}, - {ShipState::Attacking, "Attacking"}, - {ShipState::Swinging, "Swinging"}, - {ShipState::Stunned, "Stunned"}, + inline std::map sweeperStateDict{ + {SweeperState::NullStatus, "NullState"}, + {SweeperState::Idle, "Idle"}, + {SweeperState::Producing, "Producing"}, + {SweeperState::Constructing, "Constructing"}, + {SweeperState::Recovering, "Recoverying"}, + {SweeperState::Recycling, "Recycling"}, + {SweeperState::Attacking, "Attacking"}, + {SweeperState::Swinging, "Swinging"}, + {SweeperState::Stunned, "Stunned"}, }; inline std::map playerTeamDict{ @@ -313,11 +313,11 @@ namespace THUAI7 inline std::map placeTypeDict{ {PlaceType::NullPlaceType, "NullPlaceType"}, {PlaceType::Home, "Home"}, - {PlaceType::Space, "Space"}, - {PlaceType::Ruin, "Ruin"}, - {PlaceType::Shadow, "Shadow"}, - {PlaceType::Asteroid, "Asteroid"}, - {PlaceType::Resource, "Resource"}, + {PlaceType::Ground, "Ground"}, + {PlaceType::Wall, "Wall"}, + {PlaceType::Grass, "Grass"}, + {PlaceType::River, "River"}, + {PlaceType::Garbage, "Garbage"}, {PlaceType::Construction, "Construction"}, }; @@ -332,14 +332,14 @@ namespace THUAI7 inline std::map messageOfObjDict{ {MessageOfObj::NullMessageOfObj, "NullMessageOfObj"}, - {MessageOfObj::ShipMessage, "ShipMessage"}, + {MessageOfObj::SweeperMessage, "SweeperMessage"}, {MessageOfObj::BulletMessage, "BulletMessage"}, - {MessageOfObj::FactoryMessage, "FactoryMessage"}, - {MessageOfObj::CommunityMessage, "CommunityMessage"}, - {MessageOfObj::FortMessage, "FortMessage"}, - {MessageOfObj::WormholeMessage, "WormholeMessage"}, + {MessageOfObj::RecycleBankMessage, "RecycleBankMessage"}, + {MessageOfObj::ChargeStationMessage, "ChargeStationMessage"}, + {MessageOfObj::SignalTowerMessage, "SignalTowerMessage"}, + {MessageOfObj::BridgeMessage, "BridgeMessage"}, {MessageOfObj::HomeMessage, "HomeMessage"}, - {MessageOfObj::ResourceMessage, "ResourceMessage"}, + {MessageOfObj::GarbageMessage, "GarbageMessage"}, {MessageOfObj::MapMessage, "MapMessage"}, {MessageOfObj::NewsMessage, "NewsMessage"}, {MessageOfObj::BombedBulletMessage, "BombedBulletMessage"}, diff --git a/CAPI/cpp/API/include/utils.hpp b/CAPI/cpp/API/include/utils.hpp index 8e058bc3..c0ad1cc9 100755 --- a/CAPI/cpp/API/include/utils.hpp +++ b/CAPI/cpp/API/include/utils.hpp @@ -39,7 +39,7 @@ namespace AssistFunction double distance = deltaX * deltaX + deltaY * deltaY; THUAI7::PlaceType myPlace = map[GridToCell(x)][GridToCell(y)]; THUAI7::PlaceType newPlace = map[GridToCell(newX)][GridToCell(newY)]; - if (newPlace == THUAI7::PlaceType::Shadow && myPlace != THUAI7::PlaceType::Shadow) + if (newPlace == THUAI7::PlaceType::Grass && myPlace != THUAI7::PlaceType::Grass) return false; int32_t divide = std::max(std::abs(deltaX), std::abs(deltaY)) / 100; if (divide == 0) @@ -48,12 +48,12 @@ namespace AssistFunction double dy = deltaY / divide; double myX = double(x); double myY = double(y); - if (newPlace == THUAI7::PlaceType::Shadow && myPlace == THUAI7::PlaceType::Shadow) + if (newPlace == THUAI7::PlaceType::Grass && myPlace == THUAI7::PlaceType::Grass) for (int32_t i = 0; i < divide; i++) { myX += dx; myY += dy; - if (map[GridToCell(myX)][GridToCell(myY)] != THUAI7::PlaceType::Shadow) + if (map[GridToCell(myX)][GridToCell(myY)] != THUAI7::PlaceType::Grass) return false; } else @@ -61,7 +61,7 @@ namespace AssistFunction { myX += dx; myY += dy; - if (map[GridToCell(myX)][GridToCell(myY)] == THUAI7::PlaceType::Ruin) + if (map[GridToCell(myX)][GridToCell(myY)] == THUAI7::PlaceType::Wall) return false; } return true; @@ -82,13 +82,13 @@ namespace Proto2THUAI7 inline std::map placeTypeDict{ {protobuf::PlaceType::NULL_PLACE_TYPE, THUAI7::PlaceType::NullPlaceType}, {protobuf::PlaceType::HOME, THUAI7::PlaceType::Home}, - {protobuf::PlaceType::SPACE, THUAI7::PlaceType::Space}, - {protobuf::PlaceType::RUIN, THUAI7::PlaceType::Ruin}, - {protobuf::PlaceType::SHADOW, THUAI7::PlaceType::Shadow}, - {protobuf::PlaceType::ASTEROID, THUAI7::PlaceType::Asteroid}, - {protobuf::PlaceType::RESOURCE, THUAI7::PlaceType::Resource}, + {protobuf::PlaceType::GROUND, THUAI7::PlaceType::Ground}, + {protobuf::PlaceType::WALL, THUAI7::PlaceType::Wall}, + {protobuf::PlaceType::GRASS, THUAI7::PlaceType::Grass}, + {protobuf::PlaceType::RIVER, THUAI7::PlaceType::River}, + {protobuf::PlaceType::GARBAGE, THUAI7::PlaceType::Garbage}, {protobuf::PlaceType::CONSTRUCTION, THUAI7::PlaceType::Construction}, - {protobuf::PlaceType::WORMHOLE, THUAI7::PlaceType::Wormhole}, + {protobuf::PlaceType::BRIDGE, THUAI7::PlaceType::Bridge}, }; inline std::map shapeTypeDict{ @@ -99,28 +99,28 @@ namespace Proto2THUAI7 inline std::map playerTypeDict{ {protobuf::PlayerType::NULL_PLAYER_TYPE, THUAI7::PlayerType::NullPlayerType}, - {protobuf::PlayerType::SHIP, THUAI7::PlayerType::Ship}, + {protobuf::PlayerType::SWEEPER, THUAI7::PlayerType::Sweeper}, {protobuf::PlayerType::TEAM, THUAI7::PlayerType::Team}, }; - inline std::map shipTypeDict{ - {protobuf::ShipType::NULL_SHIP_TYPE, THUAI7::ShipType::NullShipType}, - {protobuf::ShipType::CIVILIAN_SHIP, THUAI7::ShipType::CivilianShip}, - {protobuf::ShipType::MILITARY_SHIP, THUAI7::ShipType::MilitaryShip}, - {protobuf::ShipType::FLAG_SHIP, THUAI7::ShipType::FlagShip}, + inline std::map SweeperTypeDict{ + {protobuf::SweeperType::NULL_SWEEPER_TYPE, THUAI7::SweeperType::NullSweeperType}, + {protobuf::SweeperType::CIVILIAN_SWEEPER, THUAI7::SweeperType::CivilianSweeper}, + {protobuf::SweeperType::MILITARY_SWEEPER, THUAI7::SweeperType::MilitarySweeper}, + {protobuf::SweeperType::FLAG_SWEEPER, THUAI7::SweeperType::FlagSweeper}, }; - inline std::map shipStateDict{ - {protobuf::ShipState::NULL_STATUS, THUAI7::ShipState::NullStatus}, - {protobuf::ShipState::IDLE, THUAI7::ShipState::Idle}, - {protobuf::ShipState::PRODUCING, THUAI7::ShipState::Producing}, - {protobuf::ShipState::CONSTRUCTING, THUAI7::ShipState::Constructing}, - {protobuf::ShipState::RECOVERING, THUAI7::ShipState::Recovering}, - {protobuf::ShipState::RECYCLING, THUAI7::ShipState::Recycling}, - {protobuf::ShipState::ATTACKING, THUAI7::ShipState::Attacking}, - {protobuf::ShipState::SWINGING, THUAI7::ShipState::Swinging}, - {protobuf::ShipState::STUNNED, THUAI7::ShipState::Stunned}, - {protobuf::ShipState::MOVING, THUAI7::ShipState::Moving}, + inline std::map SweeperStateDict{ + {protobuf::SweeperState::NULL_STATUS, THUAI7::SweeperState::NullStatus}, + {protobuf::SweeperState::IDLE, THUAI7::SweeperState::Idle}, + {protobuf::SweeperState::PRODUCING, THUAI7::SweeperState::Producing}, + {protobuf::SweeperState::CONSTRUCTING, THUAI7::SweeperState::Constructing}, + {protobuf::SweeperState::RECOVERING, THUAI7::SweeperState::Recovering}, + {protobuf::SweeperState::RECYCLING, THUAI7::SweeperState::Recycling}, + {protobuf::SweeperState::ATTACKING, THUAI7::SweeperState::Attacking}, + {protobuf::SweeperState::SWINGING, THUAI7::SweeperState::Swinging}, + {protobuf::SweeperState::STUNNED, THUAI7::SweeperState::Stunned}, + {protobuf::SweeperState::MOVING, THUAI7::SweeperState::Moving}, }; inline std::map weaponTypeDict{ @@ -192,9 +192,9 @@ namespace Proto2THUAI7 inline std::map constructionTypeDict{ {protobuf::ConstructionType::NULL_CONSTRUCTION_TYPE, THUAI7::ConstructionType::NullConstructionType}, - {protobuf::ConstructionType::FACTORY, THUAI7::ConstructionType::Factory}, - {protobuf::ConstructionType::COMMUNITY, THUAI7::ConstructionType::Community}, - {protobuf::ConstructionType::FORT, THUAI7::ConstructionType::Fort}, + {protobuf::ConstructionType::RECYCLEBANK, THUAI7::ConstructionType::RecycleBank}, + {protobuf::ConstructionType::CHARGESTATION, THUAI7::ConstructionType::ChargeStation}, + {protobuf::ConstructionType::SIGNALTOWER, THUAI7::ConstructionType::SignalTower}, }; inline std::map playerTeamDict{ @@ -204,14 +204,14 @@ namespace Proto2THUAI7 }; inline std::map messageOfObjDict{ - {protobuf::MessageOfObj::MessageOfObjCase::kShipMessage, THUAI7::MessageOfObj::ShipMessage}, + {protobuf::MessageOfObj::MessageOfObjCase::kSweeperMessage, THUAI7::MessageOfObj::SweeperMessage}, {protobuf::MessageOfObj::MessageOfObjCase::kBulletMessage, THUAI7::MessageOfObj::BulletMessage}, - {protobuf::MessageOfObj::MessageOfObjCase::kFactoryMessage, THUAI7::MessageOfObj::FactoryMessage}, - {protobuf::MessageOfObj::MessageOfObjCase::kCommunityMessage, THUAI7::MessageOfObj::CommunityMessage}, - {protobuf::MessageOfObj::MessageOfObjCase::kFortMessage, THUAI7::MessageOfObj::FortMessage}, - {protobuf::MessageOfObj::MessageOfObjCase::kWormholeMessage, THUAI7::MessageOfObj::WormholeMessage}, + {protobuf::MessageOfObj::MessageOfObjCase::kRecyclebankMessage, THUAI7::MessageOfObj::RecycleBankMessage}, + {protobuf::MessageOfObj::MessageOfObjCase::kChargestationMessage, THUAI7::MessageOfObj::ChargeStationMessage}, + {protobuf::MessageOfObj::MessageOfObjCase::kSignaltowerMessage, THUAI7::MessageOfObj::SignalTowerMessage}, + {protobuf::MessageOfObj::MessageOfObjCase::kBridgeMessage, THUAI7::MessageOfObj::BridgeMessage}, {protobuf::MessageOfObj::MessageOfObjCase::kHomeMessage, THUAI7::MessageOfObj::HomeMessage}, - {protobuf::MessageOfObj::MessageOfObjCase::kResourceMessage, THUAI7::MessageOfObj::ResourceMessage}, + {protobuf::MessageOfObj::MessageOfObjCase::kGarbageMessage, THUAI7::MessageOfObj::GarbageMessage}, {protobuf::MessageOfObj::MessageOfObjCase::kMapMessage, THUAI7::MessageOfObj::MapMessage}, {protobuf::MessageOfObj::MessageOfObjCase::kNewsMessage, THUAI7::MessageOfObj::NewsMessage}, {protobuf::MessageOfObj::MessageOfObjCase::kBombedBulletMessage, THUAI7::MessageOfObj::BombedBulletMessage}, @@ -225,28 +225,28 @@ namespace Proto2THUAI7 }; // 用于将Protobuf中的类转换为THUAI7的类 - inline std::shared_ptr Protobuf2THUAI7Ship(const protobuf::MessageOfShip& shipMsg) + inline std::shared_ptr Protobuf2THUAI7Sweeper(const protobuf::MessageOfSweeper& SweeperMsg) { - auto ship = std::make_shared(); - ship->x = shipMsg.x(); - ship->y = shipMsg.y(); - ship->speed = shipMsg.speed(); - ship->hp = shipMsg.hp(); - ship->armor = shipMsg.armor(); - ship->shield = shipMsg.shield(); - ship->teamID = shipMsg.team_id(); - ship->playerID = shipMsg.player_id(); - ship->guid = shipMsg.guid(); - ship->shipState = shipStateDict[shipMsg.ship_state()]; - ship->shipType = shipTypeDict[shipMsg.ship_type()]; - ship->viewRange = shipMsg.view_range(); - ship->producerType = producerTypeDict[shipMsg.producer_type()]; - ship->constructorType = constructorTypeDict[shipMsg.constructor_type()]; - ship->armorType = armorTypeDict[shipMsg.armor_type()]; - ship->shieldType = shieldTypeDict[shipMsg.shield_type()]; - ship->weaponType = weaponTypeDict[shipMsg.weapon_type()]; - ship->facingDirection = shipMsg.facing_direction(); - return ship; + auto Sweeper = std::make_shared(); + Sweeper->x = SweeperMsg.x(); + Sweeper->y = SweeperMsg.y(); + Sweeper->speed = SweeperMsg.speed(); + Sweeper->hp = SweeperMsg.hp(); + Sweeper->armor = SweeperMsg.armor(); + Sweeper->shield = SweeperMsg.shield(); + Sweeper->teamID = SweeperMsg.team_id(); + Sweeper->playerID = SweeperMsg.player_id(); + Sweeper->guid = SweeperMsg.guid(); + Sweeper->sweeperState = SweeperStateDict[SweeperMsg.sweeper_state()]; + Sweeper->sweeperType = SweeperTypeDict[SweeperMsg.sweeper_type()]; + Sweeper->viewRange = SweeperMsg.view_range(); + Sweeper->producerType = producerTypeDict[SweeperMsg.producer_type()]; + Sweeper->constructorType = constructorTypeDict[SweeperMsg.constructor_type()]; + Sweeper->armorType = armorTypeDict[SweeperMsg.armor_type()]; + Sweeper->shieldType = shieldTypeDict[SweeperMsg.shield_type()]; + Sweeper->weaponType = weaponTypeDict[SweeperMsg.weapon_type()]; + Sweeper->facingDirection = SweeperMsg.facing_direction(); + return Sweeper; } inline std::shared_ptr Protobuf2THUAI7Bullet(const protobuf::MessageOfBullet& bulletMsg) @@ -311,13 +311,13 @@ namespace THUAI72Proto inline std::map placeTypeDict{ {THUAI7::PlaceType::NullPlaceType, protobuf::PlaceType::NULL_PLACE_TYPE}, {THUAI7::PlaceType::Home, protobuf::PlaceType::HOME}, - {THUAI7::PlaceType::Space, protobuf::PlaceType::SPACE}, - {THUAI7::PlaceType::Ruin, protobuf::PlaceType::RUIN}, - {THUAI7::PlaceType::Shadow, protobuf::PlaceType::SHADOW}, - {THUAI7::PlaceType::Asteroid, protobuf::PlaceType::ASTEROID}, - {THUAI7::PlaceType::Resource, protobuf::PlaceType::RESOURCE}, + {THUAI7::PlaceType::Ground, protobuf::PlaceType::GROUND}, + {THUAI7::PlaceType::Wall, protobuf::PlaceType::WALL}, + {THUAI7::PlaceType::Grass, protobuf::PlaceType::GRASS}, + {THUAI7::PlaceType::River, protobuf::PlaceType::RIVER}, + {THUAI7::PlaceType::Garbage, protobuf::PlaceType::GARBAGE}, {THUAI7::PlaceType::Construction, protobuf::PlaceType::CONSTRUCTION}, - {THUAI7::PlaceType::Wormhole, protobuf::PlaceType::WORMHOLE}, + {THUAI7::PlaceType::Bridge, protobuf::PlaceType::BRIDGE}, }; inline std::map shapeTypeDict{ @@ -328,28 +328,28 @@ namespace THUAI72Proto inline std::map playerTypeDict{ {THUAI7::PlayerType::NullPlayerType, protobuf::PlayerType::NULL_PLAYER_TYPE}, - {THUAI7::PlayerType::Ship, protobuf::PlayerType::SHIP}, + {THUAI7::PlayerType::Sweeper, protobuf::PlayerType::SWEEPER}, {THUAI7::PlayerType::Team, protobuf::PlayerType::TEAM}, }; - inline std::map shipTypeDict{ - {THUAI7::ShipType::NullShipType, protobuf::ShipType::NULL_SHIP_TYPE}, - {THUAI7::ShipType::CivilianShip, protobuf::ShipType::CIVILIAN_SHIP}, - {THUAI7::ShipType::MilitaryShip, protobuf::ShipType::MILITARY_SHIP}, - {THUAI7::ShipType::FlagShip, protobuf::ShipType::FLAG_SHIP}, + inline std::map SweeperTypeDict{ + {THUAI7::SweeperType::NullSweeperType, protobuf::SweeperType::NULL_SWEEPER_TYPE}, + {THUAI7::SweeperType::CivilianSweeper, protobuf::SweeperType::CIVILIAN_SWEEPER}, + {THUAI7::SweeperType::MilitarySweeper, protobuf::SweeperType::MILITARY_SWEEPER}, + {THUAI7::SweeperType::FlagSweeper, protobuf::SweeperType::FLAG_SWEEPER}, }; - inline std::map shipStateDict{ - {THUAI7::ShipState::NullStatus, protobuf::ShipState::NULL_STATUS}, - {THUAI7::ShipState::Idle, protobuf::ShipState::IDLE}, - {THUAI7::ShipState::Producing, protobuf::ShipState::PRODUCING}, - {THUAI7::ShipState::Constructing, protobuf::ShipState::CONSTRUCTING}, - {THUAI7::ShipState::Recovering, protobuf::ShipState::RECOVERING}, - {THUAI7::ShipState::Recycling, protobuf::ShipState::RECYCLING}, - {THUAI7::ShipState::Attacking, protobuf::ShipState::ATTACKING}, - {THUAI7::ShipState::Swinging, protobuf::ShipState::SWINGING}, - {THUAI7::ShipState::Stunned, protobuf::ShipState::STUNNED}, - {THUAI7::ShipState::Moving, protobuf::ShipState::MOVING}, + inline std::map SweeperStateDict{ + {THUAI7::SweeperState::NullStatus, protobuf::SweeperState::NULL_STATUS}, + {THUAI7::SweeperState::Idle, protobuf::SweeperState::IDLE}, + {THUAI7::SweeperState::Producing, protobuf::SweeperState::PRODUCING}, + {THUAI7::SweeperState::Constructing, protobuf::SweeperState::CONSTRUCTING}, + {THUAI7::SweeperState::Recovering, protobuf::SweeperState::RECOVERING}, + {THUAI7::SweeperState::Recycling, protobuf::SweeperState::RECYCLING}, + {THUAI7::SweeperState::Attacking, protobuf::SweeperState::ATTACKING}, + {THUAI7::SweeperState::Swinging, protobuf::SweeperState::SWINGING}, + {THUAI7::SweeperState::Stunned, protobuf::SweeperState::STUNNED}, + {THUAI7::SweeperState::Moving, protobuf::SweeperState::MOVING}, }; inline std::map weaponTypeDict{ @@ -421,9 +421,9 @@ namespace THUAI72Proto inline std::map constructionTypeDict{ {THUAI7::ConstructionType::NullConstructionType, protobuf::ConstructionType::NULL_CONSTRUCTION_TYPE}, - {THUAI7::ConstructionType::Factory, protobuf::ConstructionType::FACTORY}, - {THUAI7::ConstructionType::Community, protobuf::ConstructionType::COMMUNITY}, - {THUAI7::ConstructionType::Fort, protobuf::ConstructionType::FORT}, + {THUAI7::ConstructionType::RecycleBank, protobuf::ConstructionType::RECYCLEBANK}, + {THUAI7::ConstructionType::ChargeStation, protobuf::ConstructionType::CHARGESTATION}, + {THUAI7::ConstructionType::SignalTower, protobuf::ConstructionType::SIGNALTOWER}, }; inline std::map playerTeamDict{ @@ -433,14 +433,14 @@ namespace THUAI72Proto }; inline std::map messageOfObjDict{ - {THUAI7::MessageOfObj::ShipMessage, protobuf::MessageOfObj::MessageOfObjCase::kShipMessage}, + {THUAI7::MessageOfObj::SweeperMessage, protobuf::MessageOfObj::MessageOfObjCase::kSweeperMessage}, {THUAI7::MessageOfObj::BulletMessage, protobuf::MessageOfObj::MessageOfObjCase::kBulletMessage}, - {THUAI7::MessageOfObj::FactoryMessage, protobuf::MessageOfObj::MessageOfObjCase::kFactoryMessage}, - {THUAI7::MessageOfObj::CommunityMessage, protobuf::MessageOfObj::MessageOfObjCase::kCommunityMessage}, - {THUAI7::MessageOfObj::FortMessage, protobuf::MessageOfObj::MessageOfObjCase::kFortMessage}, - {THUAI7::MessageOfObj::WormholeMessage, protobuf::MessageOfObj::MessageOfObjCase::kWormholeMessage}, + {THUAI7::MessageOfObj::RecycleBankMessage, protobuf::MessageOfObj::MessageOfObjCase::kRecyclebankMessage}, + {THUAI7::MessageOfObj::ChargeStationMessage, protobuf::MessageOfObj::MessageOfObjCase::kChargestationMessage}, + {THUAI7::MessageOfObj::SignalTowerMessage, protobuf::MessageOfObj::MessageOfObjCase::kSignaltowerMessage}, + {THUAI7::MessageOfObj::BridgeMessage, protobuf::MessageOfObj::MessageOfObjCase::kBridgeMessage}, {THUAI7::MessageOfObj::HomeMessage, protobuf::MessageOfObj::MessageOfObjCase::kHomeMessage}, - {THUAI7::MessageOfObj::ResourceMessage, protobuf::MessageOfObj::MessageOfObjCase::kResourceMessage}, + {THUAI7::MessageOfObj::GarbageMessage, protobuf::MessageOfObj::MessageOfObjCase::kGarbageMessage}, {THUAI7::MessageOfObj::MapMessage, protobuf::MessageOfObj::MessageOfObjCase::kMapMessage}, {THUAI7::MessageOfObj::NewsMessage, protobuf::MessageOfObj::MessageOfObjCase::kNewsMessage}, {THUAI7::MessageOfObj::BombedBulletMessage, protobuf::MessageOfObj::MessageOfObjCase::kBombedBulletMessage}, @@ -520,22 +520,22 @@ namespace THUAI72Proto return installMsg; } - inline protobuf::BuildShipMsg THUAI72ProtobufBuildShipMsg(int64_t teamID, THUAI7::ShipType shipType, int32_t x, int32_t y) + inline protobuf::BuildSweeperMsg THUAI72ProtobufBuildSweeperMsg(int64_t teamID, THUAI7::SweeperType SweeperType, int32_t x, int32_t y) { - protobuf::BuildShipMsg buildShipMsg; - buildShipMsg.set_team_id(teamID); - buildShipMsg.set_x(x); - buildShipMsg.set_y(y); - buildShipMsg.set_ship_type(THUAI72Proto::shipTypeDict[shipType]); - return buildShipMsg; + protobuf::BuildSweeperMsg buildSweeperMsg; + buildSweeperMsg.set_team_id(teamID); + buildSweeperMsg.set_x(x); + buildSweeperMsg.set_y(y); + buildSweeperMsg.set_sweeper_type(THUAI72Proto::SweeperTypeDict[SweeperType]); + return buildSweeperMsg; } - inline protobuf::PlayerMsg THUAI72ProtobufPlayerMsg(int64_t playerID, int64_t teamID, THUAI7::ShipType shipType, int32_t x, int32_t y) + inline protobuf::PlayerMsg THUAI72ProtobufPlayerMsg(int64_t playerID, int64_t teamID, THUAI7::SweeperType SweeperType, int32_t x, int32_t y) { protobuf::PlayerMsg playerMsg; playerMsg.set_player_id(playerID); playerMsg.set_team_id(teamID); - playerMsg.set_ship_type(THUAI72Proto::shipTypeDict[shipType]); + playerMsg.set_sweeper_type(THUAI72Proto::SweeperTypeDict[SweeperType]); playerMsg.set_x(x); playerMsg.set_y(y); return playerMsg; diff --git a/CAPI/cpp/API/src/AI.cpp b/CAPI/cpp/API/src/AI.cpp index 5cee0d82..95e6669c 100755 --- a/CAPI/cpp/API/src/AI.cpp +++ b/CAPI/cpp/API/src/AI.cpp @@ -8,16 +8,16 @@ extern const bool asynchronous = false; // 选手需要依次将player1到player4的船类型在这里定义 -extern const std::array shipTypeDict = { - THUAI7::ShipType::CivilianShip, - THUAI7::ShipType::MilitaryShip, - THUAI7::ShipType::MilitaryShip, - THUAI7::ShipType::FlagShip, +extern const std::array SweeperTypeDict = { + THUAI7::SweeperType::CivilianSweeper, + THUAI7::SweeperType::MilitarySweeper, + THUAI7::SweeperType::MilitarySweeper, + THUAI7::SweeperType::FlagSweeper, }; // 可以在AI.cpp内部声明变量与函数 -void AI::play(IShipAPI& api) +void AI::play(ISweeperAPI& api) { if (this->playerID == 1) { diff --git a/CAPI/cpp/API/src/API.cpp b/CAPI/cpp/API/src/API.cpp index b031a3a4..a006fb60 100755 --- a/CAPI/cpp/API/src/API.cpp +++ b/CAPI/cpp/API/src/API.cpp @@ -8,7 +8,7 @@ #define PI 3.14159265358979323846 -std::future ShipAPI::SendTextMessage(int64_t toID, std::string message) +std::future SweeperAPI::SendTextMessage(int64_t toID, std::string message) { return std::async(std::launch::async, [=, message = std::move(message)]() { return logic.Send(toID, std::move(message), false); }); @@ -20,7 +20,7 @@ std::future TeamAPI::SendTextMessage(int64_t toID, std::string message) { return logic.Send(toID, std::move(message), false); }); } -std::future ShipAPI::SendBinaryMessage(int64_t toID, std::string message) +std::future SweeperAPI::SendBinaryMessage(int64_t toID, std::string message) { return std::async(std::launch::async, [=, message = std::move(message)]() { return logic.Send(toID, std::move(message), true); }); @@ -32,7 +32,7 @@ std::future TeamAPI::SendBinaryMessage(int64_t toID, std::string message) { return logic.Send(toID, std::move(message), true); }); } -bool ShipAPI::HaveMessage() +bool SweeperAPI::HaveMessage() { return logic.HaveMessage(); } @@ -42,7 +42,7 @@ bool TeamAPI::HaveMessage() return logic.HaveMessage(); } -std::pair ShipAPI::GetMessage() +std::pair SweeperAPI::GetMessage() { return logic.GetMessage(); } @@ -52,7 +52,7 @@ std::pair TeamAPI::GetMessage() return logic.GetMessage(); } -int32_t ShipAPI::GetFrameCount() const +int32_t SweeperAPI::GetFrameCount() const { return logic.GetCounter(); } @@ -62,7 +62,7 @@ int32_t TeamAPI::GetFrameCount() const return logic.GetCounter(); } -bool ShipAPI::Wait() +bool SweeperAPI::Wait() { if (logic.GetCounter() == -1) return false; @@ -78,7 +78,7 @@ bool TeamAPI::Wait() return logic.WaitThread(); } -std::future ShipAPI::EndAllAction() +std::future SweeperAPI::EndAllAction() { return std::async(std::launch::async, [this]() { return logic.EndAllAction(); }); @@ -90,27 +90,27 @@ std::future TeamAPI::EndAllAction() { return logic.EndAllAction(); }); } -std::vector> ShipAPI::GetShips() const +std::vector> SweeperAPI::GetSweepers() const { - return logic.GetShips(); + return logic.GetSweepers(); } -std::vector> TeamAPI::GetShips() const +std::vector> TeamAPI::GetSweepers() const { - return logic.GetShips(); + return logic.GetSweepers(); } -std::vector> ShipAPI::GetEnemyShips() const +std::vector> SweeperAPI::GetEnemySweepers() const { - return logic.GetEnemyShips(); + return logic.GetEnemySweepers(); } -std::vector> TeamAPI::GetEnemyShips() const +std::vector> TeamAPI::GetEnemySweepers() const { - return logic.GetEnemyShips(); + return logic.GetEnemySweepers(); } -std::vector> ShipAPI::GetBullets() const +std::vector> SweeperAPI::GetBullets() const { return logic.GetBullets(); } @@ -120,7 +120,7 @@ std::vector> TeamAPI::GetBullets() const return logic.GetBullets(); } -std::vector> ShipAPI::GetFullMap() const +std::vector> SweeperAPI::GetFullMap() const { return logic.GetFullMap(); } @@ -130,7 +130,7 @@ std::vector> TeamAPI::GetFullMap() const return logic.GetFullMap(); } -THUAI7::PlaceType ShipAPI::GetPlaceType(int32_t cellX, int32_t cellY) const +THUAI7::PlaceType SweeperAPI::GetPlaceType(int32_t cellX, int32_t cellY) const { return logic.GetPlaceType(cellX, cellY); } @@ -140,7 +140,7 @@ THUAI7::PlaceType TeamAPI::GetPlaceType(int32_t cellX, int32_t cellY) const return logic.GetPlaceType(cellX, cellY); } -int32_t ShipAPI::GetConstructionHp(int32_t cellX, int32_t cellY) const +int32_t SweeperAPI::GetConstructionHp(int32_t cellX, int32_t cellY) const { return logic.GetConstructionHp(cellX, cellY); } @@ -150,27 +150,27 @@ int32_t TeamAPI::GetConstructionHp(int32_t cellX, int32_t cellY) const return logic.GetConstructionHp(cellX, cellY); } -int32_t ShipAPI::GetWormHp(int32_t cellX, int32_t cellY) const +int32_t SweeperAPI::GetBridgeHp(int32_t cellX, int32_t cellY) const { - return logic.GetWormHp(cellX, cellY); + return logic.GetBridgeHp(cellX, cellY); } -int32_t TeamAPI::GetWormHp(int32_t cellX, int32_t cellY) const +int32_t TeamAPI::GetBridgeHp(int32_t cellX, int32_t cellY) const { - return logic.GetWormHp(cellX, cellY); + return logic.GetBridgeHp(cellX, cellY); } -int32_t ShipAPI::GetResourceState(int32_t cellX, int32_t cellY) const +int32_t SweeperAPI::GetGarbageState(int32_t cellX, int32_t cellY) const { - return logic.GetResourceState(cellX, cellY); + return logic.GetGarbageState(cellX, cellY); } -int32_t TeamAPI::GetResourceState(int32_t cellX, int32_t cellY) const +int32_t TeamAPI::GetGarbageState(int32_t cellX, int32_t cellY) const { - return logic.GetResourceState(cellX, cellY); + return logic.GetGarbageState(cellX, cellY); } -int32_t ShipAPI::GetHomeHp() const +int32_t SweeperAPI::GetHomeHp() const { return logic.GetHomeHp(); } @@ -180,7 +180,7 @@ int32_t TeamAPI::GetHomeHp() const return logic.GetHomeHp(); } -std::shared_ptr ShipAPI::GetGameInfo() const +std::shared_ptr SweeperAPI::GetGameInfo() const { return logic.GetGameInfo(); } @@ -190,7 +190,7 @@ std::shared_ptr TeamAPI::GetGameInfo() const return logic.GetGameInfo(); } -std::vector ShipAPI::GetPlayerGUIDs() const +std::vector SweeperAPI::GetPlayerGUIDs() const { return logic.GetPlayerGUIDs(); } @@ -200,9 +200,9 @@ std::vector TeamAPI::GetPlayerGUIDs() const return logic.GetPlayerGUIDs(); } -std::shared_ptr ShipAPI::GetSelfInfo() const +std::shared_ptr SweeperAPI::GetSelfInfo() const { - return logic.ShipGetSelfInfo(); + return logic.SweeperGetSelfInfo(); } std::shared_ptr TeamAPI::GetSelfInfo() const @@ -210,7 +210,7 @@ std::shared_ptr TeamAPI::GetSelfInfo() const return logic.TeamGetSelfInfo(); } -int32_t ShipAPI::GetScore() const +int32_t SweeperAPI::GetScore() const { return logic.GetScore(); } @@ -220,7 +220,7 @@ int32_t TeamAPI::GetScore() const return logic.GetScore(); } -int32_t ShipAPI::GetMoney() const +int32_t SweeperAPI::GetMoney() const { return logic.GetMoney(); } @@ -230,64 +230,64 @@ int32_t TeamAPI::GetMoney() const return logic.GetMoney(); } -// Ship独有 -std::future ShipAPI::Move(int64_t timeInMilliseconds, double angleInRadian) +// Sweeper独有 +std::future SweeperAPI::Move(int64_t timeInMilliseconds, double angleInRadian) { return std::async(std::launch::async, [=]() { return logic.Move(timeInMilliseconds, angleInRadian); }); } -std::future ShipAPI::MoveDown(int64_t timeInMilliseconds) +std::future SweeperAPI::MoveDown(int64_t timeInMilliseconds) { return Move(timeInMilliseconds, 0); } -std::future ShipAPI::MoveRight(int64_t timeInMilliseconds) +std::future SweeperAPI::MoveRight(int64_t timeInMilliseconds) { return Move(timeInMilliseconds, PI * 0.5); } -std::future ShipAPI::MoveUp(int64_t timeInMilliseconds) +std::future SweeperAPI::MoveUp(int64_t timeInMilliseconds) { return Move(timeInMilliseconds, PI); } -std::future ShipAPI::MoveLeft(int64_t timeInMilliseconds) +std::future SweeperAPI::MoveLeft(int64_t timeInMilliseconds) { return Move(timeInMilliseconds, PI * 1.5); } -std::future ShipAPI::Attack(double angleInRadian) +std::future SweeperAPI::Attack(double angleInRadian) { return std::async(std::launch::async, [=]() { return logic.Attack(angleInRadian); }); } -std::future ShipAPI::Recover() +std::future SweeperAPI::Recover() { return std::async(std::launch::async, [=]() { return logic.Recover(); }); } -std::future ShipAPI::Produce() +std::future SweeperAPI::Produce() { return std::async(std::launch::async, [=]() { return logic.Produce(); }); } -std::future ShipAPI::Rebuild(THUAI7::ConstructionType constructionType) +std::future SweeperAPI::Rebuild(THUAI7::ConstructionType constructionType) { return std::async(std::launch::async, [=]() { return logic.Rebuild(constructionType); }); } -std::future ShipAPI::Construct(THUAI7::ConstructionType constructionType) +std::future SweeperAPI::Construct(THUAI7::ConstructionType constructionType) { return std::async(std::launch::async, [=]() { return logic.Construct(constructionType); }); } -bool ShipAPI::HaveView(int32_t gridX, int32_t gridY) const +bool SweeperAPI::HaveView(int32_t gridX, int32_t gridY) const { auto selfInfo = GetSelfInfo(); return logic.HaveView(gridX, gridY, selfInfo->x, selfInfo->y, selfInfo->viewRange); @@ -306,13 +306,13 @@ std::future TeamAPI::Recycle(int64_t playerID) { return logic.Recycle(playerID); }); } -std::future TeamAPI::BuildShip(THUAI7::ShipType shipType, int32_t x, int32_t y) +std::future TeamAPI::BuildSweeper(THUAI7::SweeperType SweeperType, int32_t x, int32_t y) { return std::async(std::launch::async, [=]() - { return logic.BuildShip(shipType, x, y); }); + { return logic.BuildSweeper(SweeperType, x, y); }); } -void ShipAPI::Play(IAI& ai) +void SweeperAPI::Play(IAI& ai) { ai.play(*this); } diff --git a/CAPI/cpp/API/src/Communication.cpp b/CAPI/cpp/API/src/Communication.cpp index 7f91cb5c..7d322a1e 100755 --- a/CAPI/cpp/API/src/Communication.cpp +++ b/CAPI/cpp/API/src/Communication.cpp @@ -187,12 +187,12 @@ bool Communication::Attack(int64_t playerID, int64_t teamID, double angle) return false; } -bool Communication::BuildShip(int64_t teamID, THUAI7::ShipType shipType, int32_t x, int32_t y) +bool Communication::BuildSweeper(int64_t teamID, THUAI7::SweeperType SweeperType, int32_t x, int32_t y) { protobuf::BoolRes reply; ClientContext context; - auto request = THUAI72Proto::THUAI72ProtobufBuildShipMsg(teamID, shipType, x, y); - auto status = THUAI7Stub->BuildShip(&context, request, &reply); + auto request = THUAI72Proto::THUAI72ProtobufBuildSweeperMsg(teamID, SweeperType, x, y); + auto status = THUAI7Stub->BuildSweeper(&context, request, &reply); if (status.ok()) return true; else @@ -223,11 +223,11 @@ bool Communication::TryConnection(int64_t playerID, int64_t teamID) return false; } -void Communication::AddPlayer(int64_t playerID, int64_t teamID, THUAI7::ShipType shipType, int32_t x, int32_t y) +void Communication::AddPlayer(int64_t playerID, int64_t teamID, THUAI7::SweeperType SweeperType, int32_t x, int32_t y) { auto tMessage = [=]() { - protobuf::PlayerMsg playerMsg = THUAI72Proto::THUAI72ProtobufPlayerMsg(playerID, teamID, shipType, x, y); + protobuf::PlayerMsg playerMsg = THUAI72Proto::THUAI72ProtobufPlayerMsg(playerID, teamID, SweeperType, x, y); grpc::ClientContext context; auto MessageReader = THUAI7Stub->AddPlayer(&context, playerMsg); diff --git a/CAPI/cpp/API/src/DebugAPI.cpp b/CAPI/cpp/API/src/DebugAPI.cpp index bd119079..a2bb7392 100755 --- a/CAPI/cpp/API/src/DebugAPI.cpp +++ b/CAPI/cpp/API/src/DebugAPI.cpp @@ -11,7 +11,7 @@ #define PI 3.14159265358979323846 -ShipDebugAPI::ShipDebugAPI(ILogic& logic, bool file, bool print, bool warnOnly, int64_t playerID) : +SweeperDebugAPI::SweeperDebugAPI(ILogic& logic, bool file, bool print, bool warnOnly, int64_t playerID) : logic(logic) { std::string fileName = "logs/api-" + std::to_string(playerID) + "-log.txt"; @@ -34,7 +34,7 @@ ShipDebugAPI::ShipDebugAPI(ILogic& logic, bool file, bool print, bool warnOnly, logger->flush_on(spdlog::level::warn); } -void ShipDebugAPI::StartTimer() +void SweeperDebugAPI::StartTimer() { startPoint = std::chrono::system_clock::now(); std::time_t t = std::chrono::system_clock::to_time_t(startPoint); @@ -42,17 +42,17 @@ void ShipDebugAPI::StartTimer() logger->info("StartTimer: {}", std::ctime(&t)); } -void ShipDebugAPI::EndTimer() +void SweeperDebugAPI::EndTimer() { logger->info("Time elapsed: {}ms", Time::TimeSinceStart(startPoint)); } -int32_t ShipDebugAPI::GetFrameCount() const +int32_t SweeperDebugAPI::GetFrameCount() const { return logic.GetCounter(); } -std::future ShipDebugAPI::SendTextMessage(int64_t toID, std::string message) +std::future SweeperDebugAPI::SendTextMessage(int64_t toID, std::string message) { logger->info("SendTextMessage: toID = {}, message = {}, called at {}ms", toID, message, Time::TimeSinceStart(startPoint)); return std::async(std::launch::async, [=, message = std::move(message)]() @@ -62,7 +62,7 @@ std::future ShipDebugAPI::SendTextMessage(int64_t toID, std::string messag return result; }); } -std::future ShipDebugAPI::SendBinaryMessage(int64_t toID, std::string message) +std::future SweeperDebugAPI::SendBinaryMessage(int64_t toID, std::string message) { logger->info("SendBinaryMessage: toID = {}, message = {}, called at {}ms", toID, message, Time::TimeSinceStart(startPoint)); return std::async(std::launch::async, [=, message = std::move(message)]() @@ -72,7 +72,7 @@ std::future ShipDebugAPI::SendBinaryMessage(int64_t toID, std::string mess return result; }); } -bool ShipDebugAPI::HaveMessage() +bool SweeperDebugAPI::HaveMessage() { logger->info("HaveMessage: called at {}ms", Time::TimeSinceStart(startPoint)); auto result = logic.HaveMessage(); @@ -81,7 +81,7 @@ bool ShipDebugAPI::HaveMessage() return result; } -std::pair ShipDebugAPI::GetMessage() +std::pair SweeperDebugAPI::GetMessage() { logger->info("GetMessage: called at {}ms", Time::TimeSinceStart(startPoint)); auto result = logic.GetMessage(); @@ -90,7 +90,7 @@ std::pair ShipDebugAPI::GetMessage() return result; } -bool ShipDebugAPI::Wait() +bool SweeperDebugAPI::Wait() { logger->info("Wait: called at {}ms", Time::TimeSinceStart(startPoint)); if (logic.GetCounter() == -1) @@ -98,7 +98,7 @@ bool ShipDebugAPI::Wait() else return logic.WaitThread(); } -std::future ShipDebugAPI::Move(int64_t timeInMilliseconds, double angleInRadian) +std::future SweeperDebugAPI::Move(int64_t timeInMilliseconds, double angleInRadian) { logger->info("Move: timeInMilliseconds = {}, angleInRadian = {}, called at {}ms", timeInMilliseconds, angleInRadian, Time::TimeSinceStart(startPoint)); return std::async(std::launch::async, [=]() @@ -108,27 +108,27 @@ std::future ShipDebugAPI::Move(int64_t timeInMilliseconds, double angleInR return result; }); } -std::future ShipDebugAPI::MoveDown(int64_t timeInMilliseconds) +std::future SweeperDebugAPI::MoveDown(int64_t timeInMilliseconds) { return Move(timeInMilliseconds, 0); } -std::future ShipDebugAPI::MoveRight(int64_t timeInMilliseconds) +std::future SweeperDebugAPI::MoveRight(int64_t timeInMilliseconds) { return Move(timeInMilliseconds, PI * 0.5); } -std::future ShipDebugAPI::MoveUp(int64_t timeInMilliseconds) +std::future SweeperDebugAPI::MoveUp(int64_t timeInMilliseconds) { return Move(timeInMilliseconds, PI); } -std::future ShipDebugAPI::MoveLeft(int64_t timeInMilliseconds) +std::future SweeperDebugAPI::MoveLeft(int64_t timeInMilliseconds) { return Move(timeInMilliseconds, PI * 1.5); } -std::future ShipDebugAPI::Attack(double angleInRadian) +std::future SweeperDebugAPI::Attack(double angleInRadian) { logger->info("Attack: angleInRadian = {}, called at {}ms", angleInRadian, Time::TimeSinceStart(startPoint)); return std::async(std::launch::async, [=]() @@ -138,130 +138,130 @@ std::future ShipDebugAPI::Attack(double angleInRadian) return result; }); } -std::future ShipDebugAPI::Recover() +std::future SweeperDebugAPI::Recover() { return std::async(std::launch::async, [=]() { return logic.Recover(); }); } -std::future ShipDebugAPI::Produce() +std::future SweeperDebugAPI::Produce() { return std::async(std::launch::async, [=]() { return logic.Produce(); }); } -std::future ShipDebugAPI::Rebuild(THUAI7::ConstructionType constructionType) +std::future SweeperDebugAPI::Rebuild(THUAI7::ConstructionType constructionType) { return std::async(std::launch::async, [=]() { return logic.Rebuild(constructionType); }); } -std::future ShipDebugAPI::Construct(THUAI7::ConstructionType constructionType) +std::future SweeperDebugAPI::Construct(THUAI7::ConstructionType constructionType) { return std::async(std::launch::async, [=]() { return logic.Construct(constructionType); }); } -std::vector> ShipDebugAPI::GetShips() const +std::vector> SweeperDebugAPI::GetSweepers() const { - return logic.GetShips(); + return logic.GetSweepers(); } -std::vector> ShipDebugAPI::GetEnemyShips() const +std::vector> SweeperDebugAPI::GetEnemySweepers() const { - return logic.GetEnemyShips(); + return logic.GetEnemySweepers(); } -std::vector> ShipDebugAPI::GetBullets() const +std::vector> SweeperDebugAPI::GetBullets() const { return logic.GetBullets(); } -std::vector> ShipDebugAPI::GetFullMap() const +std::vector> SweeperDebugAPI::GetFullMap() const { return logic.GetFullMap(); } -THUAI7::PlaceType ShipDebugAPI::GetPlaceType(int32_t cellX, int32_t cellY) const +THUAI7::PlaceType SweeperDebugAPI::GetPlaceType(int32_t cellX, int32_t cellY) const { return logic.GetPlaceType(cellX, cellY); } -int32_t ShipDebugAPI::GetConstructionHp(int32_t cellX, int32_t cellY) const +int32_t SweeperDebugAPI::GetConstructionHp(int32_t cellX, int32_t cellY) const { return logic.GetConstructionHp(cellX, cellY); } -int32_t ShipDebugAPI::GetWormHp(int32_t cellX, int32_t cellY) const +int32_t SweeperDebugAPI::GetBridgeHp(int32_t cellX, int32_t cellY) const { - return logic.GetWormHp(cellX, cellY); + return logic.GetBridgeHp(cellX, cellY); } -int32_t ShipDebugAPI::GetResourceState(int32_t cellX, int32_t cellY) const +int32_t SweeperDebugAPI::GetGarbageState(int32_t cellX, int32_t cellY) const { - return logic.GetResourceState(cellX, cellY); + return logic.GetGarbageState(cellX, cellY); } -int32_t ShipDebugAPI::GetHomeHp() const +int32_t SweeperDebugAPI::GetHomeHp() const { return logic.GetHomeHp(); } -std::shared_ptr ShipDebugAPI::GetGameInfo() const +std::shared_ptr SweeperDebugAPI::GetGameInfo() const { return logic.GetGameInfo(); } -std::vector ShipDebugAPI::GetPlayerGUIDs() const +std::vector SweeperDebugAPI::GetPlayerGUIDs() const { return logic.GetPlayerGUIDs(); } -std::shared_ptr ShipDebugAPI::GetSelfInfo() const +std::shared_ptr SweeperDebugAPI::GetSelfInfo() const { - return logic.ShipGetSelfInfo(); + return logic.SweeperGetSelfInfo(); } -bool ShipDebugAPI::HaveView(int32_t gridX, int32_t gridY) const +bool SweeperDebugAPI::HaveView(int32_t gridX, int32_t gridY) const { auto selfInfo = GetSelfInfo(); return logic.HaveView(gridX, gridY, selfInfo->x, selfInfo->y, selfInfo->viewRange); } -int32_t ShipDebugAPI::GetMoney() const +int32_t SweeperDebugAPI::GetMoney() const { return logic.GetMoney(); } -int32_t ShipDebugAPI::GetScore() const +int32_t SweeperDebugAPI::GetScore() const { return logic.GetScore(); } -void ShipDebugAPI::Print(std::string str) const +void SweeperDebugAPI::Print(std::string str) const { logger->info(str); } -void ShipDebugAPI::PrintShip() const +void SweeperDebugAPI::PrintSweeper() const { - for (const auto& Ship : logic.GetShips()) + for (const auto& Sweeper : logic.GetSweepers()) { - logger->info("******Ship Info******"); - logger->info("type={}, playerID={}, GUID={}, x={}, y={}", THUAI7::shipTypeDict[Ship->shipType], Ship->playerID, Ship->guid, Ship->x, Ship->y); - logger->info("state={},speed={}, view range={},facing direction={}", THUAI7::shipStateDict[Ship->shipState], Ship->speed, Ship->viewRange, Ship->facingDirection); + logger->info("******Sweeper Info******"); + logger->info("type={}, playerID={}, GUID={}, x={}, y={}", THUAI7::SweeperTypeDict[Sweeper->sweeperType], Sweeper->playerID, Sweeper->guid, Sweeper->x, Sweeper->y); + logger->info("state={},speed={}, view range={},facing direction={}", THUAI7::sweeperStateDict[Sweeper->sweeperState], Sweeper->speed, Sweeper->viewRange, Sweeper->facingDirection); logger->info("************************\n"); } } -void ShipDebugAPI::PrintSelfInfo() const +void SweeperDebugAPI::PrintSelfInfo() const { - auto Ship = logic.ShipGetSelfInfo(); + auto Sweeper = logic.SweeperGetSelfInfo(); logger->info("******Self Info******"); - logger->info("type={}, playerID={}, GUID={}, x={}, y={}", THUAI7::shipTypeDict[Ship->shipType], Ship->playerID, Ship->guid, Ship->x, Ship->y); - logger->info("state={},speed={}, view range={},facing direction={}", THUAI7::shipStateDict[Ship->shipState], Ship->speed, Ship->viewRange, Ship->facingDirection); + logger->info("type={}, playerID={}, GUID={}, x={}, y={}", THUAI7::SweeperTypeDict[Sweeper->sweeperType], Sweeper->playerID, Sweeper->guid, Sweeper->x, Sweeper->y); + logger->info("state={},speed={}, view range={},facing direction={}", THUAI7::sweeperStateDict[Sweeper->sweeperState], Sweeper->speed, Sweeper->viewRange, Sweeper->facingDirection); logger->info("*********************\n"); } -std::future ShipDebugAPI::EndAllAction() +std::future SweeperDebugAPI::EndAllAction() { return std::async(std::launch::async, [this]() { return logic.EndAllAction(); }); @@ -354,14 +354,14 @@ bool TeamDebugAPI::Wait() return logic.WaitThread(); } -std::vector> TeamDebugAPI::GetShips() const +std::vector> TeamDebugAPI::GetSweepers() const { - return logic.GetShips(); + return logic.GetSweepers(); } -std::vector> TeamDebugAPI::GetEnemyShips() const +std::vector> TeamDebugAPI::GetEnemySweepers() const { - return logic.GetEnemyShips(); + return logic.GetEnemySweepers(); } std::vector> TeamDebugAPI::GetBullets() const @@ -384,14 +384,14 @@ int32_t TeamDebugAPI::GetConstructionHp(int32_t cellX, int32_t cellY) const return logic.GetConstructionHp(cellX, cellY); } -int32_t TeamDebugAPI::GetWormHp(int32_t cellX, int32_t cellY) const +int32_t TeamDebugAPI::GetBridgeHp(int32_t cellX, int32_t cellY) const { - return logic.GetWormHp(cellX, cellY); + return logic.GetBridgeHp(cellX, cellY); } -int32_t TeamDebugAPI::GetResourceState(int32_t cellX, int32_t cellY) const +int32_t TeamDebugAPI::GetGarbageState(int32_t cellX, int32_t cellY) const { - return logic.GetResourceState(cellX, cellY); + return logic.GetGarbageState(cellX, cellY); } int32_t TeamDebugAPI::GetHomeHp() const @@ -436,10 +436,10 @@ std::future TeamDebugAPI::Recycle(int64_t playerID) { return logic.Recycle(playerID); }); } -std::future TeamDebugAPI::BuildShip(THUAI7::ShipType shipType, int32_t x, int32_t y) +std::future TeamDebugAPI::BuildSweeper(THUAI7::SweeperType SweeperType, int32_t x, int32_t y) { return std::async(std::launch::async, [=]() - { return logic.BuildShip(shipType, x, y); }); + { return logic.BuildSweeper(SweeperType, x, y); }); } void TeamDebugAPI::PrintSelfInfo() const @@ -450,7 +450,7 @@ void TeamDebugAPI::PrintSelfInfo() const logger->info("*********************\n"); } -void ShipDebugAPI::Play(IAI& ai) +void SweeperDebugAPI::Play(IAI& ai) { ai.play(*this); } diff --git a/CAPI/cpp/API/src/logic.cpp b/CAPI/cpp/API/src/logic.cpp index 187de80a..6f5106eb 100755 --- a/CAPI/cpp/API/src/logic.cpp +++ b/CAPI/cpp/API/src/logic.cpp @@ -14,11 +14,11 @@ extern const bool asynchronous; -Logic::Logic(int64_t pID, int64_t tID, THUAI7::PlayerType pType, THUAI7::ShipType sType) : +Logic::Logic(int64_t pID, int64_t tID, THUAI7::PlayerType pType, THUAI7::SweeperType sType) : playerID(pID), teamID(tID), playerType(pType), - shipType(sType) + SweeperType(sType) { currentState = &state[0]; bufferState = &state[1]; @@ -32,19 +32,19 @@ Logic::Logic(int64_t pID, int64_t tID, THUAI7::PlayerType pType, THUAI7::ShipTyp playerTeam = THUAI7::PlayerTeam::Blue; } -std::vector> Logic::GetShips() const +std::vector> Logic::GetSweepers() const { std::unique_lock lock(mtxState); - std::vector> temp(currentState->ships.begin(), currentState->ships.end()); - logger->debug("Called GetShips"); + std::vector> temp(currentState->Sweepers.begin(), currentState->Sweepers.end()); + logger->debug("Called GetSweepers"); return temp; } -std::vector> Logic::GetEnemyShips() const +std::vector> Logic::GetEnemySweepers() const { std::unique_lock lock(mtxState); - std::vector> temp(currentState->enemyShips.begin(), currentState->enemyShips.end()); - logger->debug("Called GetEnemyShip"); + std::vector> temp(currentState->enemySweepers.begin(), currentState->enemySweepers.end()); + logger->debug("Called GetEnemySweeper"); return temp; } @@ -56,11 +56,11 @@ std::vector> Logic::GetBullets() const return temp; } -std::shared_ptr Logic::ShipGetSelfInfo() const +std::shared_ptr Logic::SweeperGetSelfInfo() const { std::unique_lock lock(mtxState); - logger->debug("Called ShipGetSelfInfo"); - return currentState->shipSelf; + logger->debug("Called SweeperGetSelfInfo"); + return currentState->SweeperSelf; } std::shared_ptr Logic::TeamGetSelfInfo() const @@ -94,17 +94,17 @@ int32_t Logic::GetConstructionHp(int32_t cellX, int32_t cellY) const std::unique_lock lock(mtxState); logger->debug("Called GetConstructionHp"); auto pos = std::make_pair(cellX, cellY); - auto it = currentState->mapInfo->factoryState.find(pos); - auto it2 = currentState->mapInfo->communityState.find(pos); - auto it3 = currentState->mapInfo->fortState.find(pos); - if (it != currentState->mapInfo->factoryState.end()) + auto it = currentState->mapInfo->recycleBankState.find(pos); + auto it2 = currentState->mapInfo->chargeStationState.find(pos); + auto it3 = currentState->mapInfo->signalTowerState.find(pos); + if (it != currentState->mapInfo->recycleBankState.end()) { - return currentState->mapInfo->factoryState[pos].first; + return currentState->mapInfo->recycleBankState[pos].first; } - else if (it2 != currentState->mapInfo->communityState.end()) - return currentState->mapInfo->communityState[pos].first; - else if (it3 != currentState->mapInfo->fortState.end()) - return currentState->mapInfo->fortState[pos].first; + else if (it2 != currentState->mapInfo->chargeStationState.end()) + return currentState->mapInfo->chargeStationState[pos].first; + else if (it3 != currentState->mapInfo->signalTowerState.end()) + return currentState->mapInfo->signalTowerState[pos].first; else { logger->warn("Construction not found"); @@ -112,19 +112,19 @@ int32_t Logic::GetConstructionHp(int32_t cellX, int32_t cellY) const } } -int32_t Logic::GetWormHp(int32_t cellX, int32_t cellY) const +int32_t Logic::GetBridgeHp(int32_t cellX, int32_t cellY) const { std::unique_lock lock(mtxState); - logger->debug("Called GetWormHp"); + logger->debug("Called GetBridgeHp"); auto pos = std::make_pair(cellX, cellY); - auto it = currentState->mapInfo->wormholeState.find(pos); - if (it != currentState->mapInfo->wormholeState.end()) + auto it = currentState->mapInfo->bridgeState.find(pos); + if (it != currentState->mapInfo->bridgeState.end()) { - return currentState->mapInfo->wormholeState[pos]; + return currentState->mapInfo->bridgeState[pos]; } else { - logger->warn("Worm not found"); + logger->warn("Bridge not found"); return -1; } } @@ -138,19 +138,19 @@ int32_t Logic::GetHomeHp() const return currentState->gameInfo->blueHomeHp; } -int32_t Logic::GetResourceState(int32_t cellX, int32_t cellY) const +int32_t Logic::GetGarbageState(int32_t cellX, int32_t cellY) const { std::unique_lock lock(mtxState); - logger->debug("Called GetResourceState"); + logger->debug("Called GetGarbageState"); auto pos = std::make_pair(cellX, cellY); - auto it = currentState->mapInfo->resourceState.find(pos); - if (it != currentState->mapInfo->resourceState.end()) + auto it = currentState->mapInfo->garbageState.find(pos); + if (it != currentState->mapInfo->garbageState.end()) { - return currentState->mapInfo->resourceState[pos]; + return currentState->mapInfo->garbageState[pos]; } else { - logger->warn("Resource not found"); + logger->warn("Garbage not found"); return -1; } } @@ -242,10 +242,10 @@ bool Logic::Construct(THUAI7::ConstructionType constructiontype) return pComm->Construct(playerID, teamID, constructiontype); } -bool Logic::BuildShip(THUAI7::ShipType shiptype, int32_t x, int32_t y) +bool Logic::BuildSweeper(THUAI7::SweeperType Sweepertype, int32_t x, int32_t y) { - logger->debug("Called BuildShip"); - return pComm->BuildShip(teamID, shiptype, x, y); + logger->debug("Called BuildSweeper"); + return pComm->BuildSweeper(teamID, Sweepertype, x, y); } // 等待完成 @@ -295,7 +295,7 @@ void Logic::ProcessMessage() int32_t x = 0; int32_t y = 0; logger->info("Message thread start!"); - pComm->AddPlayer(playerID, teamID, shipType, x, y); + pComm->AddPlayer(playerID, teamID, SweeperType, x, y); while (gameState != THUAI7::GameState::GameEnd) { auto clientMsg = pComm->GetMessage2Client(); // 在获得新消息之前阻塞 @@ -375,23 +375,23 @@ void Logic::ProcessMessage() void Logic::LoadBufferSelf(const protobuf::MessageToClient& message) { - if (playerType == THUAI7::PlayerType::Ship) // 本身是船 + if (playerType == THUAI7::PlayerType::Sweeper) // 本身是船 { for (const auto& item : message.obj_message()) { - if (Proto2THUAI7::messageOfObjDict[item.message_of_obj_case()] == THUAI7::MessageOfObj::ShipMessage && item.ship_message().team_id() == teamID) + if (Proto2THUAI7::messageOfObjDict[item.message_of_obj_case()] == THUAI7::MessageOfObj::SweeperMessage && item.sweeper_message().team_id() == teamID) { - if (item.ship_message().player_id() == playerID) + if (item.sweeper_message().player_id() == playerID) { - bufferState->shipSelf = Proto2THUAI7::Protobuf2THUAI7Ship(item.ship_message()); - bufferState->ships.push_back(bufferState->shipSelf); - logger->debug("Add Self Ship!"); + bufferState->SweeperSelf = Proto2THUAI7::Protobuf2THUAI7Sweeper(item.sweeper_message()); + bufferState->Sweepers.push_back(bufferState->SweeperSelf); + logger->debug("Add Self Sweeper!"); } else { - std::shared_ptr ship = Proto2THUAI7::Protobuf2THUAI7Ship(item.ship_message()); - bufferState->ships.push_back(ship); - logger->debug("Add Ship!"); + std::shared_ptr Sweeper = Proto2THUAI7::Protobuf2THUAI7Sweeper(item.sweeper_message()); + bufferState->Sweepers.push_back(Sweeper); + logger->debug("Add Sweeper!"); } } } @@ -419,19 +419,19 @@ void Logic::LoadBufferSelf(const protobuf::MessageToClient& message) void Logic::LoadBufferCase(const protobuf::MessageOfObj& item) { - if (playerType == THUAI7::PlayerType::Ship) + if (playerType == THUAI7::PlayerType::Sweeper) { int32_t x, y, viewRange; - x = bufferState->shipSelf->x, y = bufferState->shipSelf->y, viewRange = bufferState->shipSelf->viewRange; + x = bufferState->SweeperSelf->x, y = bufferState->SweeperSelf->y, viewRange = bufferState->SweeperSelf->viewRange; switch (Proto2THUAI7::messageOfObjDict[item.message_of_obj_case()]) { - case THUAI7::MessageOfObj::ShipMessage: - if (teamID != item.ship_message().team_id()) + case THUAI7::MessageOfObj::SweeperMessage: + if (teamID != item.sweeper_message().team_id()) { - if (AssistFunction::HaveView(x, y, item.ship_message().x(), item.ship_message().y(), viewRange, bufferState->gameMap)) + if (AssistFunction::HaveView(x, y, item.sweeper_message().x(), item.sweeper_message().y(), viewRange, bufferState->gameMap)) { - bufferState->enemyShips.push_back(Proto2THUAI7::Protobuf2THUAI7Ship(item.ship_message())); - logger->debug("Add Enemyship!"); + bufferState->enemySweepers.push_back(Proto2THUAI7::Protobuf2THUAI7Sweeper(item.sweeper_message())); + logger->debug("Add EnemySweeper!"); } } break; @@ -442,125 +442,125 @@ void Logic::LoadBufferCase(const protobuf::MessageOfObj& item) logger->debug("Add Bullet!"); } break; - case THUAI7::MessageOfObj::FactoryMessage: - if (item.factory_message().team_id() == teamID) + case THUAI7::MessageOfObj::RecycleBankMessage: + if (item.recyclebank_message().team_id() == teamID) { - auto pos = std::make_pair(AssistFunction::GridToCell(item.factory_message().x()), AssistFunction::GridToCell(item.factory_message().y())); - if (bufferState->mapInfo->factoryState.count(pos) == 0) + auto pos = std::make_pair(AssistFunction::GridToCell(item.recyclebank_message().x()), AssistFunction::GridToCell(item.recyclebank_message().y())); + if (bufferState->mapInfo->recycleBankState.count(pos) == 0) { - bufferState->mapInfo->factoryState.emplace(pos, std::make_pair(item.factory_message().team_id(), item.factory_message().hp())); - logger->debug("Add Factory!"); + bufferState->mapInfo->recycleBankState.emplace(pos, std::make_pair(item.recyclebank_message().team_id(), item.recyclebank_message().hp())); + logger->debug("Add RecycleBank!"); } else { - bufferState->mapInfo->factoryState[pos].second = item.factory_message().hp(); - logger->debug("Update Factory!"); + bufferState->mapInfo->recycleBankState[pos].second = item.recyclebank_message().hp(); + logger->debug("Update RecycleBank!"); } } - else if (AssistFunction::HaveView(x, y, item.factory_message().x(), item.factory_message().y(), viewRange, bufferState->gameMap)) + else if (AssistFunction::HaveView(x, y, item.recyclebank_message().x(), item.recyclebank_message().y(), viewRange, bufferState->gameMap)) { - auto pos = std::make_pair(AssistFunction::GridToCell(item.factory_message().x()), AssistFunction::GridToCell(item.factory_message().y())); - if (bufferState->mapInfo->factoryState.count(pos) == 0) + auto pos = std::make_pair(AssistFunction::GridToCell(item.recyclebank_message().x()), AssistFunction::GridToCell(item.recyclebank_message().y())); + if (bufferState->mapInfo->recycleBankState.count(pos) == 0) { - bufferState->mapInfo->factoryState.emplace(pos, std::make_pair(item.factory_message().team_id(), item.factory_message().hp())); - logger->debug("Add Factory!"); + bufferState->mapInfo->recycleBankState.emplace(pos, std::make_pair(item.recyclebank_message().team_id(), item.recyclebank_message().hp())); + logger->debug("Add RecycleBank!"); } else { - bufferState->mapInfo->factoryState[pos].second = item.factory_message().hp(); - logger->debug("Update Factory!"); + bufferState->mapInfo->recycleBankState[pos].second = item.recyclebank_message().hp(); + logger->debug("Update RecycleBank!"); } } break; - case THUAI7::MessageOfObj::CommunityMessage: - if (item.community_message().team_id() == teamID) + case THUAI7::MessageOfObj::ChargeStationMessage: + if (item.chargestation_message().team_id() == teamID) { - auto pos = std::make_pair(AssistFunction::GridToCell(item.community_message().x()), AssistFunction::GridToCell(item.community_message().y())); - if (bufferState->mapInfo->communityState.count(pos) == 0) + auto pos = std::make_pair(AssistFunction::GridToCell(item.chargestation_message().x()), AssistFunction::GridToCell(item.chargestation_message().y())); + if (bufferState->mapInfo->chargeStationState.count(pos) == 0) { - bufferState->mapInfo->communityState.emplace(pos, std::make_pair(item.community_message().team_id(), item.community_message().hp())); - logger->debug("Add Community!"); + bufferState->mapInfo->chargeStationState.emplace(pos, std::make_pair(item.chargestation_message().team_id(), item.chargestation_message().hp())); + logger->debug("Add ChargeStation!"); } else { - bufferState->mapInfo->communityState[pos].second = item.community_message().hp(); - logger->debug("Update Community!"); + bufferState->mapInfo->chargeStationState[pos].second = item.chargestation_message().hp(); + logger->debug("Update ChargeStation!"); } } - else if (AssistFunction::HaveView(x, y, item.community_message().x(), item.community_message().y(), viewRange, bufferState->gameMap)) + else if (AssistFunction::HaveView(x, y, item.chargestation_message().x(), item.chargestation_message().y(), viewRange, bufferState->gameMap)) { - auto pos = std::make_pair(AssistFunction::GridToCell(item.community_message().x()), AssistFunction::GridToCell(item.community_message().y())); - if (bufferState->mapInfo->communityState.count(pos) == 0) + auto pos = std::make_pair(AssistFunction::GridToCell(item.chargestation_message().x()), AssistFunction::GridToCell(item.chargestation_message().y())); + if (bufferState->mapInfo->chargeStationState.count(pos) == 0) { - bufferState->mapInfo->communityState.emplace(pos, std::make_pair(item.community_message().team_id(), item.community_message().hp())); - logger->debug("Add Community!"); + bufferState->mapInfo->chargeStationState.emplace(pos, std::make_pair(item.chargestation_message().team_id(), item.chargestation_message().hp())); + logger->debug("Add ChargeStation!"); } else { - bufferState->mapInfo->communityState[pos].second = item.community_message().hp(); - logger->debug("Update Community!"); + bufferState->mapInfo->chargeStationState[pos].second = item.chargestation_message().hp(); + logger->debug("Update ChargeStation!"); } } break; - case THUAI7::MessageOfObj::FortMessage: - if (item.fort_message().team_id() == teamID) + case THUAI7::MessageOfObj::SignalTowerMessage: + if (item.signaltower_message().team_id() == teamID) { - auto pos = std::make_pair(AssistFunction::GridToCell(item.fort_message().x()), AssistFunction::GridToCell(item.fort_message().y())); - if (bufferState->mapInfo->fortState.count(pos) == 0) + auto pos = std::make_pair(AssistFunction::GridToCell(item.signaltower_message().x()), AssistFunction::GridToCell(item.signaltower_message().y())); + if (bufferState->mapInfo->signalTowerState.count(pos) == 0) { - bufferState->mapInfo->fortState.emplace(pos, std::make_pair(item.fort_message().team_id(), item.fort_message().hp())); - logger->debug("Add Fort!"); + bufferState->mapInfo->signalTowerState.emplace(pos, std::make_pair(item.signaltower_message().team_id(), item.signaltower_message().hp())); + logger->debug("Add SignalTower!"); } else { - bufferState->mapInfo->fortState[pos].second = item.fort_message().hp(); - logger->debug("Update Fort!"); + bufferState->mapInfo->signalTowerState[pos].second = item.signaltower_message().hp(); + logger->debug("Update SignalTower!"); } } - else if (AssistFunction::HaveView(x, y, item.fort_message().x(), item.fort_message().y(), viewRange, bufferState->gameMap)) + else if (AssistFunction::HaveView(x, y, item.signaltower_message().x(), item.signaltower_message().y(), viewRange, bufferState->gameMap)) { - auto pos = std::make_pair(AssistFunction::GridToCell(item.fort_message().x()), AssistFunction::GridToCell(item.fort_message().y())); - if (bufferState->mapInfo->fortState.count(pos) == 0) + auto pos = std::make_pair(AssistFunction::GridToCell(item.signaltower_message().x()), AssistFunction::GridToCell(item.signaltower_message().y())); + if (bufferState->mapInfo->signalTowerState.count(pos) == 0) { - bufferState->mapInfo->fortState.emplace(pos, std::make_pair(item.fort_message().team_id(), item.fort_message().hp())); - logger->debug("Add Fort!"); + bufferState->mapInfo->signalTowerState.emplace(pos, std::make_pair(item.signaltower_message().team_id(), item.signaltower_message().hp())); + logger->debug("Add SignalTower!"); } else { - bufferState->mapInfo->fortState[pos].second = item.fort_message().hp(); - logger->debug("Update Fort!"); + bufferState->mapInfo->signalTowerState[pos].second = item.signaltower_message().hp(); + logger->debug("Update SignalTower!"); } } break; - case THUAI7::MessageOfObj::WormholeMessage: - if (AssistFunction::HaveView(x, y, item.wormhole_message().x(), item.wormhole_message().y(), viewRange, bufferState->gameMap)) + case THUAI7::MessageOfObj::BridgeMessage: + if (AssistFunction::HaveView(x, y, item.bridge_message().x(), item.bridge_message().y(), viewRange, bufferState->gameMap)) { - auto pos = std::make_pair(AssistFunction::GridToCell(item.wormhole_message().x()), AssistFunction::GridToCell(item.wormhole_message().y())); - if (bufferState->mapInfo->wormholeState.count(pos) == 0) + auto pos = std::make_pair(AssistFunction::GridToCell(item.bridge_message().x()), AssistFunction::GridToCell(item.bridge_message().y())); + if (bufferState->mapInfo->bridgeState.count(pos) == 0) { - bufferState->mapInfo->wormholeState.emplace(pos, item.wormhole_message().hp()); - logger->debug("Add Wormhole!"); + bufferState->mapInfo->bridgeState.emplace(pos, item.bridge_message().hp()); + logger->debug("Add Bridge!"); } else { - bufferState->mapInfo->wormholeState[pos] = item.wormhole_message().hp(); - logger->debug("Update Wormhole!"); + bufferState->mapInfo->bridgeState[pos] = item.bridge_message().hp(); + logger->debug("Update Bridge!"); } } break; - case THUAI7::MessageOfObj::ResourceMessage: - if (AssistFunction::HaveView(x, y, item.resource_message().x(), item.resource_message().y(), viewRange, bufferState->gameMap)) + case THUAI7::MessageOfObj::GarbageMessage: + if (AssistFunction::HaveView(x, y, item.garbage_message().x(), item.garbage_message().y(), viewRange, bufferState->gameMap)) { - auto pos = std::make_pair(AssistFunction::GridToCell(item.resource_message().x()), AssistFunction::GridToCell(item.resource_message().y())); - if (bufferState->mapInfo->resourceState.count(pos) == 0) + auto pos = std::make_pair(AssistFunction::GridToCell(item.garbage_message().x()), AssistFunction::GridToCell(item.garbage_message().y())); + if (bufferState->mapInfo->garbageState.count(pos) == 0) { - bufferState->mapInfo->resourceState.emplace(pos, item.resource_message().progress()); - logger->debug("Add Resouce!"); + bufferState->mapInfo->garbageState.emplace(pos, item.garbage_message().progress()); + logger->debug("Add Garbage!"); } else { - bufferState->mapInfo->resourceState[pos] = item.resource_message().progress(); - logger->debug("Update Resource!"); + bufferState->mapInfo->garbageState[pos] = item.garbage_message().progress(); + logger->debug("Update Garbage!"); } } break; @@ -598,16 +598,16 @@ void Logic::LoadBuffer(const protobuf::MessageToClient& message) std::lock_guard lock(mtxBuffer); // 清空原有信息 - bufferState->ships.clear(); - bufferState->enemyShips.clear(); + bufferState->Sweepers.clear(); + bufferState->enemySweepers.clear(); bufferState->bullets.clear(); bufferState->guids.clear(); logger->debug("Buffer cleared!"); // 读取新的信息 for (const auto& obj : message.obj_message()) - if (Proto2THUAI7::messageOfObjDict[obj.message_of_obj_case()] == THUAI7::MessageOfObj::ShipMessage) - bufferState->guids.push_back(obj.ship_message().guid()); + if (Proto2THUAI7::messageOfObjDict[obj.message_of_obj_case()] == THUAI7::MessageOfObj::SweeperMessage) + bufferState->guids.push_back(obj.sweeper_message().guid()); // TODO // else if (Proto2THUAI7::messageOfObjDict[obj.message_of_obj_case()] == THUAI7::MessageOfObj::HomeMessage) // bufferState->guids.push_back(obj.home_message().guid()); @@ -720,8 +720,8 @@ void Logic::Main(CreateAIFunc createAI, std::string IP, std::string port, bool f logger->info("*********Basic Info*********"); logger->info("asynchronous: {}", asynchronous); logger->info("server: {}:{}", IP, port); - if (playerType == THUAI7::PlayerType::Ship) - logger->info("ship ID: {}", playerID); + if (playerType == THUAI7::PlayerType::Sweeper) + logger->info("Sweeper ID: {}", playerID); logger->info("player team: {}", THUAI7::playerTeamDict[playerTeam]); logger->info("****************************"); @@ -729,12 +729,12 @@ void Logic::Main(CreateAIFunc createAI, std::string IP, std::string port, bool f pComm = std::make_unique(IP, port); // 构造timer - if (playerType == THUAI7::PlayerType::Ship) + if (playerType == THUAI7::PlayerType::Sweeper) { if (!file && !print) - timer = std::make_unique(*this); + timer = std::make_unique(*this); else - timer = std::make_unique(*this, file, print, warnOnly, playerID); + timer = std::make_unique(*this, file, print, warnOnly, playerID); } else { diff --git a/CAPI/cpp/API/src/main.cpp b/CAPI/cpp/API/src/main.cpp index ff8d180a..12ecb3f2 100755 --- a/CAPI/cpp/API/src/main.cpp +++ b/CAPI/cpp/API/src/main.cpp @@ -40,7 +40,7 @@ int THUAI7Main(int argc, char** argv, CreateAIFunc AIBuilder) bool file = false; bool print = false; bool warnOnly = false; - extern const std::array shipTypeDict; + extern const std::array SweeperTypeDict; // { // file = true; // print = true; @@ -101,19 +101,19 @@ int THUAI7Main(int argc, char** argv, CreateAIFunc AIBuilder) try { THUAI7::PlayerType playerType; - THUAI7::ShipType shipType = THUAI7::ShipType::NullShipType; + THUAI7::SweeperType SweeperType = THUAI7::SweeperType::NullSweeperType; if (pID == 0) playerType = THUAI7::PlayerType::Team; else { - playerType = THUAI7::PlayerType::Ship; - shipType = shipTypeDict[pID]; + playerType = THUAI7::PlayerType::Sweeper; + SweeperType = SweeperTypeDict[pID]; } #ifdef _MSC_VER std::cout << welcomeString << std::endl; #endif - Logic logic(pID, tID, playerType, shipType); + Logic logic(pID, tID, playerType, SweeperType); logic.Main(AIBuilder, sIP, sPort, file, print, warnOnly); } catch (const std::exception& e) diff --git a/CAPI/cpp/proto/Message2Clients.pb.cc b/CAPI/cpp/proto/Message2Clients.pb.cc index f4bbb2b1..c9c99821 100644 --- a/CAPI/cpp/proto/Message2Clients.pb.cc +++ b/CAPI/cpp/proto/Message2Clients.pb.cc @@ -22,28 +22,28 @@ namespace _pbi = _pb::internal; namespace protobuf { - PROTOBUF_CONSTEXPR MessageOfShip::MessageOfShip( + PROTOBUF_CONSTEXPR MessageOfSweeper::MessageOfSweeper( ::_pbi::ConstantInitialized ) : _impl_{ - /*decltype(_impl_.x_)*/ 0, /*decltype(_impl_.y_)*/ 0, /*decltype(_impl_.speed_)*/ 0, /*decltype(_impl_.hp_)*/ 0, /*decltype(_impl_.armor_)*/ 0, /*decltype(_impl_.shield_)*/ 0, /*decltype(_impl_.team_id_)*/ int64_t{0}, /*decltype(_impl_.player_id_)*/ int64_t{0}, /*decltype(_impl_.guid_)*/ int64_t{0}, /*decltype(_impl_.ship_state_)*/ 0, /*decltype(_impl_.ship_type_)*/ 0, /*decltype(_impl_.view_range_)*/ 0, /*decltype(_impl_.producer_type_)*/ 0, /*decltype(_impl_.constructor_type_)*/ 0, /*decltype(_impl_.armor_type_)*/ 0, /*decltype(_impl_.shield_type_)*/ 0, /*decltype(_impl_.weapon_type_)*/ 0, /*decltype(_impl_.facing_direction_)*/ 0, /*decltype(_impl_._cached_size_)*/ {}} + /*decltype(_impl_.x_)*/ 0, /*decltype(_impl_.y_)*/ 0, /*decltype(_impl_.speed_)*/ 0, /*decltype(_impl_.hp_)*/ 0, /*decltype(_impl_.armor_)*/ 0, /*decltype(_impl_.shield_)*/ 0, /*decltype(_impl_.team_id_)*/ int64_t{0}, /*decltype(_impl_.player_id_)*/ int64_t{0}, /*decltype(_impl_.guid_)*/ int64_t{0}, /*decltype(_impl_.sweeper_state_)*/ 0, /*decltype(_impl_.sweeper_type_)*/ 0, /*decltype(_impl_.view_range_)*/ 0, /*decltype(_impl_.producer_type_)*/ 0, /*decltype(_impl_.constructor_type_)*/ 0, /*decltype(_impl_.armor_type_)*/ 0, /*decltype(_impl_.shield_type_)*/ 0, /*decltype(_impl_.weapon_type_)*/ 0, /*decltype(_impl_.facing_direction_)*/ 0, /*decltype(_impl_._cached_size_)*/ {}} { } - struct MessageOfShipDefaultTypeInternal + struct MessageOfSweeperDefaultTypeInternal { - PROTOBUF_CONSTEXPR MessageOfShipDefaultTypeInternal() : + PROTOBUF_CONSTEXPR MessageOfSweeperDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) { } - ~MessageOfShipDefaultTypeInternal() + ~MessageOfSweeperDefaultTypeInternal() { } union { - MessageOfShip _instance; + MessageOfSweeper _instance; }; }; - PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 MessageOfShipDefaultTypeInternal _MessageOfShip_default_instance_; + PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 MessageOfSweeperDefaultTypeInternal _MessageOfSweeper_default_instance_; PROTOBUF_CONSTEXPR MessageOfBullet::MessageOfBullet( ::_pbi::ConstantInitialized ) : @@ -88,116 +88,116 @@ namespace protobuf }; }; PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 MessageOfBombedBulletDefaultTypeInternal _MessageOfBombedBullet_default_instance_; - PROTOBUF_CONSTEXPR MessageOfFactory::MessageOfFactory( + PROTOBUF_CONSTEXPR MessageOfRecycleBank::MessageOfRecycleBank( ::_pbi::ConstantInitialized ) : _impl_{ /*decltype(_impl_.x_)*/ 0, /*decltype(_impl_.y_)*/ 0, /*decltype(_impl_.team_id_)*/ int64_t{0}, /*decltype(_impl_.hp_)*/ 0, /*decltype(_impl_._cached_size_)*/ {}} { } - struct MessageOfFactoryDefaultTypeInternal + struct MessageOfRecycleBankDefaultTypeInternal { - PROTOBUF_CONSTEXPR MessageOfFactoryDefaultTypeInternal() : + PROTOBUF_CONSTEXPR MessageOfRecycleBankDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) { } - ~MessageOfFactoryDefaultTypeInternal() + ~MessageOfRecycleBankDefaultTypeInternal() { } union { - MessageOfFactory _instance; + MessageOfRecycleBank _instance; }; }; - PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 MessageOfFactoryDefaultTypeInternal _MessageOfFactory_default_instance_; - PROTOBUF_CONSTEXPR MessageOfCommunity::MessageOfCommunity( + PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 MessageOfRecycleBankDefaultTypeInternal _MessageOfRecycleBank_default_instance_; + PROTOBUF_CONSTEXPR MessageOfChargeStation::MessageOfChargeStation( ::_pbi::ConstantInitialized ) : _impl_{ /*decltype(_impl_.x_)*/ 0, /*decltype(_impl_.y_)*/ 0, /*decltype(_impl_.team_id_)*/ int64_t{0}, /*decltype(_impl_.hp_)*/ 0, /*decltype(_impl_._cached_size_)*/ {}} { } - struct MessageOfCommunityDefaultTypeInternal + struct MessageOfChargeStationDefaultTypeInternal { - PROTOBUF_CONSTEXPR MessageOfCommunityDefaultTypeInternal() : + PROTOBUF_CONSTEXPR MessageOfChargeStationDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) { } - ~MessageOfCommunityDefaultTypeInternal() + ~MessageOfChargeStationDefaultTypeInternal() { } union { - MessageOfCommunity _instance; + MessageOfChargeStation _instance; }; }; - PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 MessageOfCommunityDefaultTypeInternal _MessageOfCommunity_default_instance_; - PROTOBUF_CONSTEXPR MessageOfFort::MessageOfFort( + PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 MessageOfChargeStationDefaultTypeInternal _MessageOfChargeStation_default_instance_; + PROTOBUF_CONSTEXPR MessageOfSignalTower::MessageOfSignalTower( ::_pbi::ConstantInitialized ) : _impl_{ /*decltype(_impl_.x_)*/ 0, /*decltype(_impl_.y_)*/ 0, /*decltype(_impl_.team_id_)*/ int64_t{0}, /*decltype(_impl_.hp_)*/ 0, /*decltype(_impl_._cached_size_)*/ {}} { } - struct MessageOfFortDefaultTypeInternal + struct MessageOfSignalTowerDefaultTypeInternal { - PROTOBUF_CONSTEXPR MessageOfFortDefaultTypeInternal() : + PROTOBUF_CONSTEXPR MessageOfSignalTowerDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) { } - ~MessageOfFortDefaultTypeInternal() + ~MessageOfSignalTowerDefaultTypeInternal() { } union { - MessageOfFort _instance; + MessageOfSignalTower _instance; }; }; - PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 MessageOfFortDefaultTypeInternal _MessageOfFort_default_instance_; - PROTOBUF_CONSTEXPR MessageOfWormhole::MessageOfWormhole( + PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 MessageOfSignalTowerDefaultTypeInternal _MessageOfSignalTower_default_instance_; + PROTOBUF_CONSTEXPR MessageOfBridge::MessageOfBridge( ::_pbi::ConstantInitialized ) : _impl_{ /*decltype(_impl_.x_)*/ 0, /*decltype(_impl_.y_)*/ 0, /*decltype(_impl_.hp_)*/ 0, /*decltype(_impl_._cached_size_)*/ {}} { } - struct MessageOfWormholeDefaultTypeInternal + struct MessageOfBridgeDefaultTypeInternal { - PROTOBUF_CONSTEXPR MessageOfWormholeDefaultTypeInternal() : + PROTOBUF_CONSTEXPR MessageOfBridgeDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) { } - ~MessageOfWormholeDefaultTypeInternal() + ~MessageOfBridgeDefaultTypeInternal() { } union { - MessageOfWormhole _instance; + MessageOfBridge _instance; }; }; - PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 MessageOfWormholeDefaultTypeInternal _MessageOfWormhole_default_instance_; - PROTOBUF_CONSTEXPR MessageOfResource::MessageOfResource( + PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 MessageOfBridgeDefaultTypeInternal _MessageOfBridge_default_instance_; + PROTOBUF_CONSTEXPR MessageOfGarbage::MessageOfGarbage( ::_pbi::ConstantInitialized ) : _impl_{ /*decltype(_impl_.x_)*/ 0, /*decltype(_impl_.y_)*/ 0, /*decltype(_impl_.progress_)*/ 0, /*decltype(_impl_._cached_size_)*/ {}} { } - struct MessageOfResourceDefaultTypeInternal + struct MessageOfGarbageDefaultTypeInternal { - PROTOBUF_CONSTEXPR MessageOfResourceDefaultTypeInternal() : + PROTOBUF_CONSTEXPR MessageOfGarbageDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) { } - ~MessageOfResourceDefaultTypeInternal() + ~MessageOfGarbageDefaultTypeInternal() { } union { - MessageOfResource _instance; + MessageOfGarbage _instance; }; }; - PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 MessageOfResourceDefaultTypeInternal _MessageOfResource_default_instance_; + PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 MessageOfGarbageDefaultTypeInternal _MessageOfGarbage_default_instance_; PROTOBUF_CONSTEXPR MessageOfHome::MessageOfHome( ::_pbi::ConstantInitialized ) : @@ -396,28 +396,28 @@ namespace protobuf }; }; PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 BoolResDefaultTypeInternal _BoolRes_default_instance_; - PROTOBUF_CONSTEXPR ShipInfoRes::ShipInfoRes( + PROTOBUF_CONSTEXPR SweeperInfoRes::SweeperInfoRes( ::_pbi::ConstantInitialized ) : _impl_{ - /*decltype(_impl_.ship_info_)*/ {}, /*decltype(_impl_._cached_size_)*/ {}} + /*decltype(_impl_.sweeper_info_)*/ {}, /*decltype(_impl_._cached_size_)*/ {}} { } - struct ShipInfoResDefaultTypeInternal + struct SweeperInfoResDefaultTypeInternal { - PROTOBUF_CONSTEXPR ShipInfoResDefaultTypeInternal() : + PROTOBUF_CONSTEXPR SweeperInfoResDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) { } - ~ShipInfoResDefaultTypeInternal() + ~SweeperInfoResDefaultTypeInternal() { } union { - ShipInfoRes _instance; + SweeperInfoRes _instance; }; }; - PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 ShipInfoResDefaultTypeInternal _ShipInfoRes_default_instance_; + PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 SweeperInfoResDefaultTypeInternal _SweeperInfoRes_default_instance_; PROTOBUF_CONSTEXPR EcoRes::EcoRes( ::_pbi::ConstantInitialized ) : @@ -469,29 +469,29 @@ static constexpr ::_pb::ServiceDescriptor const** file_level_service_descriptors const uint32_t TableStruct_Message2Clients_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { ~0u, // no _has_bits_ - PROTOBUF_FIELD_OFFSET(::protobuf::MessageOfShip, _internal_metadata_), + PROTOBUF_FIELD_OFFSET(::protobuf::MessageOfSweeper, _internal_metadata_), ~0u, // no _extensions_ ~0u, // no _oneof_case_ ~0u, // no _weak_field_map_ ~0u, // no _inlined_string_donated_ - PROTOBUF_FIELD_OFFSET(::protobuf::MessageOfShip, _impl_.x_), - PROTOBUF_FIELD_OFFSET(::protobuf::MessageOfShip, _impl_.y_), - PROTOBUF_FIELD_OFFSET(::protobuf::MessageOfShip, _impl_.speed_), - PROTOBUF_FIELD_OFFSET(::protobuf::MessageOfShip, _impl_.hp_), - PROTOBUF_FIELD_OFFSET(::protobuf::MessageOfShip, _impl_.armor_), - PROTOBUF_FIELD_OFFSET(::protobuf::MessageOfShip, _impl_.shield_), - PROTOBUF_FIELD_OFFSET(::protobuf::MessageOfShip, _impl_.team_id_), - PROTOBUF_FIELD_OFFSET(::protobuf::MessageOfShip, _impl_.player_id_), - PROTOBUF_FIELD_OFFSET(::protobuf::MessageOfShip, _impl_.guid_), - PROTOBUF_FIELD_OFFSET(::protobuf::MessageOfShip, _impl_.ship_state_), - PROTOBUF_FIELD_OFFSET(::protobuf::MessageOfShip, _impl_.ship_type_), - PROTOBUF_FIELD_OFFSET(::protobuf::MessageOfShip, _impl_.view_range_), - PROTOBUF_FIELD_OFFSET(::protobuf::MessageOfShip, _impl_.producer_type_), - PROTOBUF_FIELD_OFFSET(::protobuf::MessageOfShip, _impl_.constructor_type_), - PROTOBUF_FIELD_OFFSET(::protobuf::MessageOfShip, _impl_.armor_type_), - PROTOBUF_FIELD_OFFSET(::protobuf::MessageOfShip, _impl_.shield_type_), - PROTOBUF_FIELD_OFFSET(::protobuf::MessageOfShip, _impl_.weapon_type_), - PROTOBUF_FIELD_OFFSET(::protobuf::MessageOfShip, _impl_.facing_direction_), + PROTOBUF_FIELD_OFFSET(::protobuf::MessageOfSweeper, _impl_.x_), + PROTOBUF_FIELD_OFFSET(::protobuf::MessageOfSweeper, _impl_.y_), + PROTOBUF_FIELD_OFFSET(::protobuf::MessageOfSweeper, _impl_.speed_), + PROTOBUF_FIELD_OFFSET(::protobuf::MessageOfSweeper, _impl_.hp_), + PROTOBUF_FIELD_OFFSET(::protobuf::MessageOfSweeper, _impl_.armor_), + PROTOBUF_FIELD_OFFSET(::protobuf::MessageOfSweeper, _impl_.shield_), + PROTOBUF_FIELD_OFFSET(::protobuf::MessageOfSweeper, _impl_.team_id_), + PROTOBUF_FIELD_OFFSET(::protobuf::MessageOfSweeper, _impl_.player_id_), + PROTOBUF_FIELD_OFFSET(::protobuf::MessageOfSweeper, _impl_.guid_), + PROTOBUF_FIELD_OFFSET(::protobuf::MessageOfSweeper, _impl_.sweeper_state_), + PROTOBUF_FIELD_OFFSET(::protobuf::MessageOfSweeper, _impl_.sweeper_type_), + PROTOBUF_FIELD_OFFSET(::protobuf::MessageOfSweeper, _impl_.view_range_), + PROTOBUF_FIELD_OFFSET(::protobuf::MessageOfSweeper, _impl_.producer_type_), + PROTOBUF_FIELD_OFFSET(::protobuf::MessageOfSweeper, _impl_.constructor_type_), + PROTOBUF_FIELD_OFFSET(::protobuf::MessageOfSweeper, _impl_.armor_type_), + PROTOBUF_FIELD_OFFSET(::protobuf::MessageOfSweeper, _impl_.shield_type_), + PROTOBUF_FIELD_OFFSET(::protobuf::MessageOfSweeper, _impl_.weapon_type_), + PROTOBUF_FIELD_OFFSET(::protobuf::MessageOfSweeper, _impl_.facing_direction_), ~0u, // no _has_bits_ PROTOBUF_FIELD_OFFSET(::protobuf::MessageOfBullet, _internal_metadata_), ~0u, // no _extensions_ @@ -520,53 +520,53 @@ const uint32_t TableStruct_Message2Clients_2eproto::offsets[] PROTOBUF_SECTION_V PROTOBUF_FIELD_OFFSET(::protobuf::MessageOfBombedBullet, _impl_.mapping_id_), PROTOBUF_FIELD_OFFSET(::protobuf::MessageOfBombedBullet, _impl_.bomb_range_), ~0u, // no _has_bits_ - PROTOBUF_FIELD_OFFSET(::protobuf::MessageOfFactory, _internal_metadata_), + PROTOBUF_FIELD_OFFSET(::protobuf::MessageOfRecycleBank, _internal_metadata_), ~0u, // no _extensions_ ~0u, // no _oneof_case_ ~0u, // no _weak_field_map_ ~0u, // no _inlined_string_donated_ - PROTOBUF_FIELD_OFFSET(::protobuf::MessageOfFactory, _impl_.x_), - PROTOBUF_FIELD_OFFSET(::protobuf::MessageOfFactory, _impl_.y_), - PROTOBUF_FIELD_OFFSET(::protobuf::MessageOfFactory, _impl_.hp_), - PROTOBUF_FIELD_OFFSET(::protobuf::MessageOfFactory, _impl_.team_id_), + PROTOBUF_FIELD_OFFSET(::protobuf::MessageOfRecycleBank, _impl_.x_), + PROTOBUF_FIELD_OFFSET(::protobuf::MessageOfRecycleBank, _impl_.y_), + PROTOBUF_FIELD_OFFSET(::protobuf::MessageOfRecycleBank, _impl_.hp_), + PROTOBUF_FIELD_OFFSET(::protobuf::MessageOfRecycleBank, _impl_.team_id_), ~0u, // no _has_bits_ - PROTOBUF_FIELD_OFFSET(::protobuf::MessageOfCommunity, _internal_metadata_), + PROTOBUF_FIELD_OFFSET(::protobuf::MessageOfChargeStation, _internal_metadata_), ~0u, // no _extensions_ ~0u, // no _oneof_case_ ~0u, // no _weak_field_map_ ~0u, // no _inlined_string_donated_ - PROTOBUF_FIELD_OFFSET(::protobuf::MessageOfCommunity, _impl_.x_), - PROTOBUF_FIELD_OFFSET(::protobuf::MessageOfCommunity, _impl_.y_), - PROTOBUF_FIELD_OFFSET(::protobuf::MessageOfCommunity, _impl_.hp_), - PROTOBUF_FIELD_OFFSET(::protobuf::MessageOfCommunity, _impl_.team_id_), + PROTOBUF_FIELD_OFFSET(::protobuf::MessageOfChargeStation, _impl_.x_), + PROTOBUF_FIELD_OFFSET(::protobuf::MessageOfChargeStation, _impl_.y_), + PROTOBUF_FIELD_OFFSET(::protobuf::MessageOfChargeStation, _impl_.hp_), + PROTOBUF_FIELD_OFFSET(::protobuf::MessageOfChargeStation, _impl_.team_id_), ~0u, // no _has_bits_ - PROTOBUF_FIELD_OFFSET(::protobuf::MessageOfFort, _internal_metadata_), + PROTOBUF_FIELD_OFFSET(::protobuf::MessageOfSignalTower, _internal_metadata_), ~0u, // no _extensions_ ~0u, // no _oneof_case_ ~0u, // no _weak_field_map_ ~0u, // no _inlined_string_donated_ - PROTOBUF_FIELD_OFFSET(::protobuf::MessageOfFort, _impl_.x_), - PROTOBUF_FIELD_OFFSET(::protobuf::MessageOfFort, _impl_.y_), - PROTOBUF_FIELD_OFFSET(::protobuf::MessageOfFort, _impl_.hp_), - PROTOBUF_FIELD_OFFSET(::protobuf::MessageOfFort, _impl_.team_id_), + PROTOBUF_FIELD_OFFSET(::protobuf::MessageOfSignalTower, _impl_.x_), + PROTOBUF_FIELD_OFFSET(::protobuf::MessageOfSignalTower, _impl_.y_), + PROTOBUF_FIELD_OFFSET(::protobuf::MessageOfSignalTower, _impl_.hp_), + PROTOBUF_FIELD_OFFSET(::protobuf::MessageOfSignalTower, _impl_.team_id_), ~0u, // no _has_bits_ - PROTOBUF_FIELD_OFFSET(::protobuf::MessageOfWormhole, _internal_metadata_), + PROTOBUF_FIELD_OFFSET(::protobuf::MessageOfBridge, _internal_metadata_), ~0u, // no _extensions_ ~0u, // no _oneof_case_ ~0u, // no _weak_field_map_ ~0u, // no _inlined_string_donated_ - PROTOBUF_FIELD_OFFSET(::protobuf::MessageOfWormhole, _impl_.x_), - PROTOBUF_FIELD_OFFSET(::protobuf::MessageOfWormhole, _impl_.y_), - PROTOBUF_FIELD_OFFSET(::protobuf::MessageOfWormhole, _impl_.hp_), + PROTOBUF_FIELD_OFFSET(::protobuf::MessageOfBridge, _impl_.x_), + PROTOBUF_FIELD_OFFSET(::protobuf::MessageOfBridge, _impl_.y_), + PROTOBUF_FIELD_OFFSET(::protobuf::MessageOfBridge, _impl_.hp_), ~0u, // no _has_bits_ - PROTOBUF_FIELD_OFFSET(::protobuf::MessageOfResource, _internal_metadata_), + PROTOBUF_FIELD_OFFSET(::protobuf::MessageOfGarbage, _internal_metadata_), ~0u, // no _extensions_ ~0u, // no _oneof_case_ ~0u, // no _weak_field_map_ ~0u, // no _inlined_string_donated_ - PROTOBUF_FIELD_OFFSET(::protobuf::MessageOfResource, _impl_.x_), - PROTOBUF_FIELD_OFFSET(::protobuf::MessageOfResource, _impl_.y_), - PROTOBUF_FIELD_OFFSET(::protobuf::MessageOfResource, _impl_.progress_), + PROTOBUF_FIELD_OFFSET(::protobuf::MessageOfGarbage, _impl_.x_), + PROTOBUF_FIELD_OFFSET(::protobuf::MessageOfGarbage, _impl_.y_), + PROTOBUF_FIELD_OFFSET(::protobuf::MessageOfGarbage, _impl_.progress_), ~0u, // no _has_bits_ PROTOBUF_FIELD_OFFSET(::protobuf::MessageOfHome, _internal_metadata_), ~0u, // no _extensions_ @@ -662,12 +662,12 @@ const uint32_t TableStruct_Message2Clients_2eproto::offsets[] PROTOBUF_SECTION_V ~0u, // no _inlined_string_donated_ PROTOBUF_FIELD_OFFSET(::protobuf::BoolRes, _impl_.act_success_), ~0u, // no _has_bits_ - PROTOBUF_FIELD_OFFSET(::protobuf::ShipInfoRes, _internal_metadata_), + PROTOBUF_FIELD_OFFSET(::protobuf::SweeperInfoRes, _internal_metadata_), ~0u, // no _extensions_ ~0u, // no _oneof_case_ ~0u, // no _weak_field_map_ ~0u, // no _inlined_string_donated_ - PROTOBUF_FIELD_OFFSET(::protobuf::ShipInfoRes, _impl_.ship_info_), + PROTOBUF_FIELD_OFFSET(::protobuf::SweeperInfoRes, _impl_.sweeper_info_), ~0u, // no _has_bits_ PROTOBUF_FIELD_OFFSET(::protobuf::EcoRes, _internal_metadata_), ~0u, // no _extensions_ @@ -688,14 +688,14 @@ const uint32_t TableStruct_Message2Clients_2eproto::offsets[] PROTOBUF_SECTION_V PROTOBUF_FIELD_OFFSET(::protobuf::MessageOfNews, _impl_.news_), }; static const ::_pbi::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { - {0, -1, -1, sizeof(::protobuf::MessageOfShip)}, + {0, -1, -1, sizeof(::protobuf::MessageOfSweeper)}, {24, -1, -1, sizeof(::protobuf::MessageOfBullet)}, {39, -1, -1, sizeof(::protobuf::MessageOfBombedBullet)}, - {51, -1, -1, sizeof(::protobuf::MessageOfFactory)}, - {61, -1, -1, sizeof(::protobuf::MessageOfCommunity)}, - {71, -1, -1, sizeof(::protobuf::MessageOfFort)}, - {81, -1, -1, sizeof(::protobuf::MessageOfWormhole)}, - {90, -1, -1, sizeof(::protobuf::MessageOfResource)}, + {51, -1, -1, sizeof(::protobuf::MessageOfRecycleBank)}, + {61, -1, -1, sizeof(::protobuf::MessageOfChargeStation)}, + {71, -1, -1, sizeof(::protobuf::MessageOfSignalTower)}, + {81, -1, -1, sizeof(::protobuf::MessageOfBridge)}, + {90, -1, -1, sizeof(::protobuf::MessageOfGarbage)}, {99, -1, -1, sizeof(::protobuf::MessageOfHome)}, {109, -1, -1, sizeof(::protobuf::MessageOfMap_Row)}, {116, -1, -1, sizeof(::protobuf::MessageOfMap)}, @@ -705,20 +705,20 @@ static const ::_pbi::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protode {168, -1, -1, sizeof(::protobuf::MessageToClient)}, {177, -1, -1, sizeof(::protobuf::MoveRes)}, {186, -1, -1, sizeof(::protobuf::BoolRes)}, - {193, -1, -1, sizeof(::protobuf::ShipInfoRes)}, + {193, -1, -1, sizeof(::protobuf::SweeperInfoRes)}, {200, -1, -1, sizeof(::protobuf::EcoRes)}, {207, -1, -1, sizeof(::protobuf::MessageOfNews)}, }; static const ::_pb::Message* const file_default_instances[] = { - &::protobuf::_MessageOfShip_default_instance_._instance, + &::protobuf::_MessageOfSweeper_default_instance_._instance, &::protobuf::_MessageOfBullet_default_instance_._instance, &::protobuf::_MessageOfBombedBullet_default_instance_._instance, - &::protobuf::_MessageOfFactory_default_instance_._instance, - &::protobuf::_MessageOfCommunity_default_instance_._instance, - &::protobuf::_MessageOfFort_default_instance_._instance, - &::protobuf::_MessageOfWormhole_default_instance_._instance, - &::protobuf::_MessageOfResource_default_instance_._instance, + &::protobuf::_MessageOfRecycleBank_default_instance_._instance, + &::protobuf::_MessageOfChargeStation_default_instance_._instance, + &::protobuf::_MessageOfSignalTower_default_instance_._instance, + &::protobuf::_MessageOfBridge_default_instance_._instance, + &::protobuf::_MessageOfGarbage_default_instance_._instance, &::protobuf::_MessageOfHome_default_instance_._instance, &::protobuf::_MessageOfMap_Row_default_instance_._instance, &::protobuf::_MessageOfMap_default_instance_._instance, @@ -728,83 +728,85 @@ static const ::_pb::Message* const file_default_instances[] = { &::protobuf::_MessageToClient_default_instance_._instance, &::protobuf::_MoveRes_default_instance_._instance, &::protobuf::_BoolRes_default_instance_._instance, - &::protobuf::_ShipInfoRes_default_instance_._instance, + &::protobuf::_SweeperInfoRes_default_instance_._instance, &::protobuf::_EcoRes_default_instance_._instance, &::protobuf::_MessageOfNews_default_instance_._instance, }; const char descriptor_table_protodef_Message2Clients_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = "\n\025Message2Clients.proto\022\010protobuf\032\021Messa" - "geType.proto\"\362\003\n\rMessageOfShip\022\t\n\001x\030\001 \001(" - "\005\022\t\n\001y\030\002 \001(\005\022\r\n\005speed\030\003 \001(\005\022\n\n\002hp\030\004 \001(\005\022" - "\r\n\005armor\030\005 \001(\005\022\016\n\006shield\030\006 \001(\005\022\017\n\007team_i" - "d\030\007 \001(\003\022\021\n\tplayer_id\030\010 \001(\003\022\014\n\004guid\030\t \001(\003" - "\022\'\n\nship_state\030\n \001(\0162\023.protobuf.ShipStat" - "e\022%\n\tship_type\030\013 \001(\0162\022.protobuf.ShipType" - "\022\022\n\nview_range\030\014 \001(\005\022-\n\rproducer_type\030\r " - "\001(\0162\026.protobuf.ProducerType\0223\n\020construct" - "or_type\030\016 \001(\0162\031.protobuf.ConstructorType" - "\022\'\n\narmor_type\030\017 \001(\0162\023.protobuf.ArmorTyp" - "e\022)\n\013shield_type\030\020 \001(\0162\024.protobuf.Shield" - "Type\022)\n\013weapon_type\030\021 \001(\0162\024.protobuf.Wea" - "ponType\022\030\n\020facing_direction\030\022 \001(\001\"\267\001\n\017Me" - "ssageOfBullet\022\"\n\004type\030\001 \001(\0162\024.protobuf.B" - "ulletType\022\t\n\001x\030\002 \001(\005\022\t\n\001y\030\003 \001(\005\022\030\n\020facin" - "g_direction\030\004 \001(\001\022\016\n\006damage\030\005 \001(\005\022\017\n\007tea" - "m_id\030\006 \001(\003\022\014\n\004guid\030\007 \001(\003\022\022\n\nbomb_range\030\010" - " \001(\001\022\r\n\005speed\030\t \001(\005\"\223\001\n\025MessageOfBombedB" - "ullet\022\"\n\004type\030\001 \001(\0162\024.protobuf.BulletTyp" - "e\022\t\n\001x\030\002 \001(\005\022\t\n\001y\030\003 \001(\005\022\030\n\020facing_direct" - "ion\030\004 \001(\001\022\022\n\nmapping_id\030\005 \001(\003\022\022\n\nbomb_ra" - "nge\030\006 \001(\001\"E\n\020MessageOfFactory\022\t\n\001x\030\001 \001(\005" - "\022\t\n\001y\030\002 \001(\005\022\n\n\002hp\030\003 \001(\005\022\017\n\007team_id\030\004 \001(\003" - "\"G\n\022MessageOfCommunity\022\t\n\001x\030\001 \001(\005\022\t\n\001y\030\002" - " \001(\005\022\n\n\002hp\030\003 \001(\005\022\017\n\007team_id\030\004 \001(\003\"B\n\rMes" - "sageOfFort\022\t\n\001x\030\001 \001(\005\022\t\n\001y\030\002 \001(\005\022\n\n\002hp\030\003" - " \001(\005\022\017\n\007team_id\030\004 \001(\003\"5\n\021MessageOfWormho" - "le\022\t\n\001x\030\001 \001(\005\022\t\n\001y\030\002 \001(\005\022\n\n\002hp\030\003 \001(\005\";\n\021" - "MessageOfResource\022\t\n\001x\030\001 \001(\005\022\t\n\001y\030\002 \001(\005\022" - "\020\n\010progress\030\003 \001(\005\"B\n\rMessageOfHome\022\t\n\001x\030" - "\001 \001(\005\022\t\n\001y\030\002 \001(\005\022\n\n\002hp\030\003 \001(\005\022\017\n\007team_id\030" - "\004 \001(\003\"\201\001\n\014MessageOfMap\022\016\n\006height\030\001 \001(\r\022\r" - "\n\005width\030\002 \001(\r\022(\n\004rows\030\003 \003(\0132\032.protobuf.M" - "essageOfMap.Row\032(\n\003Row\022!\n\004cols\030\001 \003(\0162\023.p" - "rotobuf.PlaceType\"_\n\rMessageOfTeam\022\017\n\007te" - "am_id\030\001 \001(\003\022\021\n\tplayer_id\030\002 \001(\003\022\r\n\005score\030" - "\003 \001(\005\022\r\n\005money\030\004 \001(\005\022\014\n\004guid\030\005 \001(\003\"\237\005\n\014M" - "essageOfObj\022/\n\014ship_message\030\001 \001(\0132\027.prot" - "obuf.MessageOfShipH\000\0223\n\016bullet_message\030\002" - " \001(\0132\031.protobuf.MessageOfBulletH\000\0225\n\017fac" - "tory_message\030\003 \001(\0132\032.protobuf.MessageOfF" - "actoryH\000\0229\n\021community_message\030\004 \001(\0132\034.pr" - "otobuf.MessageOfCommunityH\000\022/\n\014fort_mess" - "age\030\005 \001(\0132\027.protobuf.MessageOfFortH\000\0227\n\020" - "wormhole_message\030\006 \001(\0132\033.protobuf.Messag" - "eOfWormholeH\000\022/\n\014home_message\030\007 \001(\0132\027.pr" - "otobuf.MessageOfHomeH\000\0227\n\020resource_messa" - "ge\030\010 \001(\0132\033.protobuf.MessageOfResourceH\000\022" - "-\n\013map_message\030\t \001(\0132\026.protobuf.MessageO" - "fMapH\000\022/\n\014news_message\030\n \001(\0132\027.protobuf." - "MessageOfNewsH\000\022@\n\025bombed_bullet_message" - "\030\013 \001(\0132\037.protobuf.MessageOfBombedBulletH" - "\000\022/\n\014team_message\030\014 \001(\0132\027.protobuf.Messa" - "geOfTeamH\000B\020\n\016message_of_obj\"\256\001\n\014Message" - "OfAll\022\021\n\tgame_time\030\001 \001(\005\022\026\n\016red_team_sco" - "re\030\002 \001(\005\022\027\n\017blue_team_score\030\003 \001(\005\022\026\n\016red" - "_team_money\030\004 \001(\005\022\027\n\017blue_team_money\030\005 \001" - "(\005\022\023\n\013red_home_hp\030\006 \001(\005\022\024\n\014blue_home_hp\030" - "\007 \001(\005\"\224\001\n\017MessageToClient\022+\n\013obj_message" - "\030\001 \003(\0132\026.protobuf.MessageOfObj\022\'\n\ngame_s" - "tate\030\002 \001(\0162\023.protobuf.GameState\022+\n\013all_m" - "essage\030\003 \001(\0132\026.protobuf.MessageOfAll\"J\n\007" - "MoveRes\022\024\n\014actual_speed\030\001 \001(\003\022\024\n\014actual_" - "angle\030\002 \001(\001\022\023\n\013act_success\030\003 \001(\010\"\036\n\007Bool" - "Res\022\023\n\013act_success\030\001 \001(\010\"9\n\013ShipInfoRes\022" - "*\n\tship_info\030\001 \003(\0132\027.protobuf.MessageOfS" - "hip\"\031\n\006EcoRes\022\017\n\007economy\030\001 \001(\003\"i\n\rMessag" - "eOfNews\022\026\n\014text_message\030\001 \001(\tH\000\022\030\n\016binar" - "y_message\030\004 \001(\014H\000\022\017\n\007from_id\030\002 \001(\003\022\r\n\005to" - "_id\030\003 \001(\003B\006\n\004newsb\006proto3"; + "geType.proto\"\201\004\n\020MessageOfSweeper\022\t\n\001x\030\001" + " \001(\005\022\t\n\001y\030\002 \001(\005\022\r\n\005speed\030\003 \001(\005\022\n\n\002hp\030\004 \001" + "(\005\022\r\n\005armor\030\005 \001(\005\022\016\n\006shield\030\006 \001(\005\022\017\n\007tea" + "m_id\030\007 \001(\003\022\021\n\tplayer_id\030\010 \001(\003\022\014\n\004guid\030\t " + "\001(\003\022-\n\rsweeper_state\030\n \001(\0162\026.protobuf.Sw" + "eeperState\022+\n\014sweeper_type\030\013 \001(\0162\025.proto" + "buf.SweeperType\022\022\n\nview_range\030\014 \001(\005\022-\n\rp" + "roducer_type\030\r \001(\0162\026.protobuf.ProducerTy" + "pe\0223\n\020constructor_type\030\016 \001(\0162\031.protobuf." + "ConstructorType\022\'\n\narmor_type\030\017 \001(\0162\023.pr" + "otobuf.ArmorType\022)\n\013shield_type\030\020 \001(\0162\024." + "protobuf.ShieldType\022)\n\013weapon_type\030\021 \001(\016" + "2\024.protobuf.WeaponType\022\030\n\020facing_directi" + "on\030\022 \001(\001\"\267\001\n\017MessageOfBullet\022\"\n\004type\030\001 \001" + "(\0162\024.protobuf.BulletType\022\t\n\001x\030\002 \001(\005\022\t\n\001y" + "\030\003 \001(\005\022\030\n\020facing_direction\030\004 \001(\001\022\016\n\006dama" + "ge\030\005 \001(\005\022\017\n\007team_id\030\006 \001(\003\022\014\n\004guid\030\007 \001(\003\022" + "\022\n\nbomb_range\030\010 \001(\001\022\r\n\005speed\030\t \001(\005\"\223\001\n\025M" + "essageOfBombedBullet\022\"\n\004type\030\001 \001(\0162\024.pro" + "tobuf.BulletType\022\t\n\001x\030\002 \001(\005\022\t\n\001y\030\003 \001(\005\022\030" + "\n\020facing_direction\030\004 \001(\001\022\022\n\nmapping_id\030\005" + " \001(\003\022\022\n\nbomb_range\030\006 \001(\001\"I\n\024MessageOfRec" + "ycleBank\022\t\n\001x\030\001 \001(\005\022\t\n\001y\030\002 \001(\005\022\n\n\002hp\030\003 \001" + "(\005\022\017\n\007team_id\030\004 \001(\003\"K\n\026MessageOfChargeSt" + "ation\022\t\n\001x\030\001 \001(\005\022\t\n\001y\030\002 \001(\005\022\n\n\002hp\030\003 \001(\005\022" + "\017\n\007team_id\030\004 \001(\003\"I\n\024MessageOfSignalTower" + "\022\t\n\001x\030\001 \001(\005\022\t\n\001y\030\002 \001(\005\022\n\n\002hp\030\003 \001(\005\022\017\n\007te" + "am_id\030\004 \001(\003\"3\n\017MessageOfBridge\022\t\n\001x\030\001 \001(" + "\005\022\t\n\001y\030\002 \001(\005\022\n\n\002hp\030\003 \001(\005\":\n\020MessageOfGar" + "bage\022\t\n\001x\030\001 \001(\005\022\t\n\001y\030\002 \001(\005\022\020\n\010progress\030\003" + " \001(\005\"B\n\rMessageOfHome\022\t\n\001x\030\001 \001(\005\022\t\n\001y\030\002 " + "\001(\005\022\n\n\002hp\030\003 \001(\005\022\017\n\007team_id\030\004 \001(\003\"\201\001\n\014Mes" + "sageOfMap\022\016\n\006height\030\001 \001(\r\022\r\n\005width\030\002 \001(\r" + "\022(\n\004rows\030\003 \003(\0132\032.protobuf.MessageOfMap.R" + "ow\032(\n\003Row\022!\n\004cols\030\001 \003(\0162\023.protobuf.Place" + "Type\"_\n\rMessageOfTeam\022\017\n\007team_id\030\001 \001(\003\022\021" + "\n\tplayer_id\030\002 \001(\003\022\r\n\005score\030\003 \001(\005\022\r\n\005mone" + "y\030\004 \001(\005\022\014\n\004guid\030\005 \001(\003\"\275\005\n\014MessageOfObj\0225" + "\n\017sweeper_message\030\001 \001(\0132\032.protobuf.Messa" + "geOfSweeperH\000\0223\n\016bullet_message\030\002 \001(\0132\031." + "protobuf.MessageOfBulletH\000\022=\n\023recycleban" + "k_message\030\003 \001(\0132\036.protobuf.MessageOfRecy" + "cleBankH\000\022A\n\025chargestation_message\030\004 \001(\013" + "2 .protobuf.MessageOfChargeStationH\000\022=\n\023" + "signaltower_message\030\005 \001(\0132\036.protobuf.Mes" + "sageOfSignalTowerH\000\0223\n\016bridge_message\030\006 " + "\001(\0132\031.protobuf.MessageOfBridgeH\000\022/\n\014home" + "_message\030\007 \001(\0132\027.protobuf.MessageOfHomeH" + "\000\0225\n\017garbage_message\030\010 \001(\0132\032.protobuf.Me" + "ssageOfGarbageH\000\022-\n\013map_message\030\t \001(\0132\026." + "protobuf.MessageOfMapH\000\022/\n\014news_message\030" + "\n \001(\0132\027.protobuf.MessageOfNewsH\000\022@\n\025bomb" + "ed_bullet_message\030\013 \001(\0132\037.protobuf.Messa" + "geOfBombedBulletH\000\022/\n\014team_message\030\014 \001(\013" + "2\027.protobuf.MessageOfTeamH\000B\020\n\016message_o" + "f_obj\"\256\001\n\014MessageOfAll\022\021\n\tgame_time\030\001 \001(" + "\005\022\026\n\016red_team_score\030\002 \001(\005\022\027\n\017blue_team_s" + "core\030\003 \001(\005\022\026\n\016red_team_money\030\004 \001(\005\022\027\n\017bl" + "ue_team_money\030\005 \001(\005\022\023\n\013red_home_hp\030\006 \001(\005" + "\022\024\n\014blue_home_hp\030\007 \001(\005\"\224\001\n\017MessageToClie" + "nt\022+\n\013obj_message\030\001 \003(\0132\026.protobuf.Messa" + "geOfObj\022\'\n\ngame_state\030\002 \001(\0162\023.protobuf.G" + "ameState\022+\n\013all_message\030\003 \001(\0132\026.protobuf" + ".MessageOfAll\"J\n\007MoveRes\022\024\n\014actual_speed" + "\030\001 \001(\003\022\024\n\014actual_angle\030\002 \001(\001\022\023\n\013act_succ" + "ess\030\003 \001(\010\"\036\n\007BoolRes\022\023\n\013act_success\030\001 \001(" + "\010\"B\n\016SweeperInfoRes\0220\n\014sweeper_info\030\001 \003(" + "\0132\032.protobuf.MessageOfSweeper\"\031\n\006EcoRes\022" + "\017\n\007economy\030\001 \001(\003\"i\n\rMessageOfNews\022\026\n\014tex" + "t_message\030\001 \001(\tH\000\022\030\n\016binary_message\030\004 \001(" + "\014H\000\022\017\n\007from_id\030\002 \001(\003\022\r\n\005to_id\030\003 \001(\003B\006\n\004n" + "ewsb\006proto3"; static const ::_pbi::DescriptorTable* const descriptor_table_Message2Clients_2eproto_deps[1] = { &::descriptor_table_MessageType_2eproto, }; @@ -812,7 +814,7 @@ static ::_pbi::once_flag descriptor_table_Message2Clients_2eproto_once; const ::_pbi::DescriptorTable descriptor_table_Message2Clients_2eproto = { false, false, - 2825, + 2891, descriptor_table_protodef_Message2Clients_2eproto, "Message2Clients.proto", &descriptor_table_Message2Clients_2eproto_once, @@ -838,43 +840,43 @@ namespace protobuf // =================================================================== - class MessageOfShip::_Internal + class MessageOfSweeper::_Internal { public: }; - MessageOfShip::MessageOfShip(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned) : + MessageOfSweeper::MessageOfSweeper(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned) : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { SharedCtor(arena, is_message_owned); - // @@protoc_insertion_point(arena_constructor:protobuf.MessageOfShip) + // @@protoc_insertion_point(arena_constructor:protobuf.MessageOfSweeper) } - MessageOfShip::MessageOfShip(const MessageOfShip& from) : + MessageOfSweeper::MessageOfSweeper(const MessageOfSweeper& from) : ::PROTOBUF_NAMESPACE_ID::Message() { - MessageOfShip* const _this = this; + MessageOfSweeper* const _this = this; (void)_this; new (&_impl_) Impl_{ - decltype(_impl_.x_){}, decltype(_impl_.y_){}, decltype(_impl_.speed_){}, decltype(_impl_.hp_){}, decltype(_impl_.armor_){}, decltype(_impl_.shield_){}, decltype(_impl_.team_id_){}, decltype(_impl_.player_id_){}, decltype(_impl_.guid_){}, decltype(_impl_.ship_state_){}, decltype(_impl_.ship_type_){}, decltype(_impl_.view_range_){}, decltype(_impl_.producer_type_){}, decltype(_impl_.constructor_type_){}, decltype(_impl_.armor_type_){}, decltype(_impl_.shield_type_){}, decltype(_impl_.weapon_type_){}, decltype(_impl_.facing_direction_){}, /*decltype(_impl_._cached_size_)*/ {}}; + decltype(_impl_.x_){}, decltype(_impl_.y_){}, decltype(_impl_.speed_){}, decltype(_impl_.hp_){}, decltype(_impl_.armor_){}, decltype(_impl_.shield_){}, decltype(_impl_.team_id_){}, decltype(_impl_.player_id_){}, decltype(_impl_.guid_){}, decltype(_impl_.sweeper_state_){}, decltype(_impl_.sweeper_type_){}, decltype(_impl_.view_range_){}, decltype(_impl_.producer_type_){}, decltype(_impl_.constructor_type_){}, decltype(_impl_.armor_type_){}, decltype(_impl_.shield_type_){}, decltype(_impl_.weapon_type_){}, decltype(_impl_.facing_direction_){}, /*decltype(_impl_._cached_size_)*/ {}}; _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); ::memcpy(&_impl_.x_, &from._impl_.x_, static_cast(reinterpret_cast(&_impl_.facing_direction_) - reinterpret_cast(&_impl_.x_)) + sizeof(_impl_.facing_direction_)); - // @@protoc_insertion_point(copy_constructor:protobuf.MessageOfShip) + // @@protoc_insertion_point(copy_constructor:protobuf.MessageOfSweeper) } - inline void MessageOfShip::SharedCtor( + inline void MessageOfSweeper::SharedCtor( ::_pb::Arena* arena, bool is_message_owned ) { (void)arena; (void)is_message_owned; new (&_impl_) Impl_{ - decltype(_impl_.x_){0}, decltype(_impl_.y_){0}, decltype(_impl_.speed_){0}, decltype(_impl_.hp_){0}, decltype(_impl_.armor_){0}, decltype(_impl_.shield_){0}, decltype(_impl_.team_id_){int64_t{0}}, decltype(_impl_.player_id_){int64_t{0}}, decltype(_impl_.guid_){int64_t{0}}, decltype(_impl_.ship_state_){0}, decltype(_impl_.ship_type_){0}, decltype(_impl_.view_range_){0}, decltype(_impl_.producer_type_){0}, decltype(_impl_.constructor_type_){0}, decltype(_impl_.armor_type_){0}, decltype(_impl_.shield_type_){0}, decltype(_impl_.weapon_type_){0}, decltype(_impl_.facing_direction_){0}, /*decltype(_impl_._cached_size_)*/ {}}; + decltype(_impl_.x_){0}, decltype(_impl_.y_){0}, decltype(_impl_.speed_){0}, decltype(_impl_.hp_){0}, decltype(_impl_.armor_){0}, decltype(_impl_.shield_){0}, decltype(_impl_.team_id_){int64_t{0}}, decltype(_impl_.player_id_){int64_t{0}}, decltype(_impl_.guid_){int64_t{0}}, decltype(_impl_.sweeper_state_){0}, decltype(_impl_.sweeper_type_){0}, decltype(_impl_.view_range_){0}, decltype(_impl_.producer_type_){0}, decltype(_impl_.constructor_type_){0}, decltype(_impl_.armor_type_){0}, decltype(_impl_.shield_type_){0}, decltype(_impl_.weapon_type_){0}, decltype(_impl_.facing_direction_){0}, /*decltype(_impl_._cached_size_)*/ {}}; } - MessageOfShip::~MessageOfShip() + MessageOfSweeper::~MessageOfSweeper() { - // @@protoc_insertion_point(destructor:protobuf.MessageOfShip) + // @@protoc_insertion_point(destructor:protobuf.MessageOfSweeper) if (auto* arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { (void)arena; @@ -883,19 +885,19 @@ namespace protobuf SharedDtor(); } - inline void MessageOfShip::SharedDtor() + inline void MessageOfSweeper::SharedDtor() { GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); } - void MessageOfShip::SetCachedSize(int size) const + void MessageOfSweeper::SetCachedSize(int size) const { _impl_._cached_size_.Set(size); } - void MessageOfShip::Clear() + void MessageOfSweeper::Clear() { - // @@protoc_insertion_point(message_clear_start:protobuf.MessageOfShip) + // @@protoc_insertion_point(message_clear_start:protobuf.MessageOfSweeper) uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void)cached_has_bits; @@ -904,7 +906,7 @@ namespace protobuf _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } - const char* MessageOfShip::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) + const char* MessageOfSweeper::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { #define CHK_(x) \ if (PROTOBUF_PREDICT_FALSE(!(x))) \ @@ -1005,24 +1007,24 @@ namespace protobuf else goto handle_unusual; continue; - // .protobuf.ShipState ship_state = 10; + // .protobuf.SweeperState sweeper_state = 10; case 10: if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 80)) { uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); CHK_(ptr); - _internal_set_ship_state(static_cast<::protobuf::ShipState>(val)); + _internal_set_sweeper_state(static_cast<::protobuf::SweeperState>(val)); } else goto handle_unusual; continue; - // .protobuf.ShipType ship_type = 11; + // .protobuf.SweeperType sweeper_type = 11; case 11: if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 88)) { uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); CHK_(ptr); - _internal_set_ship_type(static_cast<::protobuf::ShipType>(val)); + _internal_set_sweeper_type(static_cast<::protobuf::SweeperType>(val)); } else goto handle_unusual; @@ -1128,11 +1130,11 @@ namespace protobuf #undef CHK_ } - uint8_t* MessageOfShip::_InternalSerialize( + uint8_t* MessageOfSweeper::_InternalSerialize( uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream ) const { - // @@protoc_insertion_point(serialize_to_array_start:protobuf.MessageOfShip) + // @@protoc_insertion_point(serialize_to_array_start:protobuf.MessageOfSweeper) uint32_t cached_has_bits = 0; (void)cached_has_bits; @@ -1199,21 +1201,21 @@ namespace protobuf target = ::_pbi::WireFormatLite::WriteInt64ToArray(9, this->_internal_guid(), target); } - // .protobuf.ShipState ship_state = 10; - if (this->_internal_ship_state() != 0) + // .protobuf.SweeperState sweeper_state = 10; + if (this->_internal_sweeper_state() != 0) { target = stream->EnsureSpace(target); target = ::_pbi::WireFormatLite::WriteEnumToArray( - 10, this->_internal_ship_state(), target + 10, this->_internal_sweeper_state(), target ); } - // .protobuf.ShipType ship_type = 11; - if (this->_internal_ship_type() != 0) + // .protobuf.SweeperType sweeper_type = 11; + if (this->_internal_sweeper_type() != 0) { target = stream->EnsureSpace(target); target = ::_pbi::WireFormatLite::WriteEnumToArray( - 11, this->_internal_ship_type(), target + 11, this->_internal_sweeper_type(), target ); } @@ -1286,13 +1288,13 @@ namespace protobuf _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream ); } - // @@protoc_insertion_point(serialize_to_array_end:protobuf.MessageOfShip) + // @@protoc_insertion_point(serialize_to_array_end:protobuf.MessageOfSweeper) return target; } - size_t MessageOfShip::ByteSizeLong() const + size_t MessageOfSweeper::ByteSizeLong() const { - // @@protoc_insertion_point(message_byte_size_start:protobuf.MessageOfShip) + // @@protoc_insertion_point(message_byte_size_start:protobuf.MessageOfSweeper) size_t total_size = 0; uint32_t cached_has_bits = 0; @@ -1353,18 +1355,18 @@ namespace protobuf total_size += ::_pbi::WireFormatLite::Int64SizePlusOne(this->_internal_guid()); } - // .protobuf.ShipState ship_state = 10; - if (this->_internal_ship_state() != 0) + // .protobuf.SweeperState sweeper_state = 10; + if (this->_internal_sweeper_state() != 0) { total_size += 1 + - ::_pbi::WireFormatLite::EnumSize(this->_internal_ship_state()); + ::_pbi::WireFormatLite::EnumSize(this->_internal_sweeper_state()); } - // .protobuf.ShipType ship_type = 11; - if (this->_internal_ship_type() != 0) + // .protobuf.SweeperType sweeper_type = 11; + if (this->_internal_sweeper_type() != 0) { total_size += 1 + - ::_pbi::WireFormatLite::EnumSize(this->_internal_ship_type()); + ::_pbi::WireFormatLite::EnumSize(this->_internal_sweeper_type()); } // int32 view_range = 12; @@ -1421,19 +1423,19 @@ namespace protobuf return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); } - const ::PROTOBUF_NAMESPACE_ID::Message::ClassData MessageOfShip::_class_data_ = { + const ::PROTOBUF_NAMESPACE_ID::Message::ClassData MessageOfSweeper::_class_data_ = { ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, - MessageOfShip::MergeImpl}; - const ::PROTOBUF_NAMESPACE_ID::Message::ClassData* MessageOfShip::GetClassData() const + MessageOfSweeper::MergeImpl}; + const ::PROTOBUF_NAMESPACE_ID::Message::ClassData* MessageOfSweeper::GetClassData() const { return &_class_data_; } - void MessageOfShip::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) + void MessageOfSweeper::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { - auto* const _this = static_cast(&to_msg); - auto& from = static_cast(from_msg); - // @@protoc_insertion_point(class_specific_merge_from_start:protobuf.MessageOfShip) + auto* const _this = static_cast(&to_msg); + auto& from = static_cast(from_msg); + // @@protoc_insertion_point(class_specific_merge_from_start:protobuf.MessageOfSweeper) GOOGLE_DCHECK_NE(&from, _this); uint32_t cached_has_bits = 0; (void)cached_has_bits; @@ -1474,13 +1476,13 @@ namespace protobuf { _this->_internal_set_guid(from._internal_guid()); } - if (from._internal_ship_state() != 0) + if (from._internal_sweeper_state() != 0) { - _this->_internal_set_ship_state(from._internal_ship_state()); + _this->_internal_set_sweeper_state(from._internal_sweeper_state()); } - if (from._internal_ship_type() != 0) + if (from._internal_sweeper_type() != 0) { - _this->_internal_set_ship_type(from._internal_ship_type()); + _this->_internal_set_sweeper_type(from._internal_sweeper_type()); } if (from._internal_view_range() != 0) { @@ -1517,32 +1519,32 @@ namespace protobuf _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); } - void MessageOfShip::CopyFrom(const MessageOfShip& from) + void MessageOfSweeper::CopyFrom(const MessageOfSweeper& from) { - // @@protoc_insertion_point(class_specific_copy_from_start:protobuf.MessageOfShip) + // @@protoc_insertion_point(class_specific_copy_from_start:protobuf.MessageOfSweeper) if (&from == this) return; Clear(); MergeFrom(from); } - bool MessageOfShip::IsInitialized() const + bool MessageOfSweeper::IsInitialized() const { return true; } - void MessageOfShip::InternalSwap(MessageOfShip* other) + void MessageOfSweeper::InternalSwap(MessageOfSweeper* other) { using std::swap; _internal_metadata_.InternalSwap(&other->_internal_metadata_); ::PROTOBUF_NAMESPACE_ID::internal::memswap< - PROTOBUF_FIELD_OFFSET(MessageOfShip, _impl_.facing_direction_) + sizeof(MessageOfShip::_impl_.facing_direction_) - PROTOBUF_FIELD_OFFSET(MessageOfShip, _impl_.x_)>( + PROTOBUF_FIELD_OFFSET(MessageOfSweeper, _impl_.facing_direction_) + sizeof(MessageOfSweeper::_impl_.facing_direction_) - PROTOBUF_FIELD_OFFSET(MessageOfSweeper, _impl_.x_)>( reinterpret_cast(&_impl_.x_), reinterpret_cast(&other->_impl_.x_) ); } - ::PROTOBUF_NAMESPACE_ID::Metadata MessageOfShip::GetMetadata() const + ::PROTOBUF_NAMESPACE_ID::Metadata MessageOfSweeper::GetMetadata() const { return ::_pbi::AssignDescriptors( &descriptor_table_Message2Clients_2eproto_getter, &descriptor_table_Message2Clients_2eproto_once, file_level_metadata_Message2Clients_2eproto[0] @@ -2386,31 +2388,31 @@ namespace protobuf // =================================================================== - class MessageOfFactory::_Internal + class MessageOfRecycleBank::_Internal { public: }; - MessageOfFactory::MessageOfFactory(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned) : + MessageOfRecycleBank::MessageOfRecycleBank(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned) : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { SharedCtor(arena, is_message_owned); - // @@protoc_insertion_point(arena_constructor:protobuf.MessageOfFactory) + // @@protoc_insertion_point(arena_constructor:protobuf.MessageOfRecycleBank) } - MessageOfFactory::MessageOfFactory(const MessageOfFactory& from) : + MessageOfRecycleBank::MessageOfRecycleBank(const MessageOfRecycleBank& from) : ::PROTOBUF_NAMESPACE_ID::Message() { - MessageOfFactory* const _this = this; + MessageOfRecycleBank* const _this = this; (void)_this; new (&_impl_) Impl_{ decltype(_impl_.x_){}, decltype(_impl_.y_){}, decltype(_impl_.team_id_){}, decltype(_impl_.hp_){}, /*decltype(_impl_._cached_size_)*/ {}}; _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); ::memcpy(&_impl_.x_, &from._impl_.x_, static_cast(reinterpret_cast(&_impl_.hp_) - reinterpret_cast(&_impl_.x_)) + sizeof(_impl_.hp_)); - // @@protoc_insertion_point(copy_constructor:protobuf.MessageOfFactory) + // @@protoc_insertion_point(copy_constructor:protobuf.MessageOfRecycleBank) } - inline void MessageOfFactory::SharedCtor( + inline void MessageOfRecycleBank::SharedCtor( ::_pb::Arena* arena, bool is_message_owned ) { @@ -2420,9 +2422,9 @@ namespace protobuf decltype(_impl_.x_){0}, decltype(_impl_.y_){0}, decltype(_impl_.team_id_){int64_t{0}}, decltype(_impl_.hp_){0}, /*decltype(_impl_._cached_size_)*/ {}}; } - MessageOfFactory::~MessageOfFactory() + MessageOfRecycleBank::~MessageOfRecycleBank() { - // @@protoc_insertion_point(destructor:protobuf.MessageOfFactory) + // @@protoc_insertion_point(destructor:protobuf.MessageOfRecycleBank) if (auto* arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { (void)arena; @@ -2431,19 +2433,19 @@ namespace protobuf SharedDtor(); } - inline void MessageOfFactory::SharedDtor() + inline void MessageOfRecycleBank::SharedDtor() { GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); } - void MessageOfFactory::SetCachedSize(int size) const + void MessageOfRecycleBank::SetCachedSize(int size) const { _impl_._cached_size_.Set(size); } - void MessageOfFactory::Clear() + void MessageOfRecycleBank::Clear() { - // @@protoc_insertion_point(message_clear_start:protobuf.MessageOfFactory) + // @@protoc_insertion_point(message_clear_start:protobuf.MessageOfRecycleBank) uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void)cached_has_bits; @@ -2452,7 +2454,7 @@ namespace protobuf _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } - const char* MessageOfFactory::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) + const char* MessageOfRecycleBank::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { #define CHK_(x) \ if (PROTOBUF_PREDICT_FALSE(!(x))) \ @@ -2529,11 +2531,11 @@ namespace protobuf #undef CHK_ } - uint8_t* MessageOfFactory::_InternalSerialize( + uint8_t* MessageOfRecycleBank::_InternalSerialize( uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream ) const { - // @@protoc_insertion_point(serialize_to_array_start:protobuf.MessageOfFactory) + // @@protoc_insertion_point(serialize_to_array_start:protobuf.MessageOfRecycleBank) uint32_t cached_has_bits = 0; (void)cached_has_bits; @@ -2571,13 +2573,13 @@ namespace protobuf _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream ); } - // @@protoc_insertion_point(serialize_to_array_end:protobuf.MessageOfFactory) + // @@protoc_insertion_point(serialize_to_array_end:protobuf.MessageOfRecycleBank) return target; } - size_t MessageOfFactory::ByteSizeLong() const + size_t MessageOfRecycleBank::ByteSizeLong() const { - // @@protoc_insertion_point(message_byte_size_start:protobuf.MessageOfFactory) + // @@protoc_insertion_point(message_byte_size_start:protobuf.MessageOfRecycleBank) size_t total_size = 0; uint32_t cached_has_bits = 0; @@ -2611,19 +2613,19 @@ namespace protobuf return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); } - const ::PROTOBUF_NAMESPACE_ID::Message::ClassData MessageOfFactory::_class_data_ = { + const ::PROTOBUF_NAMESPACE_ID::Message::ClassData MessageOfRecycleBank::_class_data_ = { ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, - MessageOfFactory::MergeImpl}; - const ::PROTOBUF_NAMESPACE_ID::Message::ClassData* MessageOfFactory::GetClassData() const + MessageOfRecycleBank::MergeImpl}; + const ::PROTOBUF_NAMESPACE_ID::Message::ClassData* MessageOfRecycleBank::GetClassData() const { return &_class_data_; } - void MessageOfFactory::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) + void MessageOfRecycleBank::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { - auto* const _this = static_cast(&to_msg); - auto& from = static_cast(from_msg); - // @@protoc_insertion_point(class_specific_merge_from_start:protobuf.MessageOfFactory) + auto* const _this = static_cast(&to_msg); + auto& from = static_cast(from_msg); + // @@protoc_insertion_point(class_specific_merge_from_start:protobuf.MessageOfRecycleBank) GOOGLE_DCHECK_NE(&from, _this); uint32_t cached_has_bits = 0; (void)cached_has_bits; @@ -2647,32 +2649,32 @@ namespace protobuf _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); } - void MessageOfFactory::CopyFrom(const MessageOfFactory& from) + void MessageOfRecycleBank::CopyFrom(const MessageOfRecycleBank& from) { - // @@protoc_insertion_point(class_specific_copy_from_start:protobuf.MessageOfFactory) + // @@protoc_insertion_point(class_specific_copy_from_start:protobuf.MessageOfRecycleBank) if (&from == this) return; Clear(); MergeFrom(from); } - bool MessageOfFactory::IsInitialized() const + bool MessageOfRecycleBank::IsInitialized() const { return true; } - void MessageOfFactory::InternalSwap(MessageOfFactory* other) + void MessageOfRecycleBank::InternalSwap(MessageOfRecycleBank* other) { using std::swap; _internal_metadata_.InternalSwap(&other->_internal_metadata_); ::PROTOBUF_NAMESPACE_ID::internal::memswap< - PROTOBUF_FIELD_OFFSET(MessageOfFactory, _impl_.hp_) + sizeof(MessageOfFactory::_impl_.hp_) - PROTOBUF_FIELD_OFFSET(MessageOfFactory, _impl_.x_)>( + PROTOBUF_FIELD_OFFSET(MessageOfRecycleBank, _impl_.hp_) + sizeof(MessageOfRecycleBank::_impl_.hp_) - PROTOBUF_FIELD_OFFSET(MessageOfRecycleBank, _impl_.x_)>( reinterpret_cast(&_impl_.x_), reinterpret_cast(&other->_impl_.x_) ); } - ::PROTOBUF_NAMESPACE_ID::Metadata MessageOfFactory::GetMetadata() const + ::PROTOBUF_NAMESPACE_ID::Metadata MessageOfRecycleBank::GetMetadata() const { return ::_pbi::AssignDescriptors( &descriptor_table_Message2Clients_2eproto_getter, &descriptor_table_Message2Clients_2eproto_once, file_level_metadata_Message2Clients_2eproto[3] @@ -2681,31 +2683,31 @@ namespace protobuf // =================================================================== - class MessageOfCommunity::_Internal + class MessageOfChargeStation::_Internal { public: }; - MessageOfCommunity::MessageOfCommunity(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned) : + MessageOfChargeStation::MessageOfChargeStation(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned) : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { SharedCtor(arena, is_message_owned); - // @@protoc_insertion_point(arena_constructor:protobuf.MessageOfCommunity) + // @@protoc_insertion_point(arena_constructor:protobuf.MessageOfChargeStation) } - MessageOfCommunity::MessageOfCommunity(const MessageOfCommunity& from) : + MessageOfChargeStation::MessageOfChargeStation(const MessageOfChargeStation& from) : ::PROTOBUF_NAMESPACE_ID::Message() { - MessageOfCommunity* const _this = this; + MessageOfChargeStation* const _this = this; (void)_this; new (&_impl_) Impl_{ decltype(_impl_.x_){}, decltype(_impl_.y_){}, decltype(_impl_.team_id_){}, decltype(_impl_.hp_){}, /*decltype(_impl_._cached_size_)*/ {}}; _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); ::memcpy(&_impl_.x_, &from._impl_.x_, static_cast(reinterpret_cast(&_impl_.hp_) - reinterpret_cast(&_impl_.x_)) + sizeof(_impl_.hp_)); - // @@protoc_insertion_point(copy_constructor:protobuf.MessageOfCommunity) + // @@protoc_insertion_point(copy_constructor:protobuf.MessageOfChargeStation) } - inline void MessageOfCommunity::SharedCtor( + inline void MessageOfChargeStation::SharedCtor( ::_pb::Arena* arena, bool is_message_owned ) { @@ -2715,9 +2717,9 @@ namespace protobuf decltype(_impl_.x_){0}, decltype(_impl_.y_){0}, decltype(_impl_.team_id_){int64_t{0}}, decltype(_impl_.hp_){0}, /*decltype(_impl_._cached_size_)*/ {}}; } - MessageOfCommunity::~MessageOfCommunity() + MessageOfChargeStation::~MessageOfChargeStation() { - // @@protoc_insertion_point(destructor:protobuf.MessageOfCommunity) + // @@protoc_insertion_point(destructor:protobuf.MessageOfChargeStation) if (auto* arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { (void)arena; @@ -2726,19 +2728,19 @@ namespace protobuf SharedDtor(); } - inline void MessageOfCommunity::SharedDtor() + inline void MessageOfChargeStation::SharedDtor() { GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); } - void MessageOfCommunity::SetCachedSize(int size) const + void MessageOfChargeStation::SetCachedSize(int size) const { _impl_._cached_size_.Set(size); } - void MessageOfCommunity::Clear() + void MessageOfChargeStation::Clear() { - // @@protoc_insertion_point(message_clear_start:protobuf.MessageOfCommunity) + // @@protoc_insertion_point(message_clear_start:protobuf.MessageOfChargeStation) uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void)cached_has_bits; @@ -2747,7 +2749,7 @@ namespace protobuf _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } - const char* MessageOfCommunity::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) + const char* MessageOfChargeStation::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { #define CHK_(x) \ if (PROTOBUF_PREDICT_FALSE(!(x))) \ @@ -2824,11 +2826,11 @@ namespace protobuf #undef CHK_ } - uint8_t* MessageOfCommunity::_InternalSerialize( + uint8_t* MessageOfChargeStation::_InternalSerialize( uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream ) const { - // @@protoc_insertion_point(serialize_to_array_start:protobuf.MessageOfCommunity) + // @@protoc_insertion_point(serialize_to_array_start:protobuf.MessageOfChargeStation) uint32_t cached_has_bits = 0; (void)cached_has_bits; @@ -2866,13 +2868,13 @@ namespace protobuf _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream ); } - // @@protoc_insertion_point(serialize_to_array_end:protobuf.MessageOfCommunity) + // @@protoc_insertion_point(serialize_to_array_end:protobuf.MessageOfChargeStation) return target; } - size_t MessageOfCommunity::ByteSizeLong() const + size_t MessageOfChargeStation::ByteSizeLong() const { - // @@protoc_insertion_point(message_byte_size_start:protobuf.MessageOfCommunity) + // @@protoc_insertion_point(message_byte_size_start:protobuf.MessageOfChargeStation) size_t total_size = 0; uint32_t cached_has_bits = 0; @@ -2906,19 +2908,19 @@ namespace protobuf return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); } - const ::PROTOBUF_NAMESPACE_ID::Message::ClassData MessageOfCommunity::_class_data_ = { + const ::PROTOBUF_NAMESPACE_ID::Message::ClassData MessageOfChargeStation::_class_data_ = { ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, - MessageOfCommunity::MergeImpl}; - const ::PROTOBUF_NAMESPACE_ID::Message::ClassData* MessageOfCommunity::GetClassData() const + MessageOfChargeStation::MergeImpl}; + const ::PROTOBUF_NAMESPACE_ID::Message::ClassData* MessageOfChargeStation::GetClassData() const { return &_class_data_; } - void MessageOfCommunity::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) + void MessageOfChargeStation::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { - auto* const _this = static_cast(&to_msg); - auto& from = static_cast(from_msg); - // @@protoc_insertion_point(class_specific_merge_from_start:protobuf.MessageOfCommunity) + auto* const _this = static_cast(&to_msg); + auto& from = static_cast(from_msg); + // @@protoc_insertion_point(class_specific_merge_from_start:protobuf.MessageOfChargeStation) GOOGLE_DCHECK_NE(&from, _this); uint32_t cached_has_bits = 0; (void)cached_has_bits; @@ -2942,32 +2944,32 @@ namespace protobuf _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); } - void MessageOfCommunity::CopyFrom(const MessageOfCommunity& from) + void MessageOfChargeStation::CopyFrom(const MessageOfChargeStation& from) { - // @@protoc_insertion_point(class_specific_copy_from_start:protobuf.MessageOfCommunity) + // @@protoc_insertion_point(class_specific_copy_from_start:protobuf.MessageOfChargeStation) if (&from == this) return; Clear(); MergeFrom(from); } - bool MessageOfCommunity::IsInitialized() const + bool MessageOfChargeStation::IsInitialized() const { return true; } - void MessageOfCommunity::InternalSwap(MessageOfCommunity* other) + void MessageOfChargeStation::InternalSwap(MessageOfChargeStation* other) { using std::swap; _internal_metadata_.InternalSwap(&other->_internal_metadata_); ::PROTOBUF_NAMESPACE_ID::internal::memswap< - PROTOBUF_FIELD_OFFSET(MessageOfCommunity, _impl_.hp_) + sizeof(MessageOfCommunity::_impl_.hp_) - PROTOBUF_FIELD_OFFSET(MessageOfCommunity, _impl_.x_)>( + PROTOBUF_FIELD_OFFSET(MessageOfChargeStation, _impl_.hp_) + sizeof(MessageOfChargeStation::_impl_.hp_) - PROTOBUF_FIELD_OFFSET(MessageOfChargeStation, _impl_.x_)>( reinterpret_cast(&_impl_.x_), reinterpret_cast(&other->_impl_.x_) ); } - ::PROTOBUF_NAMESPACE_ID::Metadata MessageOfCommunity::GetMetadata() const + ::PROTOBUF_NAMESPACE_ID::Metadata MessageOfChargeStation::GetMetadata() const { return ::_pbi::AssignDescriptors( &descriptor_table_Message2Clients_2eproto_getter, &descriptor_table_Message2Clients_2eproto_once, file_level_metadata_Message2Clients_2eproto[4] @@ -2976,31 +2978,31 @@ namespace protobuf // =================================================================== - class MessageOfFort::_Internal + class MessageOfSignalTower::_Internal { public: }; - MessageOfFort::MessageOfFort(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned) : + MessageOfSignalTower::MessageOfSignalTower(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned) : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { SharedCtor(arena, is_message_owned); - // @@protoc_insertion_point(arena_constructor:protobuf.MessageOfFort) + // @@protoc_insertion_point(arena_constructor:protobuf.MessageOfSignalTower) } - MessageOfFort::MessageOfFort(const MessageOfFort& from) : + MessageOfSignalTower::MessageOfSignalTower(const MessageOfSignalTower& from) : ::PROTOBUF_NAMESPACE_ID::Message() { - MessageOfFort* const _this = this; + MessageOfSignalTower* const _this = this; (void)_this; new (&_impl_) Impl_{ decltype(_impl_.x_){}, decltype(_impl_.y_){}, decltype(_impl_.team_id_){}, decltype(_impl_.hp_){}, /*decltype(_impl_._cached_size_)*/ {}}; _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); ::memcpy(&_impl_.x_, &from._impl_.x_, static_cast(reinterpret_cast(&_impl_.hp_) - reinterpret_cast(&_impl_.x_)) + sizeof(_impl_.hp_)); - // @@protoc_insertion_point(copy_constructor:protobuf.MessageOfFort) + // @@protoc_insertion_point(copy_constructor:protobuf.MessageOfSignalTower) } - inline void MessageOfFort::SharedCtor( + inline void MessageOfSignalTower::SharedCtor( ::_pb::Arena* arena, bool is_message_owned ) { @@ -3010,9 +3012,9 @@ namespace protobuf decltype(_impl_.x_){0}, decltype(_impl_.y_){0}, decltype(_impl_.team_id_){int64_t{0}}, decltype(_impl_.hp_){0}, /*decltype(_impl_._cached_size_)*/ {}}; } - MessageOfFort::~MessageOfFort() + MessageOfSignalTower::~MessageOfSignalTower() { - // @@protoc_insertion_point(destructor:protobuf.MessageOfFort) + // @@protoc_insertion_point(destructor:protobuf.MessageOfSignalTower) if (auto* arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { (void)arena; @@ -3021,19 +3023,19 @@ namespace protobuf SharedDtor(); } - inline void MessageOfFort::SharedDtor() + inline void MessageOfSignalTower::SharedDtor() { GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); } - void MessageOfFort::SetCachedSize(int size) const + void MessageOfSignalTower::SetCachedSize(int size) const { _impl_._cached_size_.Set(size); } - void MessageOfFort::Clear() + void MessageOfSignalTower::Clear() { - // @@protoc_insertion_point(message_clear_start:protobuf.MessageOfFort) + // @@protoc_insertion_point(message_clear_start:protobuf.MessageOfSignalTower) uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void)cached_has_bits; @@ -3042,7 +3044,7 @@ namespace protobuf _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } - const char* MessageOfFort::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) + const char* MessageOfSignalTower::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { #define CHK_(x) \ if (PROTOBUF_PREDICT_FALSE(!(x))) \ @@ -3119,11 +3121,11 @@ namespace protobuf #undef CHK_ } - uint8_t* MessageOfFort::_InternalSerialize( + uint8_t* MessageOfSignalTower::_InternalSerialize( uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream ) const { - // @@protoc_insertion_point(serialize_to_array_start:protobuf.MessageOfFort) + // @@protoc_insertion_point(serialize_to_array_start:protobuf.MessageOfSignalTower) uint32_t cached_has_bits = 0; (void)cached_has_bits; @@ -3161,13 +3163,13 @@ namespace protobuf _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream ); } - // @@protoc_insertion_point(serialize_to_array_end:protobuf.MessageOfFort) + // @@protoc_insertion_point(serialize_to_array_end:protobuf.MessageOfSignalTower) return target; } - size_t MessageOfFort::ByteSizeLong() const + size_t MessageOfSignalTower::ByteSizeLong() const { - // @@protoc_insertion_point(message_byte_size_start:protobuf.MessageOfFort) + // @@protoc_insertion_point(message_byte_size_start:protobuf.MessageOfSignalTower) size_t total_size = 0; uint32_t cached_has_bits = 0; @@ -3201,19 +3203,19 @@ namespace protobuf return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); } - const ::PROTOBUF_NAMESPACE_ID::Message::ClassData MessageOfFort::_class_data_ = { + const ::PROTOBUF_NAMESPACE_ID::Message::ClassData MessageOfSignalTower::_class_data_ = { ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, - MessageOfFort::MergeImpl}; - const ::PROTOBUF_NAMESPACE_ID::Message::ClassData* MessageOfFort::GetClassData() const + MessageOfSignalTower::MergeImpl}; + const ::PROTOBUF_NAMESPACE_ID::Message::ClassData* MessageOfSignalTower::GetClassData() const { return &_class_data_; } - void MessageOfFort::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) + void MessageOfSignalTower::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { - auto* const _this = static_cast(&to_msg); - auto& from = static_cast(from_msg); - // @@protoc_insertion_point(class_specific_merge_from_start:protobuf.MessageOfFort) + auto* const _this = static_cast(&to_msg); + auto& from = static_cast(from_msg); + // @@protoc_insertion_point(class_specific_merge_from_start:protobuf.MessageOfSignalTower) GOOGLE_DCHECK_NE(&from, _this); uint32_t cached_has_bits = 0; (void)cached_has_bits; @@ -3237,32 +3239,32 @@ namespace protobuf _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); } - void MessageOfFort::CopyFrom(const MessageOfFort& from) + void MessageOfSignalTower::CopyFrom(const MessageOfSignalTower& from) { - // @@protoc_insertion_point(class_specific_copy_from_start:protobuf.MessageOfFort) + // @@protoc_insertion_point(class_specific_copy_from_start:protobuf.MessageOfSignalTower) if (&from == this) return; Clear(); MergeFrom(from); } - bool MessageOfFort::IsInitialized() const + bool MessageOfSignalTower::IsInitialized() const { return true; } - void MessageOfFort::InternalSwap(MessageOfFort* other) + void MessageOfSignalTower::InternalSwap(MessageOfSignalTower* other) { using std::swap; _internal_metadata_.InternalSwap(&other->_internal_metadata_); ::PROTOBUF_NAMESPACE_ID::internal::memswap< - PROTOBUF_FIELD_OFFSET(MessageOfFort, _impl_.hp_) + sizeof(MessageOfFort::_impl_.hp_) - PROTOBUF_FIELD_OFFSET(MessageOfFort, _impl_.x_)>( + PROTOBUF_FIELD_OFFSET(MessageOfSignalTower, _impl_.hp_) + sizeof(MessageOfSignalTower::_impl_.hp_) - PROTOBUF_FIELD_OFFSET(MessageOfSignalTower, _impl_.x_)>( reinterpret_cast(&_impl_.x_), reinterpret_cast(&other->_impl_.x_) ); } - ::PROTOBUF_NAMESPACE_ID::Metadata MessageOfFort::GetMetadata() const + ::PROTOBUF_NAMESPACE_ID::Metadata MessageOfSignalTower::GetMetadata() const { return ::_pbi::AssignDescriptors( &descriptor_table_Message2Clients_2eproto_getter, &descriptor_table_Message2Clients_2eproto_once, file_level_metadata_Message2Clients_2eproto[5] @@ -3271,31 +3273,31 @@ namespace protobuf // =================================================================== - class MessageOfWormhole::_Internal + class MessageOfBridge::_Internal { public: }; - MessageOfWormhole::MessageOfWormhole(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned) : + MessageOfBridge::MessageOfBridge(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned) : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { SharedCtor(arena, is_message_owned); - // @@protoc_insertion_point(arena_constructor:protobuf.MessageOfWormhole) + // @@protoc_insertion_point(arena_constructor:protobuf.MessageOfBridge) } - MessageOfWormhole::MessageOfWormhole(const MessageOfWormhole& from) : + MessageOfBridge::MessageOfBridge(const MessageOfBridge& from) : ::PROTOBUF_NAMESPACE_ID::Message() { - MessageOfWormhole* const _this = this; + MessageOfBridge* const _this = this; (void)_this; new (&_impl_) Impl_{ decltype(_impl_.x_){}, decltype(_impl_.y_){}, decltype(_impl_.hp_){}, /*decltype(_impl_._cached_size_)*/ {}}; _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); ::memcpy(&_impl_.x_, &from._impl_.x_, static_cast(reinterpret_cast(&_impl_.hp_) - reinterpret_cast(&_impl_.x_)) + sizeof(_impl_.hp_)); - // @@protoc_insertion_point(copy_constructor:protobuf.MessageOfWormhole) + // @@protoc_insertion_point(copy_constructor:protobuf.MessageOfBridge) } - inline void MessageOfWormhole::SharedCtor( + inline void MessageOfBridge::SharedCtor( ::_pb::Arena* arena, bool is_message_owned ) { @@ -3305,9 +3307,9 @@ namespace protobuf decltype(_impl_.x_){0}, decltype(_impl_.y_){0}, decltype(_impl_.hp_){0}, /*decltype(_impl_._cached_size_)*/ {}}; } - MessageOfWormhole::~MessageOfWormhole() + MessageOfBridge::~MessageOfBridge() { - // @@protoc_insertion_point(destructor:protobuf.MessageOfWormhole) + // @@protoc_insertion_point(destructor:protobuf.MessageOfBridge) if (auto* arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { (void)arena; @@ -3316,19 +3318,19 @@ namespace protobuf SharedDtor(); } - inline void MessageOfWormhole::SharedDtor() + inline void MessageOfBridge::SharedDtor() { GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); } - void MessageOfWormhole::SetCachedSize(int size) const + void MessageOfBridge::SetCachedSize(int size) const { _impl_._cached_size_.Set(size); } - void MessageOfWormhole::Clear() + void MessageOfBridge::Clear() { - // @@protoc_insertion_point(message_clear_start:protobuf.MessageOfWormhole) + // @@protoc_insertion_point(message_clear_start:protobuf.MessageOfBridge) uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void)cached_has_bits; @@ -3337,7 +3339,7 @@ namespace protobuf _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } - const char* MessageOfWormhole::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) + const char* MessageOfBridge::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { #define CHK_(x) \ if (PROTOBUF_PREDICT_FALSE(!(x))) \ @@ -3404,11 +3406,11 @@ namespace protobuf #undef CHK_ } - uint8_t* MessageOfWormhole::_InternalSerialize( + uint8_t* MessageOfBridge::_InternalSerialize( uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream ) const { - // @@protoc_insertion_point(serialize_to_array_start:protobuf.MessageOfWormhole) + // @@protoc_insertion_point(serialize_to_array_start:protobuf.MessageOfBridge) uint32_t cached_has_bits = 0; (void)cached_has_bits; @@ -3439,13 +3441,13 @@ namespace protobuf _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream ); } - // @@protoc_insertion_point(serialize_to_array_end:protobuf.MessageOfWormhole) + // @@protoc_insertion_point(serialize_to_array_end:protobuf.MessageOfBridge) return target; } - size_t MessageOfWormhole::ByteSizeLong() const + size_t MessageOfBridge::ByteSizeLong() const { - // @@protoc_insertion_point(message_byte_size_start:protobuf.MessageOfWormhole) + // @@protoc_insertion_point(message_byte_size_start:protobuf.MessageOfBridge) size_t total_size = 0; uint32_t cached_has_bits = 0; @@ -3473,19 +3475,19 @@ namespace protobuf return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); } - const ::PROTOBUF_NAMESPACE_ID::Message::ClassData MessageOfWormhole::_class_data_ = { + const ::PROTOBUF_NAMESPACE_ID::Message::ClassData MessageOfBridge::_class_data_ = { ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, - MessageOfWormhole::MergeImpl}; - const ::PROTOBUF_NAMESPACE_ID::Message::ClassData* MessageOfWormhole::GetClassData() const + MessageOfBridge::MergeImpl}; + const ::PROTOBUF_NAMESPACE_ID::Message::ClassData* MessageOfBridge::GetClassData() const { return &_class_data_; } - void MessageOfWormhole::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) + void MessageOfBridge::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { - auto* const _this = static_cast(&to_msg); - auto& from = static_cast(from_msg); - // @@protoc_insertion_point(class_specific_merge_from_start:protobuf.MessageOfWormhole) + auto* const _this = static_cast(&to_msg); + auto& from = static_cast(from_msg); + // @@protoc_insertion_point(class_specific_merge_from_start:protobuf.MessageOfBridge) GOOGLE_DCHECK_NE(&from, _this); uint32_t cached_has_bits = 0; (void)cached_has_bits; @@ -3505,32 +3507,32 @@ namespace protobuf _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); } - void MessageOfWormhole::CopyFrom(const MessageOfWormhole& from) + void MessageOfBridge::CopyFrom(const MessageOfBridge& from) { - // @@protoc_insertion_point(class_specific_copy_from_start:protobuf.MessageOfWormhole) + // @@protoc_insertion_point(class_specific_copy_from_start:protobuf.MessageOfBridge) if (&from == this) return; Clear(); MergeFrom(from); } - bool MessageOfWormhole::IsInitialized() const + bool MessageOfBridge::IsInitialized() const { return true; } - void MessageOfWormhole::InternalSwap(MessageOfWormhole* other) + void MessageOfBridge::InternalSwap(MessageOfBridge* other) { using std::swap; _internal_metadata_.InternalSwap(&other->_internal_metadata_); ::PROTOBUF_NAMESPACE_ID::internal::memswap< - PROTOBUF_FIELD_OFFSET(MessageOfWormhole, _impl_.hp_) + sizeof(MessageOfWormhole::_impl_.hp_) - PROTOBUF_FIELD_OFFSET(MessageOfWormhole, _impl_.x_)>( + PROTOBUF_FIELD_OFFSET(MessageOfBridge, _impl_.hp_) + sizeof(MessageOfBridge::_impl_.hp_) - PROTOBUF_FIELD_OFFSET(MessageOfBridge, _impl_.x_)>( reinterpret_cast(&_impl_.x_), reinterpret_cast(&other->_impl_.x_) ); } - ::PROTOBUF_NAMESPACE_ID::Metadata MessageOfWormhole::GetMetadata() const + ::PROTOBUF_NAMESPACE_ID::Metadata MessageOfBridge::GetMetadata() const { return ::_pbi::AssignDescriptors( &descriptor_table_Message2Clients_2eproto_getter, &descriptor_table_Message2Clients_2eproto_once, file_level_metadata_Message2Clients_2eproto[6] @@ -3539,31 +3541,31 @@ namespace protobuf // =================================================================== - class MessageOfResource::_Internal + class MessageOfGarbage::_Internal { public: }; - MessageOfResource::MessageOfResource(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned) : + MessageOfGarbage::MessageOfGarbage(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned) : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { SharedCtor(arena, is_message_owned); - // @@protoc_insertion_point(arena_constructor:protobuf.MessageOfResource) + // @@protoc_insertion_point(arena_constructor:protobuf.MessageOfGarbage) } - MessageOfResource::MessageOfResource(const MessageOfResource& from) : + MessageOfGarbage::MessageOfGarbage(const MessageOfGarbage& from) : ::PROTOBUF_NAMESPACE_ID::Message() { - MessageOfResource* const _this = this; + MessageOfGarbage* const _this = this; (void)_this; new (&_impl_) Impl_{ decltype(_impl_.x_){}, decltype(_impl_.y_){}, decltype(_impl_.progress_){}, /*decltype(_impl_._cached_size_)*/ {}}; _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); ::memcpy(&_impl_.x_, &from._impl_.x_, static_cast(reinterpret_cast(&_impl_.progress_) - reinterpret_cast(&_impl_.x_)) + sizeof(_impl_.progress_)); - // @@protoc_insertion_point(copy_constructor:protobuf.MessageOfResource) + // @@protoc_insertion_point(copy_constructor:protobuf.MessageOfGarbage) } - inline void MessageOfResource::SharedCtor( + inline void MessageOfGarbage::SharedCtor( ::_pb::Arena* arena, bool is_message_owned ) { @@ -3573,9 +3575,9 @@ namespace protobuf decltype(_impl_.x_){0}, decltype(_impl_.y_){0}, decltype(_impl_.progress_){0}, /*decltype(_impl_._cached_size_)*/ {}}; } - MessageOfResource::~MessageOfResource() + MessageOfGarbage::~MessageOfGarbage() { - // @@protoc_insertion_point(destructor:protobuf.MessageOfResource) + // @@protoc_insertion_point(destructor:protobuf.MessageOfGarbage) if (auto* arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { (void)arena; @@ -3584,19 +3586,19 @@ namespace protobuf SharedDtor(); } - inline void MessageOfResource::SharedDtor() + inline void MessageOfGarbage::SharedDtor() { GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); } - void MessageOfResource::SetCachedSize(int size) const + void MessageOfGarbage::SetCachedSize(int size) const { _impl_._cached_size_.Set(size); } - void MessageOfResource::Clear() + void MessageOfGarbage::Clear() { - // @@protoc_insertion_point(message_clear_start:protobuf.MessageOfResource) + // @@protoc_insertion_point(message_clear_start:protobuf.MessageOfGarbage) uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void)cached_has_bits; @@ -3605,7 +3607,7 @@ namespace protobuf _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } - const char* MessageOfResource::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) + const char* MessageOfGarbage::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { #define CHK_(x) \ if (PROTOBUF_PREDICT_FALSE(!(x))) \ @@ -3672,11 +3674,11 @@ namespace protobuf #undef CHK_ } - uint8_t* MessageOfResource::_InternalSerialize( + uint8_t* MessageOfGarbage::_InternalSerialize( uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream ) const { - // @@protoc_insertion_point(serialize_to_array_start:protobuf.MessageOfResource) + // @@protoc_insertion_point(serialize_to_array_start:protobuf.MessageOfGarbage) uint32_t cached_has_bits = 0; (void)cached_has_bits; @@ -3707,13 +3709,13 @@ namespace protobuf _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream ); } - // @@protoc_insertion_point(serialize_to_array_end:protobuf.MessageOfResource) + // @@protoc_insertion_point(serialize_to_array_end:protobuf.MessageOfGarbage) return target; } - size_t MessageOfResource::ByteSizeLong() const + size_t MessageOfGarbage::ByteSizeLong() const { - // @@protoc_insertion_point(message_byte_size_start:protobuf.MessageOfResource) + // @@protoc_insertion_point(message_byte_size_start:protobuf.MessageOfGarbage) size_t total_size = 0; uint32_t cached_has_bits = 0; @@ -3741,19 +3743,19 @@ namespace protobuf return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); } - const ::PROTOBUF_NAMESPACE_ID::Message::ClassData MessageOfResource::_class_data_ = { + const ::PROTOBUF_NAMESPACE_ID::Message::ClassData MessageOfGarbage::_class_data_ = { ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, - MessageOfResource::MergeImpl}; - const ::PROTOBUF_NAMESPACE_ID::Message::ClassData* MessageOfResource::GetClassData() const + MessageOfGarbage::MergeImpl}; + const ::PROTOBUF_NAMESPACE_ID::Message::ClassData* MessageOfGarbage::GetClassData() const { return &_class_data_; } - void MessageOfResource::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) + void MessageOfGarbage::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { - auto* const _this = static_cast(&to_msg); - auto& from = static_cast(from_msg); - // @@protoc_insertion_point(class_specific_merge_from_start:protobuf.MessageOfResource) + auto* const _this = static_cast(&to_msg); + auto& from = static_cast(from_msg); + // @@protoc_insertion_point(class_specific_merge_from_start:protobuf.MessageOfGarbage) GOOGLE_DCHECK_NE(&from, _this); uint32_t cached_has_bits = 0; (void)cached_has_bits; @@ -3773,32 +3775,32 @@ namespace protobuf _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); } - void MessageOfResource::CopyFrom(const MessageOfResource& from) + void MessageOfGarbage::CopyFrom(const MessageOfGarbage& from) { - // @@protoc_insertion_point(class_specific_copy_from_start:protobuf.MessageOfResource) + // @@protoc_insertion_point(class_specific_copy_from_start:protobuf.MessageOfGarbage) if (&from == this) return; Clear(); MergeFrom(from); } - bool MessageOfResource::IsInitialized() const + bool MessageOfGarbage::IsInitialized() const { return true; } - void MessageOfResource::InternalSwap(MessageOfResource* other) + void MessageOfGarbage::InternalSwap(MessageOfGarbage* other) { using std::swap; _internal_metadata_.InternalSwap(&other->_internal_metadata_); ::PROTOBUF_NAMESPACE_ID::internal::memswap< - PROTOBUF_FIELD_OFFSET(MessageOfResource, _impl_.progress_) + sizeof(MessageOfResource::_impl_.progress_) - PROTOBUF_FIELD_OFFSET(MessageOfResource, _impl_.x_)>( + PROTOBUF_FIELD_OFFSET(MessageOfGarbage, _impl_.progress_) + sizeof(MessageOfGarbage::_impl_.progress_) - PROTOBUF_FIELD_OFFSET(MessageOfGarbage, _impl_.x_)>( reinterpret_cast(&_impl_.x_), reinterpret_cast(&other->_impl_.x_) ); } - ::PROTOBUF_NAMESPACE_ID::Metadata MessageOfResource::GetMetadata() const + ::PROTOBUF_NAMESPACE_ID::Metadata MessageOfGarbage::GetMetadata() const { return ::_pbi::AssignDescriptors( &descriptor_table_Message2Clients_2eproto_getter, &descriptor_table_Message2Clients_2eproto_once, file_level_metadata_Message2Clients_2eproto[7] @@ -4939,59 +4941,59 @@ namespace protobuf class MessageOfObj::_Internal { public: - static const ::protobuf::MessageOfShip& ship_message(const MessageOfObj* msg); + static const ::protobuf::MessageOfSweeper& sweeper_message(const MessageOfObj* msg); static const ::protobuf::MessageOfBullet& bullet_message(const MessageOfObj* msg); - static const ::protobuf::MessageOfFactory& factory_message(const MessageOfObj* msg); - static const ::protobuf::MessageOfCommunity& community_message(const MessageOfObj* msg); - static const ::protobuf::MessageOfFort& fort_message(const MessageOfObj* msg); - static const ::protobuf::MessageOfWormhole& wormhole_message(const MessageOfObj* msg); + static const ::protobuf::MessageOfRecycleBank& recyclebank_message(const MessageOfObj* msg); + static const ::protobuf::MessageOfChargeStation& chargestation_message(const MessageOfObj* msg); + static const ::protobuf::MessageOfSignalTower& signaltower_message(const MessageOfObj* msg); + static const ::protobuf::MessageOfBridge& bridge_message(const MessageOfObj* msg); static const ::protobuf::MessageOfHome& home_message(const MessageOfObj* msg); - static const ::protobuf::MessageOfResource& resource_message(const MessageOfObj* msg); + static const ::protobuf::MessageOfGarbage& garbage_message(const MessageOfObj* msg); static const ::protobuf::MessageOfMap& map_message(const MessageOfObj* msg); static const ::protobuf::MessageOfNews& news_message(const MessageOfObj* msg); static const ::protobuf::MessageOfBombedBullet& bombed_bullet_message(const MessageOfObj* msg); static const ::protobuf::MessageOfTeam& team_message(const MessageOfObj* msg); }; - const ::protobuf::MessageOfShip& - MessageOfObj::_Internal::ship_message(const MessageOfObj* msg) + const ::protobuf::MessageOfSweeper& + MessageOfObj::_Internal::sweeper_message(const MessageOfObj* msg) { - return *msg->_impl_.message_of_obj_.ship_message_; + return *msg->_impl_.message_of_obj_.sweeper_message_; } const ::protobuf::MessageOfBullet& MessageOfObj::_Internal::bullet_message(const MessageOfObj* msg) { return *msg->_impl_.message_of_obj_.bullet_message_; } - const ::protobuf::MessageOfFactory& - MessageOfObj::_Internal::factory_message(const MessageOfObj* msg) + const ::protobuf::MessageOfRecycleBank& + MessageOfObj::_Internal::recyclebank_message(const MessageOfObj* msg) { - return *msg->_impl_.message_of_obj_.factory_message_; + return *msg->_impl_.message_of_obj_.recyclebank_message_; } - const ::protobuf::MessageOfCommunity& - MessageOfObj::_Internal::community_message(const MessageOfObj* msg) + const ::protobuf::MessageOfChargeStation& + MessageOfObj::_Internal::chargestation_message(const MessageOfObj* msg) { - return *msg->_impl_.message_of_obj_.community_message_; + return *msg->_impl_.message_of_obj_.chargestation_message_; } - const ::protobuf::MessageOfFort& - MessageOfObj::_Internal::fort_message(const MessageOfObj* msg) + const ::protobuf::MessageOfSignalTower& + MessageOfObj::_Internal::signaltower_message(const MessageOfObj* msg) { - return *msg->_impl_.message_of_obj_.fort_message_; + return *msg->_impl_.message_of_obj_.signaltower_message_; } - const ::protobuf::MessageOfWormhole& - MessageOfObj::_Internal::wormhole_message(const MessageOfObj* msg) + const ::protobuf::MessageOfBridge& + MessageOfObj::_Internal::bridge_message(const MessageOfObj* msg) { - return *msg->_impl_.message_of_obj_.wormhole_message_; + return *msg->_impl_.message_of_obj_.bridge_message_; } const ::protobuf::MessageOfHome& MessageOfObj::_Internal::home_message(const MessageOfObj* msg) { return *msg->_impl_.message_of_obj_.home_message_; } - const ::protobuf::MessageOfResource& - MessageOfObj::_Internal::resource_message(const MessageOfObj* msg) + const ::protobuf::MessageOfGarbage& + MessageOfObj::_Internal::garbage_message(const MessageOfObj* msg) { - return *msg->_impl_.message_of_obj_.resource_message_; + return *msg->_impl_.message_of_obj_.garbage_message_; } const ::protobuf::MessageOfMap& MessageOfObj::_Internal::map_message(const MessageOfObj* msg) @@ -5013,24 +5015,24 @@ namespace protobuf { return *msg->_impl_.message_of_obj_.team_message_; } - void MessageOfObj::set_allocated_ship_message(::protobuf::MessageOfShip* ship_message) + void MessageOfObj::set_allocated_sweeper_message(::protobuf::MessageOfSweeper* sweeper_message) { ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation(); clear_message_of_obj(); - if (ship_message) + if (sweeper_message) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(ship_message); + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(sweeper_message); if (message_arena != submessage_arena) { - ship_message = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( - message_arena, ship_message, submessage_arena + sweeper_message = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( + message_arena, sweeper_message, submessage_arena ); } - set_has_ship_message(); - _impl_.message_of_obj_.ship_message_ = ship_message; + set_has_sweeper_message(); + _impl_.message_of_obj_.sweeper_message_ = sweeper_message; } - // @@protoc_insertion_point(field_set_allocated:protobuf.MessageOfObj.ship_message) + // @@protoc_insertion_point(field_set_allocated:protobuf.MessageOfObj.sweeper_message) } void MessageOfObj::set_allocated_bullet_message(::protobuf::MessageOfBullet* bullet_message) { @@ -5051,81 +5053,81 @@ namespace protobuf } // @@protoc_insertion_point(field_set_allocated:protobuf.MessageOfObj.bullet_message) } - void MessageOfObj::set_allocated_factory_message(::protobuf::MessageOfFactory* factory_message) + void MessageOfObj::set_allocated_recyclebank_message(::protobuf::MessageOfRecycleBank* recyclebank_message) { ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation(); clear_message_of_obj(); - if (factory_message) + if (recyclebank_message) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(factory_message); + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(recyclebank_message); if (message_arena != submessage_arena) { - factory_message = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( - message_arena, factory_message, submessage_arena + recyclebank_message = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( + message_arena, recyclebank_message, submessage_arena ); } - set_has_factory_message(); - _impl_.message_of_obj_.factory_message_ = factory_message; + set_has_recyclebank_message(); + _impl_.message_of_obj_.recyclebank_message_ = recyclebank_message; } - // @@protoc_insertion_point(field_set_allocated:protobuf.MessageOfObj.factory_message) + // @@protoc_insertion_point(field_set_allocated:protobuf.MessageOfObj.recyclebank_message) } - void MessageOfObj::set_allocated_community_message(::protobuf::MessageOfCommunity* community_message) + void MessageOfObj::set_allocated_chargestation_message(::protobuf::MessageOfChargeStation* chargestation_message) { ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation(); clear_message_of_obj(); - if (community_message) + if (chargestation_message) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(community_message); + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(chargestation_message); if (message_arena != submessage_arena) { - community_message = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( - message_arena, community_message, submessage_arena + chargestation_message = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( + message_arena, chargestation_message, submessage_arena ); } - set_has_community_message(); - _impl_.message_of_obj_.community_message_ = community_message; + set_has_chargestation_message(); + _impl_.message_of_obj_.chargestation_message_ = chargestation_message; } - // @@protoc_insertion_point(field_set_allocated:protobuf.MessageOfObj.community_message) + // @@protoc_insertion_point(field_set_allocated:protobuf.MessageOfObj.chargestation_message) } - void MessageOfObj::set_allocated_fort_message(::protobuf::MessageOfFort* fort_message) + void MessageOfObj::set_allocated_signaltower_message(::protobuf::MessageOfSignalTower* signaltower_message) { ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation(); clear_message_of_obj(); - if (fort_message) + if (signaltower_message) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(fort_message); + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(signaltower_message); if (message_arena != submessage_arena) { - fort_message = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( - message_arena, fort_message, submessage_arena + signaltower_message = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( + message_arena, signaltower_message, submessage_arena ); } - set_has_fort_message(); - _impl_.message_of_obj_.fort_message_ = fort_message; + set_has_signaltower_message(); + _impl_.message_of_obj_.signaltower_message_ = signaltower_message; } - // @@protoc_insertion_point(field_set_allocated:protobuf.MessageOfObj.fort_message) + // @@protoc_insertion_point(field_set_allocated:protobuf.MessageOfObj.signaltower_message) } - void MessageOfObj::set_allocated_wormhole_message(::protobuf::MessageOfWormhole* wormhole_message) + void MessageOfObj::set_allocated_bridge_message(::protobuf::MessageOfBridge* bridge_message) { ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation(); clear_message_of_obj(); - if (wormhole_message) + if (bridge_message) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(wormhole_message); + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(bridge_message); if (message_arena != submessage_arena) { - wormhole_message = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( - message_arena, wormhole_message, submessage_arena + bridge_message = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( + message_arena, bridge_message, submessage_arena ); } - set_has_wormhole_message(); - _impl_.message_of_obj_.wormhole_message_ = wormhole_message; + set_has_bridge_message(); + _impl_.message_of_obj_.bridge_message_ = bridge_message; } - // @@protoc_insertion_point(field_set_allocated:protobuf.MessageOfObj.wormhole_message) + // @@protoc_insertion_point(field_set_allocated:protobuf.MessageOfObj.bridge_message) } void MessageOfObj::set_allocated_home_message(::protobuf::MessageOfHome* home_message) { @@ -5146,24 +5148,24 @@ namespace protobuf } // @@protoc_insertion_point(field_set_allocated:protobuf.MessageOfObj.home_message) } - void MessageOfObj::set_allocated_resource_message(::protobuf::MessageOfResource* resource_message) + void MessageOfObj::set_allocated_garbage_message(::protobuf::MessageOfGarbage* garbage_message) { ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation(); clear_message_of_obj(); - if (resource_message) + if (garbage_message) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(resource_message); + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(garbage_message); if (message_arena != submessage_arena) { - resource_message = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( - message_arena, resource_message, submessage_arena + garbage_message = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( + message_arena, garbage_message, submessage_arena ); } - set_has_resource_message(); - _impl_.message_of_obj_.resource_message_ = resource_message; + set_has_garbage_message(); + _impl_.message_of_obj_.garbage_message_ = garbage_message; } - // @@protoc_insertion_point(field_set_allocated:protobuf.MessageOfObj.resource_message) + // @@protoc_insertion_point(field_set_allocated:protobuf.MessageOfObj.garbage_message) } void MessageOfObj::set_allocated_map_message(::protobuf::MessageOfMap* map_message) { @@ -5259,10 +5261,10 @@ namespace protobuf clear_has_message_of_obj(); switch (from.message_of_obj_case()) { - case kShipMessage: + case kSweeperMessage: { - _this->_internal_mutable_ship_message()->::protobuf::MessageOfShip::MergeFrom( - from._internal_ship_message() + _this->_internal_mutable_sweeper_message()->::protobuf::MessageOfSweeper::MergeFrom( + from._internal_sweeper_message() ); break; } @@ -5273,31 +5275,31 @@ namespace protobuf ); break; } - case kFactoryMessage: + case kRecyclebankMessage: { - _this->_internal_mutable_factory_message()->::protobuf::MessageOfFactory::MergeFrom( - from._internal_factory_message() + _this->_internal_mutable_recyclebank_message()->::protobuf::MessageOfRecycleBank::MergeFrom( + from._internal_recyclebank_message() ); break; } - case kCommunityMessage: + case kChargestationMessage: { - _this->_internal_mutable_community_message()->::protobuf::MessageOfCommunity::MergeFrom( - from._internal_community_message() + _this->_internal_mutable_chargestation_message()->::protobuf::MessageOfChargeStation::MergeFrom( + from._internal_chargestation_message() ); break; } - case kFortMessage: + case kSignaltowerMessage: { - _this->_internal_mutable_fort_message()->::protobuf::MessageOfFort::MergeFrom( - from._internal_fort_message() + _this->_internal_mutable_signaltower_message()->::protobuf::MessageOfSignalTower::MergeFrom( + from._internal_signaltower_message() ); break; } - case kWormholeMessage: + case kBridgeMessage: { - _this->_internal_mutable_wormhole_message()->::protobuf::MessageOfWormhole::MergeFrom( - from._internal_wormhole_message() + _this->_internal_mutable_bridge_message()->::protobuf::MessageOfBridge::MergeFrom( + from._internal_bridge_message() ); break; } @@ -5308,10 +5310,10 @@ namespace protobuf ); break; } - case kResourceMessage: + case kGarbageMessage: { - _this->_internal_mutable_resource_message()->::protobuf::MessageOfResource::MergeFrom( - from._internal_resource_message() + _this->_internal_mutable_garbage_message()->::protobuf::MessageOfGarbage::MergeFrom( + from._internal_garbage_message() ); break; } @@ -5392,11 +5394,11 @@ namespace protobuf // @@protoc_insertion_point(one_of_clear_start:protobuf.MessageOfObj) switch (message_of_obj_case()) { - case kShipMessage: + case kSweeperMessage: { if (GetArenaForAllocation() == nullptr) { - delete _impl_.message_of_obj_.ship_message_; + delete _impl_.message_of_obj_.sweeper_message_; } break; } @@ -5408,35 +5410,35 @@ namespace protobuf } break; } - case kFactoryMessage: + case kRecyclebankMessage: { if (GetArenaForAllocation() == nullptr) { - delete _impl_.message_of_obj_.factory_message_; + delete _impl_.message_of_obj_.recyclebank_message_; } break; } - case kCommunityMessage: + case kChargestationMessage: { if (GetArenaForAllocation() == nullptr) { - delete _impl_.message_of_obj_.community_message_; + delete _impl_.message_of_obj_.chargestation_message_; } break; } - case kFortMessage: + case kSignaltowerMessage: { if (GetArenaForAllocation() == nullptr) { - delete _impl_.message_of_obj_.fort_message_; + delete _impl_.message_of_obj_.signaltower_message_; } break; } - case kWormholeMessage: + case kBridgeMessage: { if (GetArenaForAllocation() == nullptr) { - delete _impl_.message_of_obj_.wormhole_message_; + delete _impl_.message_of_obj_.bridge_message_; } break; } @@ -5448,11 +5450,11 @@ namespace protobuf } break; } - case kResourceMessage: + case kGarbageMessage: { if (GetArenaForAllocation() == nullptr) { - delete _impl_.message_of_obj_.resource_message_; + delete _impl_.message_of_obj_.garbage_message_; } break; } @@ -5518,11 +5520,11 @@ namespace protobuf ptr = ::_pbi::ReadTag(ptr, &tag); switch (tag >> 3) { - // .protobuf.MessageOfShip ship_message = 1; + // .protobuf.MessageOfSweeper sweeper_message = 1; case 1: if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { - ptr = ctx->ParseMessage(_internal_mutable_ship_message(), ptr); + ptr = ctx->ParseMessage(_internal_mutable_sweeper_message(), ptr); CHK_(ptr); } else @@ -5538,41 +5540,41 @@ namespace protobuf else goto handle_unusual; continue; - // .protobuf.MessageOfFactory factory_message = 3; + // .protobuf.MessageOfRecycleBank recyclebank_message = 3; case 3: if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 26)) { - ptr = ctx->ParseMessage(_internal_mutable_factory_message(), ptr); + ptr = ctx->ParseMessage(_internal_mutable_recyclebank_message(), ptr); CHK_(ptr); } else goto handle_unusual; continue; - // .protobuf.MessageOfCommunity community_message = 4; + // .protobuf.MessageOfChargeStation chargestation_message = 4; case 4: if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 34)) { - ptr = ctx->ParseMessage(_internal_mutable_community_message(), ptr); + ptr = ctx->ParseMessage(_internal_mutable_chargestation_message(), ptr); CHK_(ptr); } else goto handle_unusual; continue; - // .protobuf.MessageOfFort fort_message = 5; + // .protobuf.MessageOfSignalTower signaltower_message = 5; case 5: if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 42)) { - ptr = ctx->ParseMessage(_internal_mutable_fort_message(), ptr); + ptr = ctx->ParseMessage(_internal_mutable_signaltower_message(), ptr); CHK_(ptr); } else goto handle_unusual; continue; - // .protobuf.MessageOfWormhole wormhole_message = 6; + // .protobuf.MessageOfBridge bridge_message = 6; case 6: if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 50)) { - ptr = ctx->ParseMessage(_internal_mutable_wormhole_message(), ptr); + ptr = ctx->ParseMessage(_internal_mutable_bridge_message(), ptr); CHK_(ptr); } else @@ -5588,11 +5590,11 @@ namespace protobuf else goto handle_unusual; continue; - // .protobuf.MessageOfResource resource_message = 8; + // .protobuf.MessageOfGarbage garbage_message = 8; case 8: if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 66)) { - ptr = ctx->ParseMessage(_internal_mutable_resource_message(), ptr); + ptr = ctx->ParseMessage(_internal_mutable_garbage_message(), ptr); CHK_(ptr); } else @@ -5672,11 +5674,11 @@ namespace protobuf uint32_t cached_has_bits = 0; (void)cached_has_bits; - // .protobuf.MessageOfShip ship_message = 1; - if (_internal_has_ship_message()) + // .protobuf.MessageOfSweeper sweeper_message = 1; + if (_internal_has_sweeper_message()) { target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage(1, _Internal::ship_message(this), _Internal::ship_message(this).GetCachedSize(), target, stream); + InternalWriteMessage(1, _Internal::sweeper_message(this), _Internal::sweeper_message(this).GetCachedSize(), target, stream); } // .protobuf.MessageOfBullet bullet_message = 2; @@ -5686,32 +5688,32 @@ namespace protobuf InternalWriteMessage(2, _Internal::bullet_message(this), _Internal::bullet_message(this).GetCachedSize(), target, stream); } - // .protobuf.MessageOfFactory factory_message = 3; - if (_internal_has_factory_message()) + // .protobuf.MessageOfRecycleBank recyclebank_message = 3; + if (_internal_has_recyclebank_message()) { target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage(3, _Internal::factory_message(this), _Internal::factory_message(this).GetCachedSize(), target, stream); + InternalWriteMessage(3, _Internal::recyclebank_message(this), _Internal::recyclebank_message(this).GetCachedSize(), target, stream); } - // .protobuf.MessageOfCommunity community_message = 4; - if (_internal_has_community_message()) + // .protobuf.MessageOfChargeStation chargestation_message = 4; + if (_internal_has_chargestation_message()) { target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage(4, _Internal::community_message(this), _Internal::community_message(this).GetCachedSize(), target, stream); + InternalWriteMessage(4, _Internal::chargestation_message(this), _Internal::chargestation_message(this).GetCachedSize(), target, stream); } - // .protobuf.MessageOfFort fort_message = 5; - if (_internal_has_fort_message()) + // .protobuf.MessageOfSignalTower signaltower_message = 5; + if (_internal_has_signaltower_message()) { target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage(5, _Internal::fort_message(this), _Internal::fort_message(this).GetCachedSize(), target, stream); + InternalWriteMessage(5, _Internal::signaltower_message(this), _Internal::signaltower_message(this).GetCachedSize(), target, stream); } - // .protobuf.MessageOfWormhole wormhole_message = 6; - if (_internal_has_wormhole_message()) + // .protobuf.MessageOfBridge bridge_message = 6; + if (_internal_has_bridge_message()) { target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage(6, _Internal::wormhole_message(this), _Internal::wormhole_message(this).GetCachedSize(), target, stream); + InternalWriteMessage(6, _Internal::bridge_message(this), _Internal::bridge_message(this).GetCachedSize(), target, stream); } // .protobuf.MessageOfHome home_message = 7; @@ -5721,11 +5723,11 @@ namespace protobuf InternalWriteMessage(7, _Internal::home_message(this), _Internal::home_message(this).GetCachedSize(), target, stream); } - // .protobuf.MessageOfResource resource_message = 8; - if (_internal_has_resource_message()) + // .protobuf.MessageOfGarbage garbage_message = 8; + if (_internal_has_garbage_message()) { target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage(8, _Internal::resource_message(this), _Internal::resource_message(this).GetCachedSize(), target, stream); + InternalWriteMessage(8, _Internal::garbage_message(this), _Internal::garbage_message(this).GetCachedSize(), target, stream); } // .protobuf.MessageOfMap map_message = 9; @@ -5777,12 +5779,12 @@ namespace protobuf switch (message_of_obj_case()) { - // .protobuf.MessageOfShip ship_message = 1; - case kShipMessage: + // .protobuf.MessageOfSweeper sweeper_message = 1; + case kSweeperMessage: { total_size += 1 + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( - *_impl_.message_of_obj_.ship_message_ + *_impl_.message_of_obj_.sweeper_message_ ); break; } @@ -5795,39 +5797,39 @@ namespace protobuf ); break; } - // .protobuf.MessageOfFactory factory_message = 3; - case kFactoryMessage: + // .protobuf.MessageOfRecycleBank recyclebank_message = 3; + case kRecyclebankMessage: { total_size += 1 + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( - *_impl_.message_of_obj_.factory_message_ + *_impl_.message_of_obj_.recyclebank_message_ ); break; } - // .protobuf.MessageOfCommunity community_message = 4; - case kCommunityMessage: + // .protobuf.MessageOfChargeStation chargestation_message = 4; + case kChargestationMessage: { total_size += 1 + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( - *_impl_.message_of_obj_.community_message_ + *_impl_.message_of_obj_.chargestation_message_ ); break; } - // .protobuf.MessageOfFort fort_message = 5; - case kFortMessage: + // .protobuf.MessageOfSignalTower signaltower_message = 5; + case kSignaltowerMessage: { total_size += 1 + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( - *_impl_.message_of_obj_.fort_message_ + *_impl_.message_of_obj_.signaltower_message_ ); break; } - // .protobuf.MessageOfWormhole wormhole_message = 6; - case kWormholeMessage: + // .protobuf.MessageOfBridge bridge_message = 6; + case kBridgeMessage: { total_size += 1 + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( - *_impl_.message_of_obj_.wormhole_message_ + *_impl_.message_of_obj_.bridge_message_ ); break; } @@ -5840,12 +5842,12 @@ namespace protobuf ); break; } - // .protobuf.MessageOfResource resource_message = 8; - case kResourceMessage: + // .protobuf.MessageOfGarbage garbage_message = 8; + case kGarbageMessage: { total_size += 1 + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( - *_impl_.message_of_obj_.resource_message_ + *_impl_.message_of_obj_.garbage_message_ ); break; } @@ -5912,10 +5914,10 @@ namespace protobuf switch (from.message_of_obj_case()) { - case kShipMessage: + case kSweeperMessage: { - _this->_internal_mutable_ship_message()->::protobuf::MessageOfShip::MergeFrom( - from._internal_ship_message() + _this->_internal_mutable_sweeper_message()->::protobuf::MessageOfSweeper::MergeFrom( + from._internal_sweeper_message() ); break; } @@ -5926,31 +5928,31 @@ namespace protobuf ); break; } - case kFactoryMessage: + case kRecyclebankMessage: { - _this->_internal_mutable_factory_message()->::protobuf::MessageOfFactory::MergeFrom( - from._internal_factory_message() + _this->_internal_mutable_recyclebank_message()->::protobuf::MessageOfRecycleBank::MergeFrom( + from._internal_recyclebank_message() ); break; } - case kCommunityMessage: + case kChargestationMessage: { - _this->_internal_mutable_community_message()->::protobuf::MessageOfCommunity::MergeFrom( - from._internal_community_message() + _this->_internal_mutable_chargestation_message()->::protobuf::MessageOfChargeStation::MergeFrom( + from._internal_chargestation_message() ); break; } - case kFortMessage: + case kSignaltowerMessage: { - _this->_internal_mutable_fort_message()->::protobuf::MessageOfFort::MergeFrom( - from._internal_fort_message() + _this->_internal_mutable_signaltower_message()->::protobuf::MessageOfSignalTower::MergeFrom( + from._internal_signaltower_message() ); break; } - case kWormholeMessage: + case kBridgeMessage: { - _this->_internal_mutable_wormhole_message()->::protobuf::MessageOfWormhole::MergeFrom( - from._internal_wormhole_message() + _this->_internal_mutable_bridge_message()->::protobuf::MessageOfBridge::MergeFrom( + from._internal_bridge_message() ); break; } @@ -5961,10 +5963,10 @@ namespace protobuf ); break; } - case kResourceMessage: + case kGarbageMessage: { - _this->_internal_mutable_resource_message()->::protobuf::MessageOfResource::MergeFrom( - from._internal_resource_message() + _this->_internal_mutable_garbage_message()->::protobuf::MessageOfGarbage::MergeFrom( + from._internal_garbage_message() ); break; } @@ -7208,42 +7210,42 @@ namespace protobuf // =================================================================== - class ShipInfoRes::_Internal + class SweeperInfoRes::_Internal { public: }; - ShipInfoRes::ShipInfoRes(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned) : + SweeperInfoRes::SweeperInfoRes(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned) : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { SharedCtor(arena, is_message_owned); - // @@protoc_insertion_point(arena_constructor:protobuf.ShipInfoRes) + // @@protoc_insertion_point(arena_constructor:protobuf.SweeperInfoRes) } - ShipInfoRes::ShipInfoRes(const ShipInfoRes& from) : + SweeperInfoRes::SweeperInfoRes(const SweeperInfoRes& from) : ::PROTOBUF_NAMESPACE_ID::Message() { - ShipInfoRes* const _this = this; + SweeperInfoRes* const _this = this; (void)_this; new (&_impl_) Impl_{ - decltype(_impl_.ship_info_){from._impl_.ship_info_}, /*decltype(_impl_._cached_size_)*/ {}}; + decltype(_impl_.sweeper_info_){from._impl_.sweeper_info_}, /*decltype(_impl_._cached_size_)*/ {}}; _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); - // @@protoc_insertion_point(copy_constructor:protobuf.ShipInfoRes) + // @@protoc_insertion_point(copy_constructor:protobuf.SweeperInfoRes) } - inline void ShipInfoRes::SharedCtor( + inline void SweeperInfoRes::SharedCtor( ::_pb::Arena* arena, bool is_message_owned ) { (void)arena; (void)is_message_owned; new (&_impl_) Impl_{ - decltype(_impl_.ship_info_){arena}, /*decltype(_impl_._cached_size_)*/ {}}; + decltype(_impl_.sweeper_info_){arena}, /*decltype(_impl_._cached_size_)*/ {}}; } - ShipInfoRes::~ShipInfoRes() + SweeperInfoRes::~SweeperInfoRes() { - // @@protoc_insertion_point(destructor:protobuf.ShipInfoRes) + // @@protoc_insertion_point(destructor:protobuf.SweeperInfoRes) if (auto* arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { (void)arena; @@ -7252,29 +7254,29 @@ namespace protobuf SharedDtor(); } - inline void ShipInfoRes::SharedDtor() + inline void SweeperInfoRes::SharedDtor() { GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); - _impl_.ship_info_.~RepeatedPtrField(); + _impl_.sweeper_info_.~RepeatedPtrField(); } - void ShipInfoRes::SetCachedSize(int size) const + void SweeperInfoRes::SetCachedSize(int size) const { _impl_._cached_size_.Set(size); } - void ShipInfoRes::Clear() + void SweeperInfoRes::Clear() { - // @@protoc_insertion_point(message_clear_start:protobuf.ShipInfoRes) + // @@protoc_insertion_point(message_clear_start:protobuf.SweeperInfoRes) uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void)cached_has_bits; - _impl_.ship_info_.Clear(); + _impl_.sweeper_info_.Clear(); _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } - const char* ShipInfoRes::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) + const char* SweeperInfoRes::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { #define CHK_(x) \ if (PROTOBUF_PREDICT_FALSE(!(x))) \ @@ -7285,7 +7287,7 @@ namespace protobuf ptr = ::_pbi::ReadTag(ptr, &tag); switch (tag >> 3) { - // repeated .protobuf.MessageOfShip ship_info = 1; + // repeated .protobuf.MessageOfSweeper sweeper_info = 1; case 1: if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { @@ -7293,7 +7295,7 @@ namespace protobuf do { ptr += 1; - ptr = ctx->ParseMessage(_internal_add_ship_info(), ptr); + ptr = ctx->ParseMessage(_internal_add_sweeper_info(), ptr); CHK_(ptr); if (!ctx->DataAvailable(ptr)) break; @@ -7328,21 +7330,21 @@ namespace protobuf #undef CHK_ } - uint8_t* ShipInfoRes::_InternalSerialize( + uint8_t* SweeperInfoRes::_InternalSerialize( uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream ) const { - // @@protoc_insertion_point(serialize_to_array_start:protobuf.ShipInfoRes) + // @@protoc_insertion_point(serialize_to_array_start:protobuf.SweeperInfoRes) uint32_t cached_has_bits = 0; (void)cached_has_bits; - // repeated .protobuf.MessageOfShip ship_info = 1; + // repeated .protobuf.MessageOfSweeper sweeper_info = 1; for (unsigned i = 0, - n = static_cast(this->_internal_ship_info_size()); + n = static_cast(this->_internal_sweeper_info_size()); i < n; i++) { - const auto& repfield = this->_internal_ship_info(i); + const auto& repfield = this->_internal_sweeper_info(i); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: InternalWriteMessage(1, repfield, repfield.GetCachedSize(), target, stream); } @@ -7353,22 +7355,22 @@ namespace protobuf _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream ); } - // @@protoc_insertion_point(serialize_to_array_end:protobuf.ShipInfoRes) + // @@protoc_insertion_point(serialize_to_array_end:protobuf.SweeperInfoRes) return target; } - size_t ShipInfoRes::ByteSizeLong() const + size_t SweeperInfoRes::ByteSizeLong() const { - // @@protoc_insertion_point(message_byte_size_start:protobuf.ShipInfoRes) + // @@protoc_insertion_point(message_byte_size_start:protobuf.SweeperInfoRes) size_t total_size = 0; uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void)cached_has_bits; - // repeated .protobuf.MessageOfShip ship_info = 1; - total_size += 1UL * this->_internal_ship_info_size(); - for (const auto& msg : this->_impl_.ship_info_) + // repeated .protobuf.MessageOfSweeper sweeper_info = 1; + total_size += 1UL * this->_internal_sweeper_info_size(); + for (const auto& msg : this->_impl_.sweeper_info_) { total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg); @@ -7377,49 +7379,49 @@ namespace protobuf return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); } - const ::PROTOBUF_NAMESPACE_ID::Message::ClassData ShipInfoRes::_class_data_ = { + const ::PROTOBUF_NAMESPACE_ID::Message::ClassData SweeperInfoRes::_class_data_ = { ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, - ShipInfoRes::MergeImpl}; - const ::PROTOBUF_NAMESPACE_ID::Message::ClassData* ShipInfoRes::GetClassData() const + SweeperInfoRes::MergeImpl}; + const ::PROTOBUF_NAMESPACE_ID::Message::ClassData* SweeperInfoRes::GetClassData() const { return &_class_data_; } - void ShipInfoRes::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) + void SweeperInfoRes::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { - auto* const _this = static_cast(&to_msg); - auto& from = static_cast(from_msg); - // @@protoc_insertion_point(class_specific_merge_from_start:protobuf.ShipInfoRes) + auto* const _this = static_cast(&to_msg); + auto& from = static_cast(from_msg); + // @@protoc_insertion_point(class_specific_merge_from_start:protobuf.SweeperInfoRes) GOOGLE_DCHECK_NE(&from, _this); uint32_t cached_has_bits = 0; (void)cached_has_bits; - _this->_impl_.ship_info_.MergeFrom(from._impl_.ship_info_); + _this->_impl_.sweeper_info_.MergeFrom(from._impl_.sweeper_info_); _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); } - void ShipInfoRes::CopyFrom(const ShipInfoRes& from) + void SweeperInfoRes::CopyFrom(const SweeperInfoRes& from) { - // @@protoc_insertion_point(class_specific_copy_from_start:protobuf.ShipInfoRes) + // @@protoc_insertion_point(class_specific_copy_from_start:protobuf.SweeperInfoRes) if (&from == this) return; Clear(); MergeFrom(from); } - bool ShipInfoRes::IsInitialized() const + bool SweeperInfoRes::IsInitialized() const { return true; } - void ShipInfoRes::InternalSwap(ShipInfoRes* other) + void SweeperInfoRes::InternalSwap(SweeperInfoRes* other) { using std::swap; _internal_metadata_.InternalSwap(&other->_internal_metadata_); - _impl_.ship_info_.InternalSwap(&other->_impl_.ship_info_); + _impl_.sweeper_info_.InternalSwap(&other->_impl_.sweeper_info_); } - ::PROTOBUF_NAMESPACE_ID::Metadata ShipInfoRes::GetMetadata() const + ::PROTOBUF_NAMESPACE_ID::Metadata SweeperInfoRes::GetMetadata() const { return ::_pbi::AssignDescriptors( &descriptor_table_Message2Clients_2eproto_getter, &descriptor_table_Message2Clients_2eproto_once, file_level_metadata_Message2Clients_2eproto[17] @@ -8014,10 +8016,10 @@ namespace protobuf } // namespace protobuf PROTOBUF_NAMESPACE_OPEN template<> -PROTOBUF_NOINLINE ::protobuf::MessageOfShip* - Arena::CreateMaybeMessage<::protobuf::MessageOfShip>(Arena* arena) +PROTOBUF_NOINLINE ::protobuf::MessageOfSweeper* + Arena::CreateMaybeMessage<::protobuf::MessageOfSweeper>(Arena* arena) { - return Arena::CreateMessageInternal<::protobuf::MessageOfShip>(arena); + return Arena::CreateMessageInternal<::protobuf::MessageOfSweeper>(arena); } template<> PROTOBUF_NOINLINE ::protobuf::MessageOfBullet* @@ -8032,34 +8034,34 @@ PROTOBUF_NOINLINE ::protobuf::MessageOfBombedBullet* return Arena::CreateMessageInternal<::protobuf::MessageOfBombedBullet>(arena); } template<> -PROTOBUF_NOINLINE ::protobuf::MessageOfFactory* - Arena::CreateMaybeMessage<::protobuf::MessageOfFactory>(Arena* arena) +PROTOBUF_NOINLINE ::protobuf::MessageOfRecycleBank* + Arena::CreateMaybeMessage<::protobuf::MessageOfRecycleBank>(Arena* arena) { - return Arena::CreateMessageInternal<::protobuf::MessageOfFactory>(arena); + return Arena::CreateMessageInternal<::protobuf::MessageOfRecycleBank>(arena); } template<> -PROTOBUF_NOINLINE ::protobuf::MessageOfCommunity* - Arena::CreateMaybeMessage<::protobuf::MessageOfCommunity>(Arena* arena) +PROTOBUF_NOINLINE ::protobuf::MessageOfChargeStation* + Arena::CreateMaybeMessage<::protobuf::MessageOfChargeStation>(Arena* arena) { - return Arena::CreateMessageInternal<::protobuf::MessageOfCommunity>(arena); + return Arena::CreateMessageInternal<::protobuf::MessageOfChargeStation>(arena); } template<> -PROTOBUF_NOINLINE ::protobuf::MessageOfFort* - Arena::CreateMaybeMessage<::protobuf::MessageOfFort>(Arena* arena) +PROTOBUF_NOINLINE ::protobuf::MessageOfSignalTower* + Arena::CreateMaybeMessage<::protobuf::MessageOfSignalTower>(Arena* arena) { - return Arena::CreateMessageInternal<::protobuf::MessageOfFort>(arena); + return Arena::CreateMessageInternal<::protobuf::MessageOfSignalTower>(arena); } template<> -PROTOBUF_NOINLINE ::protobuf::MessageOfWormhole* - Arena::CreateMaybeMessage<::protobuf::MessageOfWormhole>(Arena* arena) +PROTOBUF_NOINLINE ::protobuf::MessageOfBridge* + Arena::CreateMaybeMessage<::protobuf::MessageOfBridge>(Arena* arena) { - return Arena::CreateMessageInternal<::protobuf::MessageOfWormhole>(arena); + return Arena::CreateMessageInternal<::protobuf::MessageOfBridge>(arena); } template<> -PROTOBUF_NOINLINE ::protobuf::MessageOfResource* - Arena::CreateMaybeMessage<::protobuf::MessageOfResource>(Arena* arena) +PROTOBUF_NOINLINE ::protobuf::MessageOfGarbage* + Arena::CreateMaybeMessage<::protobuf::MessageOfGarbage>(Arena* arena) { - return Arena::CreateMessageInternal<::protobuf::MessageOfResource>(arena); + return Arena::CreateMessageInternal<::protobuf::MessageOfGarbage>(arena); } template<> PROTOBUF_NOINLINE ::protobuf::MessageOfHome* @@ -8116,10 +8118,10 @@ PROTOBUF_NOINLINE ::protobuf::BoolRes* return Arena::CreateMessageInternal<::protobuf::BoolRes>(arena); } template<> -PROTOBUF_NOINLINE ::protobuf::ShipInfoRes* - Arena::CreateMaybeMessage<::protobuf::ShipInfoRes>(Arena* arena) +PROTOBUF_NOINLINE ::protobuf::SweeperInfoRes* + Arena::CreateMaybeMessage<::protobuf::SweeperInfoRes>(Arena* arena) { - return Arena::CreateMessageInternal<::protobuf::ShipInfoRes>(arena); + return Arena::CreateMessageInternal<::protobuf::SweeperInfoRes>(arena); } template<> PROTOBUF_NOINLINE ::protobuf::EcoRes* diff --git a/CAPI/cpp/proto/Message2Clients.pb.h b/CAPI/cpp/proto/Message2Clients.pb.h index e78f79b7..ed9b8d23 100644 --- a/CAPI/cpp/proto/Message2Clients.pb.h +++ b/CAPI/cpp/proto/Message2Clients.pb.h @@ -61,18 +61,18 @@ namespace protobuf class MessageOfBombedBullet; struct MessageOfBombedBulletDefaultTypeInternal; extern MessageOfBombedBulletDefaultTypeInternal _MessageOfBombedBullet_default_instance_; + class MessageOfBridge; + struct MessageOfBridgeDefaultTypeInternal; + extern MessageOfBridgeDefaultTypeInternal _MessageOfBridge_default_instance_; class MessageOfBullet; struct MessageOfBulletDefaultTypeInternal; extern MessageOfBulletDefaultTypeInternal _MessageOfBullet_default_instance_; - class MessageOfCommunity; - struct MessageOfCommunityDefaultTypeInternal; - extern MessageOfCommunityDefaultTypeInternal _MessageOfCommunity_default_instance_; - class MessageOfFactory; - struct MessageOfFactoryDefaultTypeInternal; - extern MessageOfFactoryDefaultTypeInternal _MessageOfFactory_default_instance_; - class MessageOfFort; - struct MessageOfFortDefaultTypeInternal; - extern MessageOfFortDefaultTypeInternal _MessageOfFort_default_instance_; + class MessageOfChargeStation; + struct MessageOfChargeStationDefaultTypeInternal; + extern MessageOfChargeStationDefaultTypeInternal _MessageOfChargeStation_default_instance_; + class MessageOfGarbage; + struct MessageOfGarbageDefaultTypeInternal; + extern MessageOfGarbageDefaultTypeInternal _MessageOfGarbage_default_instance_; class MessageOfHome; struct MessageOfHomeDefaultTypeInternal; extern MessageOfHomeDefaultTypeInternal _MessageOfHome_default_instance_; @@ -88,27 +88,27 @@ namespace protobuf class MessageOfObj; struct MessageOfObjDefaultTypeInternal; extern MessageOfObjDefaultTypeInternal _MessageOfObj_default_instance_; - class MessageOfResource; - struct MessageOfResourceDefaultTypeInternal; - extern MessageOfResourceDefaultTypeInternal _MessageOfResource_default_instance_; - class MessageOfShip; - struct MessageOfShipDefaultTypeInternal; - extern MessageOfShipDefaultTypeInternal _MessageOfShip_default_instance_; + class MessageOfRecycleBank; + struct MessageOfRecycleBankDefaultTypeInternal; + extern MessageOfRecycleBankDefaultTypeInternal _MessageOfRecycleBank_default_instance_; + class MessageOfSignalTower; + struct MessageOfSignalTowerDefaultTypeInternal; + extern MessageOfSignalTowerDefaultTypeInternal _MessageOfSignalTower_default_instance_; + class MessageOfSweeper; + struct MessageOfSweeperDefaultTypeInternal; + extern MessageOfSweeperDefaultTypeInternal _MessageOfSweeper_default_instance_; class MessageOfTeam; struct MessageOfTeamDefaultTypeInternal; extern MessageOfTeamDefaultTypeInternal _MessageOfTeam_default_instance_; - class MessageOfWormhole; - struct MessageOfWormholeDefaultTypeInternal; - extern MessageOfWormholeDefaultTypeInternal _MessageOfWormhole_default_instance_; class MessageToClient; struct MessageToClientDefaultTypeInternal; extern MessageToClientDefaultTypeInternal _MessageToClient_default_instance_; class MoveRes; struct MoveResDefaultTypeInternal; extern MoveResDefaultTypeInternal _MoveRes_default_instance_; - class ShipInfoRes; - struct ShipInfoResDefaultTypeInternal; - extern ShipInfoResDefaultTypeInternal _ShipInfoRes_default_instance_; + class SweeperInfoRes; + struct SweeperInfoResDefaultTypeInternal; + extern SweeperInfoResDefaultTypeInternal _SweeperInfoRes_default_instance_; } // namespace protobuf PROTOBUF_NAMESPACE_OPEN template<> @@ -120,13 +120,13 @@ ::protobuf::MessageOfAll* Arena::CreateMaybeMessage<::protobuf::MessageOfAll>(Ar template<> ::protobuf::MessageOfBombedBullet* Arena::CreateMaybeMessage<::protobuf::MessageOfBombedBullet>(Arena*); template<> -::protobuf::MessageOfBullet* Arena::CreateMaybeMessage<::protobuf::MessageOfBullet>(Arena*); +::protobuf::MessageOfBridge* Arena::CreateMaybeMessage<::protobuf::MessageOfBridge>(Arena*); template<> -::protobuf::MessageOfCommunity* Arena::CreateMaybeMessage<::protobuf::MessageOfCommunity>(Arena*); +::protobuf::MessageOfBullet* Arena::CreateMaybeMessage<::protobuf::MessageOfBullet>(Arena*); template<> -::protobuf::MessageOfFactory* Arena::CreateMaybeMessage<::protobuf::MessageOfFactory>(Arena*); +::protobuf::MessageOfChargeStation* Arena::CreateMaybeMessage<::protobuf::MessageOfChargeStation>(Arena*); template<> -::protobuf::MessageOfFort* Arena::CreateMaybeMessage<::protobuf::MessageOfFort>(Arena*); +::protobuf::MessageOfGarbage* Arena::CreateMaybeMessage<::protobuf::MessageOfGarbage>(Arena*); template<> ::protobuf::MessageOfHome* Arena::CreateMaybeMessage<::protobuf::MessageOfHome>(Arena*); template<> @@ -138,50 +138,50 @@ ::protobuf::MessageOfNews* Arena::CreateMaybeMessage<::protobuf::MessageOfNews>( template<> ::protobuf::MessageOfObj* Arena::CreateMaybeMessage<::protobuf::MessageOfObj>(Arena*); template<> -::protobuf::MessageOfResource* Arena::CreateMaybeMessage<::protobuf::MessageOfResource>(Arena*); +::protobuf::MessageOfRecycleBank* Arena::CreateMaybeMessage<::protobuf::MessageOfRecycleBank>(Arena*); template<> -::protobuf::MessageOfShip* Arena::CreateMaybeMessage<::protobuf::MessageOfShip>(Arena*); +::protobuf::MessageOfSignalTower* Arena::CreateMaybeMessage<::protobuf::MessageOfSignalTower>(Arena*); template<> -::protobuf::MessageOfTeam* Arena::CreateMaybeMessage<::protobuf::MessageOfTeam>(Arena*); +::protobuf::MessageOfSweeper* Arena::CreateMaybeMessage<::protobuf::MessageOfSweeper>(Arena*); template<> -::protobuf::MessageOfWormhole* Arena::CreateMaybeMessage<::protobuf::MessageOfWormhole>(Arena*); +::protobuf::MessageOfTeam* Arena::CreateMaybeMessage<::protobuf::MessageOfTeam>(Arena*); template<> ::protobuf::MessageToClient* Arena::CreateMaybeMessage<::protobuf::MessageToClient>(Arena*); template<> ::protobuf::MoveRes* Arena::CreateMaybeMessage<::protobuf::MoveRes>(Arena*); template<> -::protobuf::ShipInfoRes* Arena::CreateMaybeMessage<::protobuf::ShipInfoRes>(Arena*); +::protobuf::SweeperInfoRes* Arena::CreateMaybeMessage<::protobuf::SweeperInfoRes>(Arena*); PROTOBUF_NAMESPACE_CLOSE namespace protobuf { // =================================================================== - class MessageOfShip final : - public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:protobuf.MessageOfShip) */ + class MessageOfSweeper final : + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:protobuf.MessageOfSweeper) */ { public: - inline MessageOfShip() : - MessageOfShip(nullptr) + inline MessageOfSweeper() : + MessageOfSweeper(nullptr) { } - ~MessageOfShip() override; - explicit PROTOBUF_CONSTEXPR MessageOfShip(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + ~MessageOfSweeper() override; + explicit PROTOBUF_CONSTEXPR MessageOfSweeper(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); - MessageOfShip(const MessageOfShip& from); - MessageOfShip(MessageOfShip&& from) noexcept + MessageOfSweeper(const MessageOfSweeper& from); + MessageOfSweeper(MessageOfSweeper&& from) noexcept : - MessageOfShip() + MessageOfSweeper() { *this = ::std::move(from); } - inline MessageOfShip& operator=(const MessageOfShip& from) + inline MessageOfSweeper& operator=(const MessageOfSweeper& from) { CopyFrom(from); return *this; } - inline MessageOfShip& operator=(MessageOfShip&& from) noexcept + inline MessageOfSweeper& operator=(MessageOfSweeper&& from) noexcept { if (this == &from) return *this; @@ -212,24 +212,24 @@ namespace protobuf { return default_instance().GetMetadata().reflection; } - static const MessageOfShip& default_instance() + static const MessageOfSweeper& default_instance() { return *internal_default_instance(); } - static inline const MessageOfShip* internal_default_instance() + static inline const MessageOfSweeper* internal_default_instance() { - return reinterpret_cast( - &_MessageOfShip_default_instance_ + return reinterpret_cast( + &_MessageOfSweeper_default_instance_ ); } static constexpr int kIndexInFileMessages = 0; - friend void swap(MessageOfShip& a, MessageOfShip& b) + friend void swap(MessageOfSweeper& a, MessageOfSweeper& b) { a.Swap(&b); } - inline void Swap(MessageOfShip* other) + inline void Swap(MessageOfSweeper* other) { if (other == this) return; @@ -248,7 +248,7 @@ namespace protobuf ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); } } - void UnsafeArenaSwap(MessageOfShip* other) + void UnsafeArenaSwap(MessageOfSweeper* other) { if (other == this) return; @@ -258,16 +258,16 @@ namespace protobuf // implements Message ---------------------------------------------- - MessageOfShip* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final + MessageOfSweeper* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { - return CreateMaybeMessage(arena); + return CreateMaybeMessage(arena); } using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; - void CopyFrom(const MessageOfShip& from); + void CopyFrom(const MessageOfSweeper& from); using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; - void MergeFrom(const MessageOfShip& from) + void MergeFrom(const MessageOfSweeper& from) { - MessageOfShip::MergeImpl(*this, from); + MessageOfSweeper::MergeImpl(*this, from); } private: @@ -291,17 +291,17 @@ namespace protobuf void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); void SharedDtor(); void SetCachedSize(int size) const final; - void InternalSwap(MessageOfShip* other); + void InternalSwap(MessageOfSweeper* other); private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "protobuf.MessageOfShip"; + return "protobuf.MessageOfSweeper"; } protected: - explicit MessageOfShip(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); + explicit MessageOfSweeper(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); public: static const ClassData _class_data_; @@ -324,8 +324,8 @@ namespace protobuf kTeamIdFieldNumber = 7, kPlayerIdFieldNumber = 8, kGuidFieldNumber = 9, - kShipStateFieldNumber = 10, - kShipTypeFieldNumber = 11, + kSweeperStateFieldNumber = 10, + kSweeperTypeFieldNumber = 11, kViewRangeFieldNumber = 12, kProducerTypeFieldNumber = 13, kConstructorTypeFieldNumber = 14, @@ -424,24 +424,24 @@ namespace protobuf void _internal_set_guid(int64_t value); public: - // .protobuf.ShipState ship_state = 10; - void clear_ship_state(); - ::protobuf::ShipState ship_state() const; - void set_ship_state(::protobuf::ShipState value); + // .protobuf.SweeperState sweeper_state = 10; + void clear_sweeper_state(); + ::protobuf::SweeperState sweeper_state() const; + void set_sweeper_state(::protobuf::SweeperState value); private: - ::protobuf::ShipState _internal_ship_state() const; - void _internal_set_ship_state(::protobuf::ShipState value); + ::protobuf::SweeperState _internal_sweeper_state() const; + void _internal_set_sweeper_state(::protobuf::SweeperState value); public: - // .protobuf.ShipType ship_type = 11; - void clear_ship_type(); - ::protobuf::ShipType ship_type() const; - void set_ship_type(::protobuf::ShipType value); + // .protobuf.SweeperType sweeper_type = 11; + void clear_sweeper_type(); + ::protobuf::SweeperType sweeper_type() const; + void set_sweeper_type(::protobuf::SweeperType value); private: - ::protobuf::ShipType _internal_ship_type() const; - void _internal_set_ship_type(::protobuf::ShipType value); + ::protobuf::SweeperType _internal_sweeper_type() const; + void _internal_set_sweeper_type(::protobuf::SweeperType value); public: // int32 view_range = 12; @@ -514,7 +514,7 @@ namespace protobuf void _internal_set_facing_direction(double value); public: - // @@protoc_insertion_point(class_scope:protobuf.MessageOfShip) + // @@protoc_insertion_point(class_scope:protobuf.MessageOfSweeper) private: class _Internal; @@ -534,8 +534,8 @@ namespace protobuf int64_t team_id_; int64_t player_id_; int64_t guid_; - int ship_state_; - int ship_type_; + int sweeper_state_; + int sweeper_type_; int32_t view_range_; int producer_type_; int constructor_type_; @@ -1093,31 +1093,31 @@ namespace protobuf }; // ------------------------------------------------------------------- - class MessageOfFactory final : - public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:protobuf.MessageOfFactory) */ + class MessageOfRecycleBank final : + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:protobuf.MessageOfRecycleBank) */ { public: - inline MessageOfFactory() : - MessageOfFactory(nullptr) + inline MessageOfRecycleBank() : + MessageOfRecycleBank(nullptr) { } - ~MessageOfFactory() override; - explicit PROTOBUF_CONSTEXPR MessageOfFactory(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + ~MessageOfRecycleBank() override; + explicit PROTOBUF_CONSTEXPR MessageOfRecycleBank(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); - MessageOfFactory(const MessageOfFactory& from); - MessageOfFactory(MessageOfFactory&& from) noexcept + MessageOfRecycleBank(const MessageOfRecycleBank& from); + MessageOfRecycleBank(MessageOfRecycleBank&& from) noexcept : - MessageOfFactory() + MessageOfRecycleBank() { *this = ::std::move(from); } - inline MessageOfFactory& operator=(const MessageOfFactory& from) + inline MessageOfRecycleBank& operator=(const MessageOfRecycleBank& from) { CopyFrom(from); return *this; } - inline MessageOfFactory& operator=(MessageOfFactory&& from) noexcept + inline MessageOfRecycleBank& operator=(MessageOfRecycleBank&& from) noexcept { if (this == &from) return *this; @@ -1148,24 +1148,24 @@ namespace protobuf { return default_instance().GetMetadata().reflection; } - static const MessageOfFactory& default_instance() + static const MessageOfRecycleBank& default_instance() { return *internal_default_instance(); } - static inline const MessageOfFactory* internal_default_instance() + static inline const MessageOfRecycleBank* internal_default_instance() { - return reinterpret_cast( - &_MessageOfFactory_default_instance_ + return reinterpret_cast( + &_MessageOfRecycleBank_default_instance_ ); } static constexpr int kIndexInFileMessages = 3; - friend void swap(MessageOfFactory& a, MessageOfFactory& b) + friend void swap(MessageOfRecycleBank& a, MessageOfRecycleBank& b) { a.Swap(&b); } - inline void Swap(MessageOfFactory* other) + inline void Swap(MessageOfRecycleBank* other) { if (other == this) return; @@ -1184,7 +1184,7 @@ namespace protobuf ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); } } - void UnsafeArenaSwap(MessageOfFactory* other) + void UnsafeArenaSwap(MessageOfRecycleBank* other) { if (other == this) return; @@ -1194,16 +1194,16 @@ namespace protobuf // implements Message ---------------------------------------------- - MessageOfFactory* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final + MessageOfRecycleBank* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { - return CreateMaybeMessage(arena); + return CreateMaybeMessage(arena); } using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; - void CopyFrom(const MessageOfFactory& from); + void CopyFrom(const MessageOfRecycleBank& from); using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; - void MergeFrom(const MessageOfFactory& from) + void MergeFrom(const MessageOfRecycleBank& from) { - MessageOfFactory::MergeImpl(*this, from); + MessageOfRecycleBank::MergeImpl(*this, from); } private: @@ -1227,17 +1227,17 @@ namespace protobuf void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); void SharedDtor(); void SetCachedSize(int size) const final; - void InternalSwap(MessageOfFactory* other); + void InternalSwap(MessageOfRecycleBank* other); private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "protobuf.MessageOfFactory"; + return "protobuf.MessageOfRecycleBank"; } protected: - explicit MessageOfFactory(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); + explicit MessageOfRecycleBank(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); public: static const ClassData _class_data_; @@ -1296,7 +1296,7 @@ namespace protobuf void _internal_set_hp(int32_t value); public: - // @@protoc_insertion_point(class_scope:protobuf.MessageOfFactory) + // @@protoc_insertion_point(class_scope:protobuf.MessageOfRecycleBank) private: class _Internal; @@ -1321,31 +1321,31 @@ namespace protobuf }; // ------------------------------------------------------------------- - class MessageOfCommunity final : - public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:protobuf.MessageOfCommunity) */ + class MessageOfChargeStation final : + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:protobuf.MessageOfChargeStation) */ { public: - inline MessageOfCommunity() : - MessageOfCommunity(nullptr) + inline MessageOfChargeStation() : + MessageOfChargeStation(nullptr) { } - ~MessageOfCommunity() override; - explicit PROTOBUF_CONSTEXPR MessageOfCommunity(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + ~MessageOfChargeStation() override; + explicit PROTOBUF_CONSTEXPR MessageOfChargeStation(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); - MessageOfCommunity(const MessageOfCommunity& from); - MessageOfCommunity(MessageOfCommunity&& from) noexcept + MessageOfChargeStation(const MessageOfChargeStation& from); + MessageOfChargeStation(MessageOfChargeStation&& from) noexcept : - MessageOfCommunity() + MessageOfChargeStation() { *this = ::std::move(from); } - inline MessageOfCommunity& operator=(const MessageOfCommunity& from) + inline MessageOfChargeStation& operator=(const MessageOfChargeStation& from) { CopyFrom(from); return *this; } - inline MessageOfCommunity& operator=(MessageOfCommunity&& from) noexcept + inline MessageOfChargeStation& operator=(MessageOfChargeStation&& from) noexcept { if (this == &from) return *this; @@ -1376,24 +1376,24 @@ namespace protobuf { return default_instance().GetMetadata().reflection; } - static const MessageOfCommunity& default_instance() + static const MessageOfChargeStation& default_instance() { return *internal_default_instance(); } - static inline const MessageOfCommunity* internal_default_instance() + static inline const MessageOfChargeStation* internal_default_instance() { - return reinterpret_cast( - &_MessageOfCommunity_default_instance_ + return reinterpret_cast( + &_MessageOfChargeStation_default_instance_ ); } static constexpr int kIndexInFileMessages = 4; - friend void swap(MessageOfCommunity& a, MessageOfCommunity& b) + friend void swap(MessageOfChargeStation& a, MessageOfChargeStation& b) { a.Swap(&b); } - inline void Swap(MessageOfCommunity* other) + inline void Swap(MessageOfChargeStation* other) { if (other == this) return; @@ -1412,7 +1412,7 @@ namespace protobuf ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); } } - void UnsafeArenaSwap(MessageOfCommunity* other) + void UnsafeArenaSwap(MessageOfChargeStation* other) { if (other == this) return; @@ -1422,16 +1422,16 @@ namespace protobuf // implements Message ---------------------------------------------- - MessageOfCommunity* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final + MessageOfChargeStation* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { - return CreateMaybeMessage(arena); + return CreateMaybeMessage(arena); } using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; - void CopyFrom(const MessageOfCommunity& from); + void CopyFrom(const MessageOfChargeStation& from); using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; - void MergeFrom(const MessageOfCommunity& from) + void MergeFrom(const MessageOfChargeStation& from) { - MessageOfCommunity::MergeImpl(*this, from); + MessageOfChargeStation::MergeImpl(*this, from); } private: @@ -1455,17 +1455,17 @@ namespace protobuf void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); void SharedDtor(); void SetCachedSize(int size) const final; - void InternalSwap(MessageOfCommunity* other); + void InternalSwap(MessageOfChargeStation* other); private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "protobuf.MessageOfCommunity"; + return "protobuf.MessageOfChargeStation"; } protected: - explicit MessageOfCommunity(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); + explicit MessageOfChargeStation(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); public: static const ClassData _class_data_; @@ -1524,7 +1524,7 @@ namespace protobuf void _internal_set_hp(int32_t value); public: - // @@protoc_insertion_point(class_scope:protobuf.MessageOfCommunity) + // @@protoc_insertion_point(class_scope:protobuf.MessageOfChargeStation) private: class _Internal; @@ -1549,31 +1549,31 @@ namespace protobuf }; // ------------------------------------------------------------------- - class MessageOfFort final : - public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:protobuf.MessageOfFort) */ + class MessageOfSignalTower final : + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:protobuf.MessageOfSignalTower) */ { public: - inline MessageOfFort() : - MessageOfFort(nullptr) + inline MessageOfSignalTower() : + MessageOfSignalTower(nullptr) { } - ~MessageOfFort() override; - explicit PROTOBUF_CONSTEXPR MessageOfFort(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + ~MessageOfSignalTower() override; + explicit PROTOBUF_CONSTEXPR MessageOfSignalTower(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); - MessageOfFort(const MessageOfFort& from); - MessageOfFort(MessageOfFort&& from) noexcept + MessageOfSignalTower(const MessageOfSignalTower& from); + MessageOfSignalTower(MessageOfSignalTower&& from) noexcept : - MessageOfFort() + MessageOfSignalTower() { *this = ::std::move(from); } - inline MessageOfFort& operator=(const MessageOfFort& from) + inline MessageOfSignalTower& operator=(const MessageOfSignalTower& from) { CopyFrom(from); return *this; } - inline MessageOfFort& operator=(MessageOfFort&& from) noexcept + inline MessageOfSignalTower& operator=(MessageOfSignalTower&& from) noexcept { if (this == &from) return *this; @@ -1604,24 +1604,24 @@ namespace protobuf { return default_instance().GetMetadata().reflection; } - static const MessageOfFort& default_instance() + static const MessageOfSignalTower& default_instance() { return *internal_default_instance(); } - static inline const MessageOfFort* internal_default_instance() + static inline const MessageOfSignalTower* internal_default_instance() { - return reinterpret_cast( - &_MessageOfFort_default_instance_ + return reinterpret_cast( + &_MessageOfSignalTower_default_instance_ ); } static constexpr int kIndexInFileMessages = 5; - friend void swap(MessageOfFort& a, MessageOfFort& b) + friend void swap(MessageOfSignalTower& a, MessageOfSignalTower& b) { a.Swap(&b); } - inline void Swap(MessageOfFort* other) + inline void Swap(MessageOfSignalTower* other) { if (other == this) return; @@ -1640,7 +1640,7 @@ namespace protobuf ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); } } - void UnsafeArenaSwap(MessageOfFort* other) + void UnsafeArenaSwap(MessageOfSignalTower* other) { if (other == this) return; @@ -1650,16 +1650,16 @@ namespace protobuf // implements Message ---------------------------------------------- - MessageOfFort* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final + MessageOfSignalTower* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { - return CreateMaybeMessage(arena); + return CreateMaybeMessage(arena); } using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; - void CopyFrom(const MessageOfFort& from); + void CopyFrom(const MessageOfSignalTower& from); using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; - void MergeFrom(const MessageOfFort& from) + void MergeFrom(const MessageOfSignalTower& from) { - MessageOfFort::MergeImpl(*this, from); + MessageOfSignalTower::MergeImpl(*this, from); } private: @@ -1683,17 +1683,17 @@ namespace protobuf void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); void SharedDtor(); void SetCachedSize(int size) const final; - void InternalSwap(MessageOfFort* other); + void InternalSwap(MessageOfSignalTower* other); private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "protobuf.MessageOfFort"; + return "protobuf.MessageOfSignalTower"; } protected: - explicit MessageOfFort(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); + explicit MessageOfSignalTower(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); public: static const ClassData _class_data_; @@ -1752,7 +1752,7 @@ namespace protobuf void _internal_set_hp(int32_t value); public: - // @@protoc_insertion_point(class_scope:protobuf.MessageOfFort) + // @@protoc_insertion_point(class_scope:protobuf.MessageOfSignalTower) private: class _Internal; @@ -1777,31 +1777,31 @@ namespace protobuf }; // ------------------------------------------------------------------- - class MessageOfWormhole final : - public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:protobuf.MessageOfWormhole) */ + class MessageOfBridge final : + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:protobuf.MessageOfBridge) */ { public: - inline MessageOfWormhole() : - MessageOfWormhole(nullptr) + inline MessageOfBridge() : + MessageOfBridge(nullptr) { } - ~MessageOfWormhole() override; - explicit PROTOBUF_CONSTEXPR MessageOfWormhole(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + ~MessageOfBridge() override; + explicit PROTOBUF_CONSTEXPR MessageOfBridge(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); - MessageOfWormhole(const MessageOfWormhole& from); - MessageOfWormhole(MessageOfWormhole&& from) noexcept + MessageOfBridge(const MessageOfBridge& from); + MessageOfBridge(MessageOfBridge&& from) noexcept : - MessageOfWormhole() + MessageOfBridge() { *this = ::std::move(from); } - inline MessageOfWormhole& operator=(const MessageOfWormhole& from) + inline MessageOfBridge& operator=(const MessageOfBridge& from) { CopyFrom(from); return *this; } - inline MessageOfWormhole& operator=(MessageOfWormhole&& from) noexcept + inline MessageOfBridge& operator=(MessageOfBridge&& from) noexcept { if (this == &from) return *this; @@ -1832,24 +1832,24 @@ namespace protobuf { return default_instance().GetMetadata().reflection; } - static const MessageOfWormhole& default_instance() + static const MessageOfBridge& default_instance() { return *internal_default_instance(); } - static inline const MessageOfWormhole* internal_default_instance() + static inline const MessageOfBridge* internal_default_instance() { - return reinterpret_cast( - &_MessageOfWormhole_default_instance_ + return reinterpret_cast( + &_MessageOfBridge_default_instance_ ); } static constexpr int kIndexInFileMessages = 6; - friend void swap(MessageOfWormhole& a, MessageOfWormhole& b) + friend void swap(MessageOfBridge& a, MessageOfBridge& b) { a.Swap(&b); } - inline void Swap(MessageOfWormhole* other) + inline void Swap(MessageOfBridge* other) { if (other == this) return; @@ -1868,7 +1868,7 @@ namespace protobuf ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); } } - void UnsafeArenaSwap(MessageOfWormhole* other) + void UnsafeArenaSwap(MessageOfBridge* other) { if (other == this) return; @@ -1878,16 +1878,16 @@ namespace protobuf // implements Message ---------------------------------------------- - MessageOfWormhole* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final + MessageOfBridge* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { - return CreateMaybeMessage(arena); + return CreateMaybeMessage(arena); } using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; - void CopyFrom(const MessageOfWormhole& from); + void CopyFrom(const MessageOfBridge& from); using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; - void MergeFrom(const MessageOfWormhole& from) + void MergeFrom(const MessageOfBridge& from) { - MessageOfWormhole::MergeImpl(*this, from); + MessageOfBridge::MergeImpl(*this, from); } private: @@ -1911,17 +1911,17 @@ namespace protobuf void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); void SharedDtor(); void SetCachedSize(int size) const final; - void InternalSwap(MessageOfWormhole* other); + void InternalSwap(MessageOfBridge* other); private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "protobuf.MessageOfWormhole"; + return "protobuf.MessageOfBridge"; } protected: - explicit MessageOfWormhole(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); + explicit MessageOfBridge(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); public: static const ClassData _class_data_; @@ -1969,7 +1969,7 @@ namespace protobuf void _internal_set_hp(int32_t value); public: - // @@protoc_insertion_point(class_scope:protobuf.MessageOfWormhole) + // @@protoc_insertion_point(class_scope:protobuf.MessageOfBridge) private: class _Internal; @@ -1993,31 +1993,31 @@ namespace protobuf }; // ------------------------------------------------------------------- - class MessageOfResource final : - public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:protobuf.MessageOfResource) */ + class MessageOfGarbage final : + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:protobuf.MessageOfGarbage) */ { public: - inline MessageOfResource() : - MessageOfResource(nullptr) + inline MessageOfGarbage() : + MessageOfGarbage(nullptr) { } - ~MessageOfResource() override; - explicit PROTOBUF_CONSTEXPR MessageOfResource(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + ~MessageOfGarbage() override; + explicit PROTOBUF_CONSTEXPR MessageOfGarbage(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); - MessageOfResource(const MessageOfResource& from); - MessageOfResource(MessageOfResource&& from) noexcept + MessageOfGarbage(const MessageOfGarbage& from); + MessageOfGarbage(MessageOfGarbage&& from) noexcept : - MessageOfResource() + MessageOfGarbage() { *this = ::std::move(from); } - inline MessageOfResource& operator=(const MessageOfResource& from) + inline MessageOfGarbage& operator=(const MessageOfGarbage& from) { CopyFrom(from); return *this; } - inline MessageOfResource& operator=(MessageOfResource&& from) noexcept + inline MessageOfGarbage& operator=(MessageOfGarbage&& from) noexcept { if (this == &from) return *this; @@ -2048,24 +2048,24 @@ namespace protobuf { return default_instance().GetMetadata().reflection; } - static const MessageOfResource& default_instance() + static const MessageOfGarbage& default_instance() { return *internal_default_instance(); } - static inline const MessageOfResource* internal_default_instance() + static inline const MessageOfGarbage* internal_default_instance() { - return reinterpret_cast( - &_MessageOfResource_default_instance_ + return reinterpret_cast( + &_MessageOfGarbage_default_instance_ ); } static constexpr int kIndexInFileMessages = 7; - friend void swap(MessageOfResource& a, MessageOfResource& b) + friend void swap(MessageOfGarbage& a, MessageOfGarbage& b) { a.Swap(&b); } - inline void Swap(MessageOfResource* other) + inline void Swap(MessageOfGarbage* other) { if (other == this) return; @@ -2084,7 +2084,7 @@ namespace protobuf ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); } } - void UnsafeArenaSwap(MessageOfResource* other) + void UnsafeArenaSwap(MessageOfGarbage* other) { if (other == this) return; @@ -2094,16 +2094,16 @@ namespace protobuf // implements Message ---------------------------------------------- - MessageOfResource* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final + MessageOfGarbage* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { - return CreateMaybeMessage(arena); + return CreateMaybeMessage(arena); } using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; - void CopyFrom(const MessageOfResource& from); + void CopyFrom(const MessageOfGarbage& from); using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; - void MergeFrom(const MessageOfResource& from) + void MergeFrom(const MessageOfGarbage& from) { - MessageOfResource::MergeImpl(*this, from); + MessageOfGarbage::MergeImpl(*this, from); } private: @@ -2127,17 +2127,17 @@ namespace protobuf void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); void SharedDtor(); void SetCachedSize(int size) const final; - void InternalSwap(MessageOfResource* other); + void InternalSwap(MessageOfGarbage* other); private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "protobuf.MessageOfResource"; + return "protobuf.MessageOfGarbage"; } protected: - explicit MessageOfResource(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); + explicit MessageOfGarbage(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); public: static const ClassData _class_data_; @@ -2185,7 +2185,7 @@ namespace protobuf void _internal_set_progress(int32_t value); public: - // @@protoc_insertion_point(class_scope:protobuf.MessageOfResource) + // @@protoc_insertion_point(class_scope:protobuf.MessageOfGarbage) private: class _Internal; @@ -3172,14 +3172,14 @@ namespace protobuf } enum MessageOfObjCase { - kShipMessage = 1, + kSweeperMessage = 1, kBulletMessage = 2, - kFactoryMessage = 3, - kCommunityMessage = 4, - kFortMessage = 5, - kWormholeMessage = 6, + kRecyclebankMessage = 3, + kChargestationMessage = 4, + kSignaltowerMessage = 5, + kBridgeMessage = 6, kHomeMessage = 7, - kResourceMessage = 8, + kGarbageMessage = 8, kMapMessage = 9, kNewsMessage = 10, kBombedBulletMessage = 11, @@ -3286,41 +3286,41 @@ namespace protobuf enum : int { - kShipMessageFieldNumber = 1, + kSweeperMessageFieldNumber = 1, kBulletMessageFieldNumber = 2, - kFactoryMessageFieldNumber = 3, - kCommunityMessageFieldNumber = 4, - kFortMessageFieldNumber = 5, - kWormholeMessageFieldNumber = 6, + kRecyclebankMessageFieldNumber = 3, + kChargestationMessageFieldNumber = 4, + kSignaltowerMessageFieldNumber = 5, + kBridgeMessageFieldNumber = 6, kHomeMessageFieldNumber = 7, - kResourceMessageFieldNumber = 8, + kGarbageMessageFieldNumber = 8, kMapMessageFieldNumber = 9, kNewsMessageFieldNumber = 10, kBombedBulletMessageFieldNumber = 11, kTeamMessageFieldNumber = 12, }; - // .protobuf.MessageOfShip ship_message = 1; - bool has_ship_message() const; + // .protobuf.MessageOfSweeper sweeper_message = 1; + bool has_sweeper_message() const; private: - bool _internal_has_ship_message() const; + bool _internal_has_sweeper_message() const; public: - void clear_ship_message(); - const ::protobuf::MessageOfShip& ship_message() const; - PROTOBUF_NODISCARD ::protobuf::MessageOfShip* release_ship_message(); - ::protobuf::MessageOfShip* mutable_ship_message(); - void set_allocated_ship_message(::protobuf::MessageOfShip* ship_message); + void clear_sweeper_message(); + const ::protobuf::MessageOfSweeper& sweeper_message() const; + PROTOBUF_NODISCARD ::protobuf::MessageOfSweeper* release_sweeper_message(); + ::protobuf::MessageOfSweeper* mutable_sweeper_message(); + void set_allocated_sweeper_message(::protobuf::MessageOfSweeper* sweeper_message); private: - const ::protobuf::MessageOfShip& _internal_ship_message() const; - ::protobuf::MessageOfShip* _internal_mutable_ship_message(); + const ::protobuf::MessageOfSweeper& _internal_sweeper_message() const; + ::protobuf::MessageOfSweeper* _internal_mutable_sweeper_message(); public: - void unsafe_arena_set_allocated_ship_message( - ::protobuf::MessageOfShip* ship_message + void unsafe_arena_set_allocated_sweeper_message( + ::protobuf::MessageOfSweeper* sweeper_message ); - ::protobuf::MessageOfShip* unsafe_arena_release_ship_message(); + ::protobuf::MessageOfSweeper* unsafe_arena_release_sweeper_message(); // .protobuf.MessageOfBullet bullet_message = 2; bool has_bullet_message() const; @@ -3345,97 +3345,97 @@ namespace protobuf ); ::protobuf::MessageOfBullet* unsafe_arena_release_bullet_message(); - // .protobuf.MessageOfFactory factory_message = 3; - bool has_factory_message() const; + // .protobuf.MessageOfRecycleBank recyclebank_message = 3; + bool has_recyclebank_message() const; private: - bool _internal_has_factory_message() const; + bool _internal_has_recyclebank_message() const; public: - void clear_factory_message(); - const ::protobuf::MessageOfFactory& factory_message() const; - PROTOBUF_NODISCARD ::protobuf::MessageOfFactory* release_factory_message(); - ::protobuf::MessageOfFactory* mutable_factory_message(); - void set_allocated_factory_message(::protobuf::MessageOfFactory* factory_message); + void clear_recyclebank_message(); + const ::protobuf::MessageOfRecycleBank& recyclebank_message() const; + PROTOBUF_NODISCARD ::protobuf::MessageOfRecycleBank* release_recyclebank_message(); + ::protobuf::MessageOfRecycleBank* mutable_recyclebank_message(); + void set_allocated_recyclebank_message(::protobuf::MessageOfRecycleBank* recyclebank_message); private: - const ::protobuf::MessageOfFactory& _internal_factory_message() const; - ::protobuf::MessageOfFactory* _internal_mutable_factory_message(); + const ::protobuf::MessageOfRecycleBank& _internal_recyclebank_message() const; + ::protobuf::MessageOfRecycleBank* _internal_mutable_recyclebank_message(); public: - void unsafe_arena_set_allocated_factory_message( - ::protobuf::MessageOfFactory* factory_message + void unsafe_arena_set_allocated_recyclebank_message( + ::protobuf::MessageOfRecycleBank* recyclebank_message ); - ::protobuf::MessageOfFactory* unsafe_arena_release_factory_message(); + ::protobuf::MessageOfRecycleBank* unsafe_arena_release_recyclebank_message(); - // .protobuf.MessageOfCommunity community_message = 4; - bool has_community_message() const; + // .protobuf.MessageOfChargeStation chargestation_message = 4; + bool has_chargestation_message() const; private: - bool _internal_has_community_message() const; + bool _internal_has_chargestation_message() const; public: - void clear_community_message(); - const ::protobuf::MessageOfCommunity& community_message() const; - PROTOBUF_NODISCARD ::protobuf::MessageOfCommunity* release_community_message(); - ::protobuf::MessageOfCommunity* mutable_community_message(); - void set_allocated_community_message(::protobuf::MessageOfCommunity* community_message); + void clear_chargestation_message(); + const ::protobuf::MessageOfChargeStation& chargestation_message() const; + PROTOBUF_NODISCARD ::protobuf::MessageOfChargeStation* release_chargestation_message(); + ::protobuf::MessageOfChargeStation* mutable_chargestation_message(); + void set_allocated_chargestation_message(::protobuf::MessageOfChargeStation* chargestation_message); private: - const ::protobuf::MessageOfCommunity& _internal_community_message() const; - ::protobuf::MessageOfCommunity* _internal_mutable_community_message(); + const ::protobuf::MessageOfChargeStation& _internal_chargestation_message() const; + ::protobuf::MessageOfChargeStation* _internal_mutable_chargestation_message(); public: - void unsafe_arena_set_allocated_community_message( - ::protobuf::MessageOfCommunity* community_message + void unsafe_arena_set_allocated_chargestation_message( + ::protobuf::MessageOfChargeStation* chargestation_message ); - ::protobuf::MessageOfCommunity* unsafe_arena_release_community_message(); + ::protobuf::MessageOfChargeStation* unsafe_arena_release_chargestation_message(); - // .protobuf.MessageOfFort fort_message = 5; - bool has_fort_message() const; + // .protobuf.MessageOfSignalTower signaltower_message = 5; + bool has_signaltower_message() const; private: - bool _internal_has_fort_message() const; + bool _internal_has_signaltower_message() const; public: - void clear_fort_message(); - const ::protobuf::MessageOfFort& fort_message() const; - PROTOBUF_NODISCARD ::protobuf::MessageOfFort* release_fort_message(); - ::protobuf::MessageOfFort* mutable_fort_message(); - void set_allocated_fort_message(::protobuf::MessageOfFort* fort_message); + void clear_signaltower_message(); + const ::protobuf::MessageOfSignalTower& signaltower_message() const; + PROTOBUF_NODISCARD ::protobuf::MessageOfSignalTower* release_signaltower_message(); + ::protobuf::MessageOfSignalTower* mutable_signaltower_message(); + void set_allocated_signaltower_message(::protobuf::MessageOfSignalTower* signaltower_message); private: - const ::protobuf::MessageOfFort& _internal_fort_message() const; - ::protobuf::MessageOfFort* _internal_mutable_fort_message(); + const ::protobuf::MessageOfSignalTower& _internal_signaltower_message() const; + ::protobuf::MessageOfSignalTower* _internal_mutable_signaltower_message(); public: - void unsafe_arena_set_allocated_fort_message( - ::protobuf::MessageOfFort* fort_message + void unsafe_arena_set_allocated_signaltower_message( + ::protobuf::MessageOfSignalTower* signaltower_message ); - ::protobuf::MessageOfFort* unsafe_arena_release_fort_message(); + ::protobuf::MessageOfSignalTower* unsafe_arena_release_signaltower_message(); - // .protobuf.MessageOfWormhole wormhole_message = 6; - bool has_wormhole_message() const; + // .protobuf.MessageOfBridge bridge_message = 6; + bool has_bridge_message() const; private: - bool _internal_has_wormhole_message() const; + bool _internal_has_bridge_message() const; public: - void clear_wormhole_message(); - const ::protobuf::MessageOfWormhole& wormhole_message() const; - PROTOBUF_NODISCARD ::protobuf::MessageOfWormhole* release_wormhole_message(); - ::protobuf::MessageOfWormhole* mutable_wormhole_message(); - void set_allocated_wormhole_message(::protobuf::MessageOfWormhole* wormhole_message); + void clear_bridge_message(); + const ::protobuf::MessageOfBridge& bridge_message() const; + PROTOBUF_NODISCARD ::protobuf::MessageOfBridge* release_bridge_message(); + ::protobuf::MessageOfBridge* mutable_bridge_message(); + void set_allocated_bridge_message(::protobuf::MessageOfBridge* bridge_message); private: - const ::protobuf::MessageOfWormhole& _internal_wormhole_message() const; - ::protobuf::MessageOfWormhole* _internal_mutable_wormhole_message(); + const ::protobuf::MessageOfBridge& _internal_bridge_message() const; + ::protobuf::MessageOfBridge* _internal_mutable_bridge_message(); public: - void unsafe_arena_set_allocated_wormhole_message( - ::protobuf::MessageOfWormhole* wormhole_message + void unsafe_arena_set_allocated_bridge_message( + ::protobuf::MessageOfBridge* bridge_message ); - ::protobuf::MessageOfWormhole* unsafe_arena_release_wormhole_message(); + ::protobuf::MessageOfBridge* unsafe_arena_release_bridge_message(); // .protobuf.MessageOfHome home_message = 7; bool has_home_message() const; @@ -3460,28 +3460,28 @@ namespace protobuf ); ::protobuf::MessageOfHome* unsafe_arena_release_home_message(); - // .protobuf.MessageOfResource resource_message = 8; - bool has_resource_message() const; + // .protobuf.MessageOfGarbage garbage_message = 8; + bool has_garbage_message() const; private: - bool _internal_has_resource_message() const; + bool _internal_has_garbage_message() const; public: - void clear_resource_message(); - const ::protobuf::MessageOfResource& resource_message() const; - PROTOBUF_NODISCARD ::protobuf::MessageOfResource* release_resource_message(); - ::protobuf::MessageOfResource* mutable_resource_message(); - void set_allocated_resource_message(::protobuf::MessageOfResource* resource_message); + void clear_garbage_message(); + const ::protobuf::MessageOfGarbage& garbage_message() const; + PROTOBUF_NODISCARD ::protobuf::MessageOfGarbage* release_garbage_message(); + ::protobuf::MessageOfGarbage* mutable_garbage_message(); + void set_allocated_garbage_message(::protobuf::MessageOfGarbage* garbage_message); private: - const ::protobuf::MessageOfResource& _internal_resource_message() const; - ::protobuf::MessageOfResource* _internal_mutable_resource_message(); + const ::protobuf::MessageOfGarbage& _internal_garbage_message() const; + ::protobuf::MessageOfGarbage* _internal_mutable_garbage_message(); public: - void unsafe_arena_set_allocated_resource_message( - ::protobuf::MessageOfResource* resource_message + void unsafe_arena_set_allocated_garbage_message( + ::protobuf::MessageOfGarbage* garbage_message ); - ::protobuf::MessageOfResource* unsafe_arena_release_resource_message(); + ::protobuf::MessageOfGarbage* unsafe_arena_release_garbage_message(); // .protobuf.MessageOfMap map_message = 9; bool has_map_message() const; @@ -3581,14 +3581,14 @@ namespace protobuf private: class _Internal; - void set_has_ship_message(); + void set_has_sweeper_message(); void set_has_bullet_message(); - void set_has_factory_message(); - void set_has_community_message(); - void set_has_fort_message(); - void set_has_wormhole_message(); + void set_has_recyclebank_message(); + void set_has_chargestation_message(); + void set_has_signaltower_message(); + void set_has_bridge_message(); void set_has_home_message(); - void set_has_resource_message(); + void set_has_garbage_message(); void set_has_map_message(); void set_has_news_message(); void set_has_bombed_bullet_message(); @@ -3610,14 +3610,14 @@ namespace protobuf { } ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized _constinit_; - ::protobuf::MessageOfShip* ship_message_; + ::protobuf::MessageOfSweeper* sweeper_message_; ::protobuf::MessageOfBullet* bullet_message_; - ::protobuf::MessageOfFactory* factory_message_; - ::protobuf::MessageOfCommunity* community_message_; - ::protobuf::MessageOfFort* fort_message_; - ::protobuf::MessageOfWormhole* wormhole_message_; + ::protobuf::MessageOfRecycleBank* recyclebank_message_; + ::protobuf::MessageOfChargeStation* chargestation_message_; + ::protobuf::MessageOfSignalTower* signaltower_message_; + ::protobuf::MessageOfBridge* bridge_message_; ::protobuf::MessageOfHome* home_message_; - ::protobuf::MessageOfResource* resource_message_; + ::protobuf::MessageOfGarbage* garbage_message_; ::protobuf::MessageOfMap* map_message_; ::protobuf::MessageOfNews* news_message_; ::protobuf::MessageOfBombedBullet* bombed_bullet_message_; @@ -4547,31 +4547,31 @@ namespace protobuf }; // ------------------------------------------------------------------- - class ShipInfoRes final : - public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:protobuf.ShipInfoRes) */ + class SweeperInfoRes final : + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:protobuf.SweeperInfoRes) */ { public: - inline ShipInfoRes() : - ShipInfoRes(nullptr) + inline SweeperInfoRes() : + SweeperInfoRes(nullptr) { } - ~ShipInfoRes() override; - explicit PROTOBUF_CONSTEXPR ShipInfoRes(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + ~SweeperInfoRes() override; + explicit PROTOBUF_CONSTEXPR SweeperInfoRes(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); - ShipInfoRes(const ShipInfoRes& from); - ShipInfoRes(ShipInfoRes&& from) noexcept + SweeperInfoRes(const SweeperInfoRes& from); + SweeperInfoRes(SweeperInfoRes&& from) noexcept : - ShipInfoRes() + SweeperInfoRes() { *this = ::std::move(from); } - inline ShipInfoRes& operator=(const ShipInfoRes& from) + inline SweeperInfoRes& operator=(const SweeperInfoRes& from) { CopyFrom(from); return *this; } - inline ShipInfoRes& operator=(ShipInfoRes&& from) noexcept + inline SweeperInfoRes& operator=(SweeperInfoRes&& from) noexcept { if (this == &from) return *this; @@ -4602,24 +4602,24 @@ namespace protobuf { return default_instance().GetMetadata().reflection; } - static const ShipInfoRes& default_instance() + static const SweeperInfoRes& default_instance() { return *internal_default_instance(); } - static inline const ShipInfoRes* internal_default_instance() + static inline const SweeperInfoRes* internal_default_instance() { - return reinterpret_cast( - &_ShipInfoRes_default_instance_ + return reinterpret_cast( + &_SweeperInfoRes_default_instance_ ); } static constexpr int kIndexInFileMessages = 17; - friend void swap(ShipInfoRes& a, ShipInfoRes& b) + friend void swap(SweeperInfoRes& a, SweeperInfoRes& b) { a.Swap(&b); } - inline void Swap(ShipInfoRes* other) + inline void Swap(SweeperInfoRes* other) { if (other == this) return; @@ -4638,7 +4638,7 @@ namespace protobuf ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); } } - void UnsafeArenaSwap(ShipInfoRes* other) + void UnsafeArenaSwap(SweeperInfoRes* other) { if (other == this) return; @@ -4648,16 +4648,16 @@ namespace protobuf // implements Message ---------------------------------------------- - ShipInfoRes* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final + SweeperInfoRes* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { - return CreateMaybeMessage(arena); + return CreateMaybeMessage(arena); } using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; - void CopyFrom(const ShipInfoRes& from); + void CopyFrom(const SweeperInfoRes& from); using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; - void MergeFrom(const ShipInfoRes& from) + void MergeFrom(const SweeperInfoRes& from) { - ShipInfoRes::MergeImpl(*this, from); + SweeperInfoRes::MergeImpl(*this, from); } private: @@ -4681,17 +4681,17 @@ namespace protobuf void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); void SharedDtor(); void SetCachedSize(int size) const final; - void InternalSwap(ShipInfoRes* other); + void InternalSwap(SweeperInfoRes* other); private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "protobuf.ShipInfoRes"; + return "protobuf.SweeperInfoRes"; } protected: - explicit ShipInfoRes(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); + explicit SweeperInfoRes(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); public: static const ClassData _class_data_; @@ -4705,31 +4705,31 @@ namespace protobuf enum : int { - kShipInfoFieldNumber = 1, + kSweeperInfoFieldNumber = 1, }; - // repeated .protobuf.MessageOfShip ship_info = 1; - int ship_info_size() const; + // repeated .protobuf.MessageOfSweeper sweeper_info = 1; + int sweeper_info_size() const; private: - int _internal_ship_info_size() const; + int _internal_sweeper_info_size() const; public: - void clear_ship_info(); - ::protobuf::MessageOfShip* mutable_ship_info(int index); - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<::protobuf::MessageOfShip>* - mutable_ship_info(); + void clear_sweeper_info(); + ::protobuf::MessageOfSweeper* mutable_sweeper_info(int index); + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<::protobuf::MessageOfSweeper>* + mutable_sweeper_info(); private: - const ::protobuf::MessageOfShip& _internal_ship_info(int index) const; - ::protobuf::MessageOfShip* _internal_add_ship_info(); + const ::protobuf::MessageOfSweeper& _internal_sweeper_info(int index) const; + ::protobuf::MessageOfSweeper* _internal_add_sweeper_info(); public: - const ::protobuf::MessageOfShip& ship_info(int index) const; - ::protobuf::MessageOfShip* add_ship_info(); - const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<::protobuf::MessageOfShip>& - ship_info() const; + const ::protobuf::MessageOfSweeper& sweeper_info(int index) const; + ::protobuf::MessageOfSweeper* add_sweeper_info(); + const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<::protobuf::MessageOfSweeper>& + sweeper_info() const; - // @@protoc_insertion_point(class_scope:protobuf.ShipInfoRes) + // @@protoc_insertion_point(class_scope:protobuf.SweeperInfoRes) private: class _Internal; @@ -4740,7 +4740,7 @@ namespace protobuf typedef void DestructorSkippable_; struct Impl_ { - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<::protobuf::MessageOfShip> ship_info_; + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<::protobuf::MessageOfSweeper> sweeper_info_; mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; }; union @@ -5222,438 +5222,438 @@ namespace protobuf #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wstrict-aliasing" #endif // __GNUC__ - // MessageOfShip + // MessageOfSweeper // int32 x = 1; - inline void MessageOfShip::clear_x() + inline void MessageOfSweeper::clear_x() { _impl_.x_ = 0; } - inline int32_t MessageOfShip::_internal_x() const + inline int32_t MessageOfSweeper::_internal_x() const { return _impl_.x_; } - inline int32_t MessageOfShip::x() const + inline int32_t MessageOfSweeper::x() const { - // @@protoc_insertion_point(field_get:protobuf.MessageOfShip.x) + // @@protoc_insertion_point(field_get:protobuf.MessageOfSweeper.x) return _internal_x(); } - inline void MessageOfShip::_internal_set_x(int32_t value) + inline void MessageOfSweeper::_internal_set_x(int32_t value) { _impl_.x_ = value; } - inline void MessageOfShip::set_x(int32_t value) + inline void MessageOfSweeper::set_x(int32_t value) { _internal_set_x(value); - // @@protoc_insertion_point(field_set:protobuf.MessageOfShip.x) + // @@protoc_insertion_point(field_set:protobuf.MessageOfSweeper.x) } // int32 y = 2; - inline void MessageOfShip::clear_y() + inline void MessageOfSweeper::clear_y() { _impl_.y_ = 0; } - inline int32_t MessageOfShip::_internal_y() const + inline int32_t MessageOfSweeper::_internal_y() const { return _impl_.y_; } - inline int32_t MessageOfShip::y() const + inline int32_t MessageOfSweeper::y() const { - // @@protoc_insertion_point(field_get:protobuf.MessageOfShip.y) + // @@protoc_insertion_point(field_get:protobuf.MessageOfSweeper.y) return _internal_y(); } - inline void MessageOfShip::_internal_set_y(int32_t value) + inline void MessageOfSweeper::_internal_set_y(int32_t value) { _impl_.y_ = value; } - inline void MessageOfShip::set_y(int32_t value) + inline void MessageOfSweeper::set_y(int32_t value) { _internal_set_y(value); - // @@protoc_insertion_point(field_set:protobuf.MessageOfShip.y) + // @@protoc_insertion_point(field_set:protobuf.MessageOfSweeper.y) } // int32 speed = 3; - inline void MessageOfShip::clear_speed() + inline void MessageOfSweeper::clear_speed() { _impl_.speed_ = 0; } - inline int32_t MessageOfShip::_internal_speed() const + inline int32_t MessageOfSweeper::_internal_speed() const { return _impl_.speed_; } - inline int32_t MessageOfShip::speed() const + inline int32_t MessageOfSweeper::speed() const { - // @@protoc_insertion_point(field_get:protobuf.MessageOfShip.speed) + // @@protoc_insertion_point(field_get:protobuf.MessageOfSweeper.speed) return _internal_speed(); } - inline void MessageOfShip::_internal_set_speed(int32_t value) + inline void MessageOfSweeper::_internal_set_speed(int32_t value) { _impl_.speed_ = value; } - inline void MessageOfShip::set_speed(int32_t value) + inline void MessageOfSweeper::set_speed(int32_t value) { _internal_set_speed(value); - // @@protoc_insertion_point(field_set:protobuf.MessageOfShip.speed) + // @@protoc_insertion_point(field_set:protobuf.MessageOfSweeper.speed) } // int32 hp = 4; - inline void MessageOfShip::clear_hp() + inline void MessageOfSweeper::clear_hp() { _impl_.hp_ = 0; } - inline int32_t MessageOfShip::_internal_hp() const + inline int32_t MessageOfSweeper::_internal_hp() const { return _impl_.hp_; } - inline int32_t MessageOfShip::hp() const + inline int32_t MessageOfSweeper::hp() const { - // @@protoc_insertion_point(field_get:protobuf.MessageOfShip.hp) + // @@protoc_insertion_point(field_get:protobuf.MessageOfSweeper.hp) return _internal_hp(); } - inline void MessageOfShip::_internal_set_hp(int32_t value) + inline void MessageOfSweeper::_internal_set_hp(int32_t value) { _impl_.hp_ = value; } - inline void MessageOfShip::set_hp(int32_t value) + inline void MessageOfSweeper::set_hp(int32_t value) { _internal_set_hp(value); - // @@protoc_insertion_point(field_set:protobuf.MessageOfShip.hp) + // @@protoc_insertion_point(field_set:protobuf.MessageOfSweeper.hp) } // int32 armor = 5; - inline void MessageOfShip::clear_armor() + inline void MessageOfSweeper::clear_armor() { _impl_.armor_ = 0; } - inline int32_t MessageOfShip::_internal_armor() const + inline int32_t MessageOfSweeper::_internal_armor() const { return _impl_.armor_; } - inline int32_t MessageOfShip::armor() const + inline int32_t MessageOfSweeper::armor() const { - // @@protoc_insertion_point(field_get:protobuf.MessageOfShip.armor) + // @@protoc_insertion_point(field_get:protobuf.MessageOfSweeper.armor) return _internal_armor(); } - inline void MessageOfShip::_internal_set_armor(int32_t value) + inline void MessageOfSweeper::_internal_set_armor(int32_t value) { _impl_.armor_ = value; } - inline void MessageOfShip::set_armor(int32_t value) + inline void MessageOfSweeper::set_armor(int32_t value) { _internal_set_armor(value); - // @@protoc_insertion_point(field_set:protobuf.MessageOfShip.armor) + // @@protoc_insertion_point(field_set:protobuf.MessageOfSweeper.armor) } // int32 shield = 6; - inline void MessageOfShip::clear_shield() + inline void MessageOfSweeper::clear_shield() { _impl_.shield_ = 0; } - inline int32_t MessageOfShip::_internal_shield() const + inline int32_t MessageOfSweeper::_internal_shield() const { return _impl_.shield_; } - inline int32_t MessageOfShip::shield() const + inline int32_t MessageOfSweeper::shield() const { - // @@protoc_insertion_point(field_get:protobuf.MessageOfShip.shield) + // @@protoc_insertion_point(field_get:protobuf.MessageOfSweeper.shield) return _internal_shield(); } - inline void MessageOfShip::_internal_set_shield(int32_t value) + inline void MessageOfSweeper::_internal_set_shield(int32_t value) { _impl_.shield_ = value; } - inline void MessageOfShip::set_shield(int32_t value) + inline void MessageOfSweeper::set_shield(int32_t value) { _internal_set_shield(value); - // @@protoc_insertion_point(field_set:protobuf.MessageOfShip.shield) + // @@protoc_insertion_point(field_set:protobuf.MessageOfSweeper.shield) } // int64 team_id = 7; - inline void MessageOfShip::clear_team_id() + inline void MessageOfSweeper::clear_team_id() { _impl_.team_id_ = int64_t{0}; } - inline int64_t MessageOfShip::_internal_team_id() const + inline int64_t MessageOfSweeper::_internal_team_id() const { return _impl_.team_id_; } - inline int64_t MessageOfShip::team_id() const + inline int64_t MessageOfSweeper::team_id() const { - // @@protoc_insertion_point(field_get:protobuf.MessageOfShip.team_id) + // @@protoc_insertion_point(field_get:protobuf.MessageOfSweeper.team_id) return _internal_team_id(); } - inline void MessageOfShip::_internal_set_team_id(int64_t value) + inline void MessageOfSweeper::_internal_set_team_id(int64_t value) { _impl_.team_id_ = value; } - inline void MessageOfShip::set_team_id(int64_t value) + inline void MessageOfSweeper::set_team_id(int64_t value) { _internal_set_team_id(value); - // @@protoc_insertion_point(field_set:protobuf.MessageOfShip.team_id) + // @@protoc_insertion_point(field_set:protobuf.MessageOfSweeper.team_id) } // int64 player_id = 8; - inline void MessageOfShip::clear_player_id() + inline void MessageOfSweeper::clear_player_id() { _impl_.player_id_ = int64_t{0}; } - inline int64_t MessageOfShip::_internal_player_id() const + inline int64_t MessageOfSweeper::_internal_player_id() const { return _impl_.player_id_; } - inline int64_t MessageOfShip::player_id() const + inline int64_t MessageOfSweeper::player_id() const { - // @@protoc_insertion_point(field_get:protobuf.MessageOfShip.player_id) + // @@protoc_insertion_point(field_get:protobuf.MessageOfSweeper.player_id) return _internal_player_id(); } - inline void MessageOfShip::_internal_set_player_id(int64_t value) + inline void MessageOfSweeper::_internal_set_player_id(int64_t value) { _impl_.player_id_ = value; } - inline void MessageOfShip::set_player_id(int64_t value) + inline void MessageOfSweeper::set_player_id(int64_t value) { _internal_set_player_id(value); - // @@protoc_insertion_point(field_set:protobuf.MessageOfShip.player_id) + // @@protoc_insertion_point(field_set:protobuf.MessageOfSweeper.player_id) } // int64 guid = 9; - inline void MessageOfShip::clear_guid() + inline void MessageOfSweeper::clear_guid() { _impl_.guid_ = int64_t{0}; } - inline int64_t MessageOfShip::_internal_guid() const + inline int64_t MessageOfSweeper::_internal_guid() const { return _impl_.guid_; } - inline int64_t MessageOfShip::guid() const + inline int64_t MessageOfSweeper::guid() const { - // @@protoc_insertion_point(field_get:protobuf.MessageOfShip.guid) + // @@protoc_insertion_point(field_get:protobuf.MessageOfSweeper.guid) return _internal_guid(); } - inline void MessageOfShip::_internal_set_guid(int64_t value) + inline void MessageOfSweeper::_internal_set_guid(int64_t value) { _impl_.guid_ = value; } - inline void MessageOfShip::set_guid(int64_t value) + inline void MessageOfSweeper::set_guid(int64_t value) { _internal_set_guid(value); - // @@protoc_insertion_point(field_set:protobuf.MessageOfShip.guid) + // @@protoc_insertion_point(field_set:protobuf.MessageOfSweeper.guid) } - // .protobuf.ShipState ship_state = 10; - inline void MessageOfShip::clear_ship_state() + // .protobuf.SweeperState sweeper_state = 10; + inline void MessageOfSweeper::clear_sweeper_state() { - _impl_.ship_state_ = 0; + _impl_.sweeper_state_ = 0; } - inline ::protobuf::ShipState MessageOfShip::_internal_ship_state() const + inline ::protobuf::SweeperState MessageOfSweeper::_internal_sweeper_state() const { - return static_cast<::protobuf::ShipState>(_impl_.ship_state_); + return static_cast<::protobuf::SweeperState>(_impl_.sweeper_state_); } - inline ::protobuf::ShipState MessageOfShip::ship_state() const + inline ::protobuf::SweeperState MessageOfSweeper::sweeper_state() const { - // @@protoc_insertion_point(field_get:protobuf.MessageOfShip.ship_state) - return _internal_ship_state(); + // @@protoc_insertion_point(field_get:protobuf.MessageOfSweeper.sweeper_state) + return _internal_sweeper_state(); } - inline void MessageOfShip::_internal_set_ship_state(::protobuf::ShipState value) + inline void MessageOfSweeper::_internal_set_sweeper_state(::protobuf::SweeperState value) { - _impl_.ship_state_ = value; + _impl_.sweeper_state_ = value; } - inline void MessageOfShip::set_ship_state(::protobuf::ShipState value) + inline void MessageOfSweeper::set_sweeper_state(::protobuf::SweeperState value) { - _internal_set_ship_state(value); - // @@protoc_insertion_point(field_set:protobuf.MessageOfShip.ship_state) + _internal_set_sweeper_state(value); + // @@protoc_insertion_point(field_set:protobuf.MessageOfSweeper.sweeper_state) } - // .protobuf.ShipType ship_type = 11; - inline void MessageOfShip::clear_ship_type() + // .protobuf.SweeperType sweeper_type = 11; + inline void MessageOfSweeper::clear_sweeper_type() { - _impl_.ship_type_ = 0; + _impl_.sweeper_type_ = 0; } - inline ::protobuf::ShipType MessageOfShip::_internal_ship_type() const + inline ::protobuf::SweeperType MessageOfSweeper::_internal_sweeper_type() const { - return static_cast<::protobuf::ShipType>(_impl_.ship_type_); + return static_cast<::protobuf::SweeperType>(_impl_.sweeper_type_); } - inline ::protobuf::ShipType MessageOfShip::ship_type() const + inline ::protobuf::SweeperType MessageOfSweeper::sweeper_type() const { - // @@protoc_insertion_point(field_get:protobuf.MessageOfShip.ship_type) - return _internal_ship_type(); + // @@protoc_insertion_point(field_get:protobuf.MessageOfSweeper.sweeper_type) + return _internal_sweeper_type(); } - inline void MessageOfShip::_internal_set_ship_type(::protobuf::ShipType value) + inline void MessageOfSweeper::_internal_set_sweeper_type(::protobuf::SweeperType value) { - _impl_.ship_type_ = value; + _impl_.sweeper_type_ = value; } - inline void MessageOfShip::set_ship_type(::protobuf::ShipType value) + inline void MessageOfSweeper::set_sweeper_type(::protobuf::SweeperType value) { - _internal_set_ship_type(value); - // @@protoc_insertion_point(field_set:protobuf.MessageOfShip.ship_type) + _internal_set_sweeper_type(value); + // @@protoc_insertion_point(field_set:protobuf.MessageOfSweeper.sweeper_type) } // int32 view_range = 12; - inline void MessageOfShip::clear_view_range() + inline void MessageOfSweeper::clear_view_range() { _impl_.view_range_ = 0; } - inline int32_t MessageOfShip::_internal_view_range() const + inline int32_t MessageOfSweeper::_internal_view_range() const { return _impl_.view_range_; } - inline int32_t MessageOfShip::view_range() const + inline int32_t MessageOfSweeper::view_range() const { - // @@protoc_insertion_point(field_get:protobuf.MessageOfShip.view_range) + // @@protoc_insertion_point(field_get:protobuf.MessageOfSweeper.view_range) return _internal_view_range(); } - inline void MessageOfShip::_internal_set_view_range(int32_t value) + inline void MessageOfSweeper::_internal_set_view_range(int32_t value) { _impl_.view_range_ = value; } - inline void MessageOfShip::set_view_range(int32_t value) + inline void MessageOfSweeper::set_view_range(int32_t value) { _internal_set_view_range(value); - // @@protoc_insertion_point(field_set:protobuf.MessageOfShip.view_range) + // @@protoc_insertion_point(field_set:protobuf.MessageOfSweeper.view_range) } // .protobuf.ProducerType producer_type = 13; - inline void MessageOfShip::clear_producer_type() + inline void MessageOfSweeper::clear_producer_type() { _impl_.producer_type_ = 0; } - inline ::protobuf::ProducerType MessageOfShip::_internal_producer_type() const + inline ::protobuf::ProducerType MessageOfSweeper::_internal_producer_type() const { return static_cast<::protobuf::ProducerType>(_impl_.producer_type_); } - inline ::protobuf::ProducerType MessageOfShip::producer_type() const + inline ::protobuf::ProducerType MessageOfSweeper::producer_type() const { - // @@protoc_insertion_point(field_get:protobuf.MessageOfShip.producer_type) + // @@protoc_insertion_point(field_get:protobuf.MessageOfSweeper.producer_type) return _internal_producer_type(); } - inline void MessageOfShip::_internal_set_producer_type(::protobuf::ProducerType value) + inline void MessageOfSweeper::_internal_set_producer_type(::protobuf::ProducerType value) { _impl_.producer_type_ = value; } - inline void MessageOfShip::set_producer_type(::protobuf::ProducerType value) + inline void MessageOfSweeper::set_producer_type(::protobuf::ProducerType value) { _internal_set_producer_type(value); - // @@protoc_insertion_point(field_set:protobuf.MessageOfShip.producer_type) + // @@protoc_insertion_point(field_set:protobuf.MessageOfSweeper.producer_type) } // .protobuf.ConstructorType constructor_type = 14; - inline void MessageOfShip::clear_constructor_type() + inline void MessageOfSweeper::clear_constructor_type() { _impl_.constructor_type_ = 0; } - inline ::protobuf::ConstructorType MessageOfShip::_internal_constructor_type() const + inline ::protobuf::ConstructorType MessageOfSweeper::_internal_constructor_type() const { return static_cast<::protobuf::ConstructorType>(_impl_.constructor_type_); } - inline ::protobuf::ConstructorType MessageOfShip::constructor_type() const + inline ::protobuf::ConstructorType MessageOfSweeper::constructor_type() const { - // @@protoc_insertion_point(field_get:protobuf.MessageOfShip.constructor_type) + // @@protoc_insertion_point(field_get:protobuf.MessageOfSweeper.constructor_type) return _internal_constructor_type(); } - inline void MessageOfShip::_internal_set_constructor_type(::protobuf::ConstructorType value) + inline void MessageOfSweeper::_internal_set_constructor_type(::protobuf::ConstructorType value) { _impl_.constructor_type_ = value; } - inline void MessageOfShip::set_constructor_type(::protobuf::ConstructorType value) + inline void MessageOfSweeper::set_constructor_type(::protobuf::ConstructorType value) { _internal_set_constructor_type(value); - // @@protoc_insertion_point(field_set:protobuf.MessageOfShip.constructor_type) + // @@protoc_insertion_point(field_set:protobuf.MessageOfSweeper.constructor_type) } // .protobuf.ArmorType armor_type = 15; - inline void MessageOfShip::clear_armor_type() + inline void MessageOfSweeper::clear_armor_type() { _impl_.armor_type_ = 0; } - inline ::protobuf::ArmorType MessageOfShip::_internal_armor_type() const + inline ::protobuf::ArmorType MessageOfSweeper::_internal_armor_type() const { return static_cast<::protobuf::ArmorType>(_impl_.armor_type_); } - inline ::protobuf::ArmorType MessageOfShip::armor_type() const + inline ::protobuf::ArmorType MessageOfSweeper::armor_type() const { - // @@protoc_insertion_point(field_get:protobuf.MessageOfShip.armor_type) + // @@protoc_insertion_point(field_get:protobuf.MessageOfSweeper.armor_type) return _internal_armor_type(); } - inline void MessageOfShip::_internal_set_armor_type(::protobuf::ArmorType value) + inline void MessageOfSweeper::_internal_set_armor_type(::protobuf::ArmorType value) { _impl_.armor_type_ = value; } - inline void MessageOfShip::set_armor_type(::protobuf::ArmorType value) + inline void MessageOfSweeper::set_armor_type(::protobuf::ArmorType value) { _internal_set_armor_type(value); - // @@protoc_insertion_point(field_set:protobuf.MessageOfShip.armor_type) + // @@protoc_insertion_point(field_set:protobuf.MessageOfSweeper.armor_type) } // .protobuf.ShieldType shield_type = 16; - inline void MessageOfShip::clear_shield_type() + inline void MessageOfSweeper::clear_shield_type() { _impl_.shield_type_ = 0; } - inline ::protobuf::ShieldType MessageOfShip::_internal_shield_type() const + inline ::protobuf::ShieldType MessageOfSweeper::_internal_shield_type() const { return static_cast<::protobuf::ShieldType>(_impl_.shield_type_); } - inline ::protobuf::ShieldType MessageOfShip::shield_type() const + inline ::protobuf::ShieldType MessageOfSweeper::shield_type() const { - // @@protoc_insertion_point(field_get:protobuf.MessageOfShip.shield_type) + // @@protoc_insertion_point(field_get:protobuf.MessageOfSweeper.shield_type) return _internal_shield_type(); } - inline void MessageOfShip::_internal_set_shield_type(::protobuf::ShieldType value) + inline void MessageOfSweeper::_internal_set_shield_type(::protobuf::ShieldType value) { _impl_.shield_type_ = value; } - inline void MessageOfShip::set_shield_type(::protobuf::ShieldType value) + inline void MessageOfSweeper::set_shield_type(::protobuf::ShieldType value) { _internal_set_shield_type(value); - // @@protoc_insertion_point(field_set:protobuf.MessageOfShip.shield_type) + // @@protoc_insertion_point(field_set:protobuf.MessageOfSweeper.shield_type) } // .protobuf.WeaponType weapon_type = 17; - inline void MessageOfShip::clear_weapon_type() + inline void MessageOfSweeper::clear_weapon_type() { _impl_.weapon_type_ = 0; } - inline ::protobuf::WeaponType MessageOfShip::_internal_weapon_type() const + inline ::protobuf::WeaponType MessageOfSweeper::_internal_weapon_type() const { return static_cast<::protobuf::WeaponType>(_impl_.weapon_type_); } - inline ::protobuf::WeaponType MessageOfShip::weapon_type() const + inline ::protobuf::WeaponType MessageOfSweeper::weapon_type() const { - // @@protoc_insertion_point(field_get:protobuf.MessageOfShip.weapon_type) + // @@protoc_insertion_point(field_get:protobuf.MessageOfSweeper.weapon_type) return _internal_weapon_type(); } - inline void MessageOfShip::_internal_set_weapon_type(::protobuf::WeaponType value) + inline void MessageOfSweeper::_internal_set_weapon_type(::protobuf::WeaponType value) { _impl_.weapon_type_ = value; } - inline void MessageOfShip::set_weapon_type(::protobuf::WeaponType value) + inline void MessageOfSweeper::set_weapon_type(::protobuf::WeaponType value) { _internal_set_weapon_type(value); - // @@protoc_insertion_point(field_set:protobuf.MessageOfShip.weapon_type) + // @@protoc_insertion_point(field_set:protobuf.MessageOfSweeper.weapon_type) } // double facing_direction = 18; - inline void MessageOfShip::clear_facing_direction() + inline void MessageOfSweeper::clear_facing_direction() { _impl_.facing_direction_ = 0; } - inline double MessageOfShip::_internal_facing_direction() const + inline double MessageOfSweeper::_internal_facing_direction() const { return _impl_.facing_direction_; } - inline double MessageOfShip::facing_direction() const + inline double MessageOfSweeper::facing_direction() const { - // @@protoc_insertion_point(field_get:protobuf.MessageOfShip.facing_direction) + // @@protoc_insertion_point(field_get:protobuf.MessageOfSweeper.facing_direction) return _internal_facing_direction(); } - inline void MessageOfShip::_internal_set_facing_direction(double value) + inline void MessageOfSweeper::_internal_set_facing_direction(double value) { _impl_.facing_direction_ = value; } - inline void MessageOfShip::set_facing_direction(double value) + inline void MessageOfSweeper::set_facing_direction(double value) { _internal_set_facing_direction(value); - // @@protoc_insertion_point(field_set:protobuf.MessageOfShip.facing_direction) + // @@protoc_insertion_point(field_set:protobuf.MessageOfSweeper.facing_direction) } // ------------------------------------------------------------------- @@ -6026,454 +6026,454 @@ namespace protobuf // ------------------------------------------------------------------- - // MessageOfFactory + // MessageOfRecycleBank // int32 x = 1; - inline void MessageOfFactory::clear_x() + inline void MessageOfRecycleBank::clear_x() { _impl_.x_ = 0; } - inline int32_t MessageOfFactory::_internal_x() const + inline int32_t MessageOfRecycleBank::_internal_x() const { return _impl_.x_; } - inline int32_t MessageOfFactory::x() const + inline int32_t MessageOfRecycleBank::x() const { - // @@protoc_insertion_point(field_get:protobuf.MessageOfFactory.x) + // @@protoc_insertion_point(field_get:protobuf.MessageOfRecycleBank.x) return _internal_x(); } - inline void MessageOfFactory::_internal_set_x(int32_t value) + inline void MessageOfRecycleBank::_internal_set_x(int32_t value) { _impl_.x_ = value; } - inline void MessageOfFactory::set_x(int32_t value) + inline void MessageOfRecycleBank::set_x(int32_t value) { _internal_set_x(value); - // @@protoc_insertion_point(field_set:protobuf.MessageOfFactory.x) + // @@protoc_insertion_point(field_set:protobuf.MessageOfRecycleBank.x) } // int32 y = 2; - inline void MessageOfFactory::clear_y() + inline void MessageOfRecycleBank::clear_y() { _impl_.y_ = 0; } - inline int32_t MessageOfFactory::_internal_y() const + inline int32_t MessageOfRecycleBank::_internal_y() const { return _impl_.y_; } - inline int32_t MessageOfFactory::y() const + inline int32_t MessageOfRecycleBank::y() const { - // @@protoc_insertion_point(field_get:protobuf.MessageOfFactory.y) + // @@protoc_insertion_point(field_get:protobuf.MessageOfRecycleBank.y) return _internal_y(); } - inline void MessageOfFactory::_internal_set_y(int32_t value) + inline void MessageOfRecycleBank::_internal_set_y(int32_t value) { _impl_.y_ = value; } - inline void MessageOfFactory::set_y(int32_t value) + inline void MessageOfRecycleBank::set_y(int32_t value) { _internal_set_y(value); - // @@protoc_insertion_point(field_set:protobuf.MessageOfFactory.y) + // @@protoc_insertion_point(field_set:protobuf.MessageOfRecycleBank.y) } // int32 hp = 3; - inline void MessageOfFactory::clear_hp() + inline void MessageOfRecycleBank::clear_hp() { _impl_.hp_ = 0; } - inline int32_t MessageOfFactory::_internal_hp() const + inline int32_t MessageOfRecycleBank::_internal_hp() const { return _impl_.hp_; } - inline int32_t MessageOfFactory::hp() const + inline int32_t MessageOfRecycleBank::hp() const { - // @@protoc_insertion_point(field_get:protobuf.MessageOfFactory.hp) + // @@protoc_insertion_point(field_get:protobuf.MessageOfRecycleBank.hp) return _internal_hp(); } - inline void MessageOfFactory::_internal_set_hp(int32_t value) + inline void MessageOfRecycleBank::_internal_set_hp(int32_t value) { _impl_.hp_ = value; } - inline void MessageOfFactory::set_hp(int32_t value) + inline void MessageOfRecycleBank::set_hp(int32_t value) { _internal_set_hp(value); - // @@protoc_insertion_point(field_set:protobuf.MessageOfFactory.hp) + // @@protoc_insertion_point(field_set:protobuf.MessageOfRecycleBank.hp) } // int64 team_id = 4; - inline void MessageOfFactory::clear_team_id() + inline void MessageOfRecycleBank::clear_team_id() { _impl_.team_id_ = int64_t{0}; } - inline int64_t MessageOfFactory::_internal_team_id() const + inline int64_t MessageOfRecycleBank::_internal_team_id() const { return _impl_.team_id_; } - inline int64_t MessageOfFactory::team_id() const + inline int64_t MessageOfRecycleBank::team_id() const { - // @@protoc_insertion_point(field_get:protobuf.MessageOfFactory.team_id) + // @@protoc_insertion_point(field_get:protobuf.MessageOfRecycleBank.team_id) return _internal_team_id(); } - inline void MessageOfFactory::_internal_set_team_id(int64_t value) + inline void MessageOfRecycleBank::_internal_set_team_id(int64_t value) { _impl_.team_id_ = value; } - inline void MessageOfFactory::set_team_id(int64_t value) + inline void MessageOfRecycleBank::set_team_id(int64_t value) { _internal_set_team_id(value); - // @@protoc_insertion_point(field_set:protobuf.MessageOfFactory.team_id) + // @@protoc_insertion_point(field_set:protobuf.MessageOfRecycleBank.team_id) } // ------------------------------------------------------------------- - // MessageOfCommunity + // MessageOfChargeStation // int32 x = 1; - inline void MessageOfCommunity::clear_x() + inline void MessageOfChargeStation::clear_x() { _impl_.x_ = 0; } - inline int32_t MessageOfCommunity::_internal_x() const + inline int32_t MessageOfChargeStation::_internal_x() const { return _impl_.x_; } - inline int32_t MessageOfCommunity::x() const + inline int32_t MessageOfChargeStation::x() const { - // @@protoc_insertion_point(field_get:protobuf.MessageOfCommunity.x) + // @@protoc_insertion_point(field_get:protobuf.MessageOfChargeStation.x) return _internal_x(); } - inline void MessageOfCommunity::_internal_set_x(int32_t value) + inline void MessageOfChargeStation::_internal_set_x(int32_t value) { _impl_.x_ = value; } - inline void MessageOfCommunity::set_x(int32_t value) + inline void MessageOfChargeStation::set_x(int32_t value) { _internal_set_x(value); - // @@protoc_insertion_point(field_set:protobuf.MessageOfCommunity.x) + // @@protoc_insertion_point(field_set:protobuf.MessageOfChargeStation.x) } // int32 y = 2; - inline void MessageOfCommunity::clear_y() + inline void MessageOfChargeStation::clear_y() { _impl_.y_ = 0; } - inline int32_t MessageOfCommunity::_internal_y() const + inline int32_t MessageOfChargeStation::_internal_y() const { return _impl_.y_; } - inline int32_t MessageOfCommunity::y() const + inline int32_t MessageOfChargeStation::y() const { - // @@protoc_insertion_point(field_get:protobuf.MessageOfCommunity.y) + // @@protoc_insertion_point(field_get:protobuf.MessageOfChargeStation.y) return _internal_y(); } - inline void MessageOfCommunity::_internal_set_y(int32_t value) + inline void MessageOfChargeStation::_internal_set_y(int32_t value) { _impl_.y_ = value; } - inline void MessageOfCommunity::set_y(int32_t value) + inline void MessageOfChargeStation::set_y(int32_t value) { _internal_set_y(value); - // @@protoc_insertion_point(field_set:protobuf.MessageOfCommunity.y) + // @@protoc_insertion_point(field_set:protobuf.MessageOfChargeStation.y) } // int32 hp = 3; - inline void MessageOfCommunity::clear_hp() + inline void MessageOfChargeStation::clear_hp() { _impl_.hp_ = 0; } - inline int32_t MessageOfCommunity::_internal_hp() const + inline int32_t MessageOfChargeStation::_internal_hp() const { return _impl_.hp_; } - inline int32_t MessageOfCommunity::hp() const + inline int32_t MessageOfChargeStation::hp() const { - // @@protoc_insertion_point(field_get:protobuf.MessageOfCommunity.hp) + // @@protoc_insertion_point(field_get:protobuf.MessageOfChargeStation.hp) return _internal_hp(); } - inline void MessageOfCommunity::_internal_set_hp(int32_t value) + inline void MessageOfChargeStation::_internal_set_hp(int32_t value) { _impl_.hp_ = value; } - inline void MessageOfCommunity::set_hp(int32_t value) + inline void MessageOfChargeStation::set_hp(int32_t value) { _internal_set_hp(value); - // @@protoc_insertion_point(field_set:protobuf.MessageOfCommunity.hp) + // @@protoc_insertion_point(field_set:protobuf.MessageOfChargeStation.hp) } // int64 team_id = 4; - inline void MessageOfCommunity::clear_team_id() + inline void MessageOfChargeStation::clear_team_id() { _impl_.team_id_ = int64_t{0}; } - inline int64_t MessageOfCommunity::_internal_team_id() const + inline int64_t MessageOfChargeStation::_internal_team_id() const { return _impl_.team_id_; } - inline int64_t MessageOfCommunity::team_id() const + inline int64_t MessageOfChargeStation::team_id() const { - // @@protoc_insertion_point(field_get:protobuf.MessageOfCommunity.team_id) + // @@protoc_insertion_point(field_get:protobuf.MessageOfChargeStation.team_id) return _internal_team_id(); } - inline void MessageOfCommunity::_internal_set_team_id(int64_t value) + inline void MessageOfChargeStation::_internal_set_team_id(int64_t value) { _impl_.team_id_ = value; } - inline void MessageOfCommunity::set_team_id(int64_t value) + inline void MessageOfChargeStation::set_team_id(int64_t value) { _internal_set_team_id(value); - // @@protoc_insertion_point(field_set:protobuf.MessageOfCommunity.team_id) + // @@protoc_insertion_point(field_set:protobuf.MessageOfChargeStation.team_id) } // ------------------------------------------------------------------- - // MessageOfFort + // MessageOfSignalTower // int32 x = 1; - inline void MessageOfFort::clear_x() + inline void MessageOfSignalTower::clear_x() { _impl_.x_ = 0; } - inline int32_t MessageOfFort::_internal_x() const + inline int32_t MessageOfSignalTower::_internal_x() const { return _impl_.x_; } - inline int32_t MessageOfFort::x() const + inline int32_t MessageOfSignalTower::x() const { - // @@protoc_insertion_point(field_get:protobuf.MessageOfFort.x) + // @@protoc_insertion_point(field_get:protobuf.MessageOfSignalTower.x) return _internal_x(); } - inline void MessageOfFort::_internal_set_x(int32_t value) + inline void MessageOfSignalTower::_internal_set_x(int32_t value) { _impl_.x_ = value; } - inline void MessageOfFort::set_x(int32_t value) + inline void MessageOfSignalTower::set_x(int32_t value) { _internal_set_x(value); - // @@protoc_insertion_point(field_set:protobuf.MessageOfFort.x) + // @@protoc_insertion_point(field_set:protobuf.MessageOfSignalTower.x) } // int32 y = 2; - inline void MessageOfFort::clear_y() + inline void MessageOfSignalTower::clear_y() { _impl_.y_ = 0; } - inline int32_t MessageOfFort::_internal_y() const + inline int32_t MessageOfSignalTower::_internal_y() const { return _impl_.y_; } - inline int32_t MessageOfFort::y() const + inline int32_t MessageOfSignalTower::y() const { - // @@protoc_insertion_point(field_get:protobuf.MessageOfFort.y) + // @@protoc_insertion_point(field_get:protobuf.MessageOfSignalTower.y) return _internal_y(); } - inline void MessageOfFort::_internal_set_y(int32_t value) + inline void MessageOfSignalTower::_internal_set_y(int32_t value) { _impl_.y_ = value; } - inline void MessageOfFort::set_y(int32_t value) + inline void MessageOfSignalTower::set_y(int32_t value) { _internal_set_y(value); - // @@protoc_insertion_point(field_set:protobuf.MessageOfFort.y) + // @@protoc_insertion_point(field_set:protobuf.MessageOfSignalTower.y) } // int32 hp = 3; - inline void MessageOfFort::clear_hp() + inline void MessageOfSignalTower::clear_hp() { _impl_.hp_ = 0; } - inline int32_t MessageOfFort::_internal_hp() const + inline int32_t MessageOfSignalTower::_internal_hp() const { return _impl_.hp_; } - inline int32_t MessageOfFort::hp() const + inline int32_t MessageOfSignalTower::hp() const { - // @@protoc_insertion_point(field_get:protobuf.MessageOfFort.hp) + // @@protoc_insertion_point(field_get:protobuf.MessageOfSignalTower.hp) return _internal_hp(); } - inline void MessageOfFort::_internal_set_hp(int32_t value) + inline void MessageOfSignalTower::_internal_set_hp(int32_t value) { _impl_.hp_ = value; } - inline void MessageOfFort::set_hp(int32_t value) + inline void MessageOfSignalTower::set_hp(int32_t value) { _internal_set_hp(value); - // @@protoc_insertion_point(field_set:protobuf.MessageOfFort.hp) + // @@protoc_insertion_point(field_set:protobuf.MessageOfSignalTower.hp) } // int64 team_id = 4; - inline void MessageOfFort::clear_team_id() + inline void MessageOfSignalTower::clear_team_id() { _impl_.team_id_ = int64_t{0}; } - inline int64_t MessageOfFort::_internal_team_id() const + inline int64_t MessageOfSignalTower::_internal_team_id() const { return _impl_.team_id_; } - inline int64_t MessageOfFort::team_id() const + inline int64_t MessageOfSignalTower::team_id() const { - // @@protoc_insertion_point(field_get:protobuf.MessageOfFort.team_id) + // @@protoc_insertion_point(field_get:protobuf.MessageOfSignalTower.team_id) return _internal_team_id(); } - inline void MessageOfFort::_internal_set_team_id(int64_t value) + inline void MessageOfSignalTower::_internal_set_team_id(int64_t value) { _impl_.team_id_ = value; } - inline void MessageOfFort::set_team_id(int64_t value) + inline void MessageOfSignalTower::set_team_id(int64_t value) { _internal_set_team_id(value); - // @@protoc_insertion_point(field_set:protobuf.MessageOfFort.team_id) + // @@protoc_insertion_point(field_set:protobuf.MessageOfSignalTower.team_id) } // ------------------------------------------------------------------- - // MessageOfWormhole + // MessageOfBridge // int32 x = 1; - inline void MessageOfWormhole::clear_x() + inline void MessageOfBridge::clear_x() { _impl_.x_ = 0; } - inline int32_t MessageOfWormhole::_internal_x() const + inline int32_t MessageOfBridge::_internal_x() const { return _impl_.x_; } - inline int32_t MessageOfWormhole::x() const + inline int32_t MessageOfBridge::x() const { - // @@protoc_insertion_point(field_get:protobuf.MessageOfWormhole.x) + // @@protoc_insertion_point(field_get:protobuf.MessageOfBridge.x) return _internal_x(); } - inline void MessageOfWormhole::_internal_set_x(int32_t value) + inline void MessageOfBridge::_internal_set_x(int32_t value) { _impl_.x_ = value; } - inline void MessageOfWormhole::set_x(int32_t value) + inline void MessageOfBridge::set_x(int32_t value) { _internal_set_x(value); - // @@protoc_insertion_point(field_set:protobuf.MessageOfWormhole.x) + // @@protoc_insertion_point(field_set:protobuf.MessageOfBridge.x) } // int32 y = 2; - inline void MessageOfWormhole::clear_y() + inline void MessageOfBridge::clear_y() { _impl_.y_ = 0; } - inline int32_t MessageOfWormhole::_internal_y() const + inline int32_t MessageOfBridge::_internal_y() const { return _impl_.y_; } - inline int32_t MessageOfWormhole::y() const + inline int32_t MessageOfBridge::y() const { - // @@protoc_insertion_point(field_get:protobuf.MessageOfWormhole.y) + // @@protoc_insertion_point(field_get:protobuf.MessageOfBridge.y) return _internal_y(); } - inline void MessageOfWormhole::_internal_set_y(int32_t value) + inline void MessageOfBridge::_internal_set_y(int32_t value) { _impl_.y_ = value; } - inline void MessageOfWormhole::set_y(int32_t value) + inline void MessageOfBridge::set_y(int32_t value) { _internal_set_y(value); - // @@protoc_insertion_point(field_set:protobuf.MessageOfWormhole.y) + // @@protoc_insertion_point(field_set:protobuf.MessageOfBridge.y) } // int32 hp = 3; - inline void MessageOfWormhole::clear_hp() + inline void MessageOfBridge::clear_hp() { _impl_.hp_ = 0; } - inline int32_t MessageOfWormhole::_internal_hp() const + inline int32_t MessageOfBridge::_internal_hp() const { return _impl_.hp_; } - inline int32_t MessageOfWormhole::hp() const + inline int32_t MessageOfBridge::hp() const { - // @@protoc_insertion_point(field_get:protobuf.MessageOfWormhole.hp) + // @@protoc_insertion_point(field_get:protobuf.MessageOfBridge.hp) return _internal_hp(); } - inline void MessageOfWormhole::_internal_set_hp(int32_t value) + inline void MessageOfBridge::_internal_set_hp(int32_t value) { _impl_.hp_ = value; } - inline void MessageOfWormhole::set_hp(int32_t value) + inline void MessageOfBridge::set_hp(int32_t value) { _internal_set_hp(value); - // @@protoc_insertion_point(field_set:protobuf.MessageOfWormhole.hp) + // @@protoc_insertion_point(field_set:protobuf.MessageOfBridge.hp) } // ------------------------------------------------------------------- - // MessageOfResource + // MessageOfGarbage // int32 x = 1; - inline void MessageOfResource::clear_x() + inline void MessageOfGarbage::clear_x() { _impl_.x_ = 0; } - inline int32_t MessageOfResource::_internal_x() const + inline int32_t MessageOfGarbage::_internal_x() const { return _impl_.x_; } - inline int32_t MessageOfResource::x() const + inline int32_t MessageOfGarbage::x() const { - // @@protoc_insertion_point(field_get:protobuf.MessageOfResource.x) + // @@protoc_insertion_point(field_get:protobuf.MessageOfGarbage.x) return _internal_x(); } - inline void MessageOfResource::_internal_set_x(int32_t value) + inline void MessageOfGarbage::_internal_set_x(int32_t value) { _impl_.x_ = value; } - inline void MessageOfResource::set_x(int32_t value) + inline void MessageOfGarbage::set_x(int32_t value) { _internal_set_x(value); - // @@protoc_insertion_point(field_set:protobuf.MessageOfResource.x) + // @@protoc_insertion_point(field_set:protobuf.MessageOfGarbage.x) } // int32 y = 2; - inline void MessageOfResource::clear_y() + inline void MessageOfGarbage::clear_y() { _impl_.y_ = 0; } - inline int32_t MessageOfResource::_internal_y() const + inline int32_t MessageOfGarbage::_internal_y() const { return _impl_.y_; } - inline int32_t MessageOfResource::y() const + inline int32_t MessageOfGarbage::y() const { - // @@protoc_insertion_point(field_get:protobuf.MessageOfResource.y) + // @@protoc_insertion_point(field_get:protobuf.MessageOfGarbage.y) return _internal_y(); } - inline void MessageOfResource::_internal_set_y(int32_t value) + inline void MessageOfGarbage::_internal_set_y(int32_t value) { _impl_.y_ = value; } - inline void MessageOfResource::set_y(int32_t value) + inline void MessageOfGarbage::set_y(int32_t value) { _internal_set_y(value); - // @@protoc_insertion_point(field_set:protobuf.MessageOfResource.y) + // @@protoc_insertion_point(field_set:protobuf.MessageOfGarbage.y) } // int32 progress = 3; - inline void MessageOfResource::clear_progress() + inline void MessageOfGarbage::clear_progress() { _impl_.progress_ = 0; } - inline int32_t MessageOfResource::_internal_progress() const + inline int32_t MessageOfGarbage::_internal_progress() const { return _impl_.progress_; } - inline int32_t MessageOfResource::progress() const + inline int32_t MessageOfGarbage::progress() const { - // @@protoc_insertion_point(field_get:protobuf.MessageOfResource.progress) + // @@protoc_insertion_point(field_get:protobuf.MessageOfGarbage.progress) return _internal_progress(); } - inline void MessageOfResource::_internal_set_progress(int32_t value) + inline void MessageOfGarbage::_internal_set_progress(int32_t value) { _impl_.progress_ = value; } - inline void MessageOfResource::set_progress(int32_t value) + inline void MessageOfGarbage::set_progress(int32_t value) { _internal_set_progress(value); - // @@protoc_insertion_point(field_set:protobuf.MessageOfResource.progress) + // @@protoc_insertion_point(field_set:protobuf.MessageOfGarbage.progress) } // ------------------------------------------------------------------- @@ -6864,42 +6864,42 @@ namespace protobuf // MessageOfObj - // .protobuf.MessageOfShip ship_message = 1; - inline bool MessageOfObj::_internal_has_ship_message() const + // .protobuf.MessageOfSweeper sweeper_message = 1; + inline bool MessageOfObj::_internal_has_sweeper_message() const { - return message_of_obj_case() == kShipMessage; + return message_of_obj_case() == kSweeperMessage; } - inline bool MessageOfObj::has_ship_message() const + inline bool MessageOfObj::has_sweeper_message() const { - return _internal_has_ship_message(); + return _internal_has_sweeper_message(); } - inline void MessageOfObj::set_has_ship_message() + inline void MessageOfObj::set_has_sweeper_message() { - _impl_._oneof_case_[0] = kShipMessage; + _impl_._oneof_case_[0] = kSweeperMessage; } - inline void MessageOfObj::clear_ship_message() + inline void MessageOfObj::clear_sweeper_message() { - if (_internal_has_ship_message()) + if (_internal_has_sweeper_message()) { if (GetArenaForAllocation() == nullptr) { - delete _impl_.message_of_obj_.ship_message_; + delete _impl_.message_of_obj_.sweeper_message_; } clear_has_message_of_obj(); } } - inline ::protobuf::MessageOfShip* MessageOfObj::release_ship_message() + inline ::protobuf::MessageOfSweeper* MessageOfObj::release_sweeper_message() { - // @@protoc_insertion_point(field_release:protobuf.MessageOfObj.ship_message) - if (_internal_has_ship_message()) + // @@protoc_insertion_point(field_release:protobuf.MessageOfObj.sweeper_message) + if (_internal_has_sweeper_message()) { clear_has_message_of_obj(); - ::protobuf::MessageOfShip* temp = _impl_.message_of_obj_.ship_message_; + ::protobuf::MessageOfSweeper* temp = _impl_.message_of_obj_.sweeper_message_; if (GetArenaForAllocation() != nullptr) { temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); } - _impl_.message_of_obj_.ship_message_ = nullptr; + _impl_.message_of_obj_.sweeper_message_ = nullptr; return temp; } else @@ -6907,23 +6907,23 @@ namespace protobuf return nullptr; } } - inline const ::protobuf::MessageOfShip& MessageOfObj::_internal_ship_message() const + inline const ::protobuf::MessageOfSweeper& MessageOfObj::_internal_sweeper_message() const { - return _internal_has_ship_message() ? *_impl_.message_of_obj_.ship_message_ : reinterpret_cast<::protobuf::MessageOfShip&>(::protobuf::_MessageOfShip_default_instance_); + return _internal_has_sweeper_message() ? *_impl_.message_of_obj_.sweeper_message_ : reinterpret_cast<::protobuf::MessageOfSweeper&>(::protobuf::_MessageOfSweeper_default_instance_); } - inline const ::protobuf::MessageOfShip& MessageOfObj::ship_message() const + inline const ::protobuf::MessageOfSweeper& MessageOfObj::sweeper_message() const { - // @@protoc_insertion_point(field_get:protobuf.MessageOfObj.ship_message) - return _internal_ship_message(); + // @@protoc_insertion_point(field_get:protobuf.MessageOfObj.sweeper_message) + return _internal_sweeper_message(); } - inline ::protobuf::MessageOfShip* MessageOfObj::unsafe_arena_release_ship_message() + inline ::protobuf::MessageOfSweeper* MessageOfObj::unsafe_arena_release_sweeper_message() { - // @@protoc_insertion_point(field_unsafe_arena_release:protobuf.MessageOfObj.ship_message) - if (_internal_has_ship_message()) + // @@protoc_insertion_point(field_unsafe_arena_release:protobuf.MessageOfObj.sweeper_message) + if (_internal_has_sweeper_message()) { clear_has_message_of_obj(); - ::protobuf::MessageOfShip* temp = _impl_.message_of_obj_.ship_message_; - _impl_.message_of_obj_.ship_message_ = nullptr; + ::protobuf::MessageOfSweeper* temp = _impl_.message_of_obj_.sweeper_message_; + _impl_.message_of_obj_.sweeper_message_ = nullptr; return temp; } else @@ -6931,30 +6931,30 @@ namespace protobuf return nullptr; } } - inline void MessageOfObj::unsafe_arena_set_allocated_ship_message(::protobuf::MessageOfShip* ship_message) + inline void MessageOfObj::unsafe_arena_set_allocated_sweeper_message(::protobuf::MessageOfSweeper* sweeper_message) { clear_message_of_obj(); - if (ship_message) + if (sweeper_message) { - set_has_ship_message(); - _impl_.message_of_obj_.ship_message_ = ship_message; + set_has_sweeper_message(); + _impl_.message_of_obj_.sweeper_message_ = sweeper_message; } - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:protobuf.MessageOfObj.ship_message) + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:protobuf.MessageOfObj.sweeper_message) } - inline ::protobuf::MessageOfShip* MessageOfObj::_internal_mutable_ship_message() + inline ::protobuf::MessageOfSweeper* MessageOfObj::_internal_mutable_sweeper_message() { - if (!_internal_has_ship_message()) + if (!_internal_has_sweeper_message()) { clear_message_of_obj(); - set_has_ship_message(); - _impl_.message_of_obj_.ship_message_ = CreateMaybeMessage<::protobuf::MessageOfShip>(GetArenaForAllocation()); + set_has_sweeper_message(); + _impl_.message_of_obj_.sweeper_message_ = CreateMaybeMessage<::protobuf::MessageOfSweeper>(GetArenaForAllocation()); } - return _impl_.message_of_obj_.ship_message_; + return _impl_.message_of_obj_.sweeper_message_; } - inline ::protobuf::MessageOfShip* MessageOfObj::mutable_ship_message() + inline ::protobuf::MessageOfSweeper* MessageOfObj::mutable_sweeper_message() { - ::protobuf::MessageOfShip* _msg = _internal_mutable_ship_message(); - // @@protoc_insertion_point(field_mutable:protobuf.MessageOfObj.ship_message) + ::protobuf::MessageOfSweeper* _msg = _internal_mutable_sweeper_message(); + // @@protoc_insertion_point(field_mutable:protobuf.MessageOfObj.sweeper_message) return _msg; } @@ -7052,42 +7052,42 @@ namespace protobuf return _msg; } - // .protobuf.MessageOfFactory factory_message = 3; - inline bool MessageOfObj::_internal_has_factory_message() const + // .protobuf.MessageOfRecycleBank recyclebank_message = 3; + inline bool MessageOfObj::_internal_has_recyclebank_message() const { - return message_of_obj_case() == kFactoryMessage; + return message_of_obj_case() == kRecyclebankMessage; } - inline bool MessageOfObj::has_factory_message() const + inline bool MessageOfObj::has_recyclebank_message() const { - return _internal_has_factory_message(); + return _internal_has_recyclebank_message(); } - inline void MessageOfObj::set_has_factory_message() + inline void MessageOfObj::set_has_recyclebank_message() { - _impl_._oneof_case_[0] = kFactoryMessage; + _impl_._oneof_case_[0] = kRecyclebankMessage; } - inline void MessageOfObj::clear_factory_message() + inline void MessageOfObj::clear_recyclebank_message() { - if (_internal_has_factory_message()) + if (_internal_has_recyclebank_message()) { if (GetArenaForAllocation() == nullptr) { - delete _impl_.message_of_obj_.factory_message_; + delete _impl_.message_of_obj_.recyclebank_message_; } clear_has_message_of_obj(); } } - inline ::protobuf::MessageOfFactory* MessageOfObj::release_factory_message() + inline ::protobuf::MessageOfRecycleBank* MessageOfObj::release_recyclebank_message() { - // @@protoc_insertion_point(field_release:protobuf.MessageOfObj.factory_message) - if (_internal_has_factory_message()) + // @@protoc_insertion_point(field_release:protobuf.MessageOfObj.recyclebank_message) + if (_internal_has_recyclebank_message()) { clear_has_message_of_obj(); - ::protobuf::MessageOfFactory* temp = _impl_.message_of_obj_.factory_message_; + ::protobuf::MessageOfRecycleBank* temp = _impl_.message_of_obj_.recyclebank_message_; if (GetArenaForAllocation() != nullptr) { temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); } - _impl_.message_of_obj_.factory_message_ = nullptr; + _impl_.message_of_obj_.recyclebank_message_ = nullptr; return temp; } else @@ -7095,23 +7095,23 @@ namespace protobuf return nullptr; } } - inline const ::protobuf::MessageOfFactory& MessageOfObj::_internal_factory_message() const + inline const ::protobuf::MessageOfRecycleBank& MessageOfObj::_internal_recyclebank_message() const { - return _internal_has_factory_message() ? *_impl_.message_of_obj_.factory_message_ : reinterpret_cast<::protobuf::MessageOfFactory&>(::protobuf::_MessageOfFactory_default_instance_); + return _internal_has_recyclebank_message() ? *_impl_.message_of_obj_.recyclebank_message_ : reinterpret_cast<::protobuf::MessageOfRecycleBank&>(::protobuf::_MessageOfRecycleBank_default_instance_); } - inline const ::protobuf::MessageOfFactory& MessageOfObj::factory_message() const + inline const ::protobuf::MessageOfRecycleBank& MessageOfObj::recyclebank_message() const { - // @@protoc_insertion_point(field_get:protobuf.MessageOfObj.factory_message) - return _internal_factory_message(); + // @@protoc_insertion_point(field_get:protobuf.MessageOfObj.recyclebank_message) + return _internal_recyclebank_message(); } - inline ::protobuf::MessageOfFactory* MessageOfObj::unsafe_arena_release_factory_message() + inline ::protobuf::MessageOfRecycleBank* MessageOfObj::unsafe_arena_release_recyclebank_message() { - // @@protoc_insertion_point(field_unsafe_arena_release:protobuf.MessageOfObj.factory_message) - if (_internal_has_factory_message()) + // @@protoc_insertion_point(field_unsafe_arena_release:protobuf.MessageOfObj.recyclebank_message) + if (_internal_has_recyclebank_message()) { clear_has_message_of_obj(); - ::protobuf::MessageOfFactory* temp = _impl_.message_of_obj_.factory_message_; - _impl_.message_of_obj_.factory_message_ = nullptr; + ::protobuf::MessageOfRecycleBank* temp = _impl_.message_of_obj_.recyclebank_message_; + _impl_.message_of_obj_.recyclebank_message_ = nullptr; return temp; } else @@ -7119,69 +7119,69 @@ namespace protobuf return nullptr; } } - inline void MessageOfObj::unsafe_arena_set_allocated_factory_message(::protobuf::MessageOfFactory* factory_message) + inline void MessageOfObj::unsafe_arena_set_allocated_recyclebank_message(::protobuf::MessageOfRecycleBank* recyclebank_message) { clear_message_of_obj(); - if (factory_message) + if (recyclebank_message) { - set_has_factory_message(); - _impl_.message_of_obj_.factory_message_ = factory_message; + set_has_recyclebank_message(); + _impl_.message_of_obj_.recyclebank_message_ = recyclebank_message; } - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:protobuf.MessageOfObj.factory_message) + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:protobuf.MessageOfObj.recyclebank_message) } - inline ::protobuf::MessageOfFactory* MessageOfObj::_internal_mutable_factory_message() + inline ::protobuf::MessageOfRecycleBank* MessageOfObj::_internal_mutable_recyclebank_message() { - if (!_internal_has_factory_message()) + if (!_internal_has_recyclebank_message()) { clear_message_of_obj(); - set_has_factory_message(); - _impl_.message_of_obj_.factory_message_ = CreateMaybeMessage<::protobuf::MessageOfFactory>(GetArenaForAllocation()); + set_has_recyclebank_message(); + _impl_.message_of_obj_.recyclebank_message_ = CreateMaybeMessage<::protobuf::MessageOfRecycleBank>(GetArenaForAllocation()); } - return _impl_.message_of_obj_.factory_message_; + return _impl_.message_of_obj_.recyclebank_message_; } - inline ::protobuf::MessageOfFactory* MessageOfObj::mutable_factory_message() + inline ::protobuf::MessageOfRecycleBank* MessageOfObj::mutable_recyclebank_message() { - ::protobuf::MessageOfFactory* _msg = _internal_mutable_factory_message(); - // @@protoc_insertion_point(field_mutable:protobuf.MessageOfObj.factory_message) + ::protobuf::MessageOfRecycleBank* _msg = _internal_mutable_recyclebank_message(); + // @@protoc_insertion_point(field_mutable:protobuf.MessageOfObj.recyclebank_message) return _msg; } - // .protobuf.MessageOfCommunity community_message = 4; - inline bool MessageOfObj::_internal_has_community_message() const + // .protobuf.MessageOfChargeStation chargestation_message = 4; + inline bool MessageOfObj::_internal_has_chargestation_message() const { - return message_of_obj_case() == kCommunityMessage; + return message_of_obj_case() == kChargestationMessage; } - inline bool MessageOfObj::has_community_message() const + inline bool MessageOfObj::has_chargestation_message() const { - return _internal_has_community_message(); + return _internal_has_chargestation_message(); } - inline void MessageOfObj::set_has_community_message() + inline void MessageOfObj::set_has_chargestation_message() { - _impl_._oneof_case_[0] = kCommunityMessage; + _impl_._oneof_case_[0] = kChargestationMessage; } - inline void MessageOfObj::clear_community_message() + inline void MessageOfObj::clear_chargestation_message() { - if (_internal_has_community_message()) + if (_internal_has_chargestation_message()) { if (GetArenaForAllocation() == nullptr) { - delete _impl_.message_of_obj_.community_message_; + delete _impl_.message_of_obj_.chargestation_message_; } clear_has_message_of_obj(); } } - inline ::protobuf::MessageOfCommunity* MessageOfObj::release_community_message() + inline ::protobuf::MessageOfChargeStation* MessageOfObj::release_chargestation_message() { - // @@protoc_insertion_point(field_release:protobuf.MessageOfObj.community_message) - if (_internal_has_community_message()) + // @@protoc_insertion_point(field_release:protobuf.MessageOfObj.chargestation_message) + if (_internal_has_chargestation_message()) { clear_has_message_of_obj(); - ::protobuf::MessageOfCommunity* temp = _impl_.message_of_obj_.community_message_; + ::protobuf::MessageOfChargeStation* temp = _impl_.message_of_obj_.chargestation_message_; if (GetArenaForAllocation() != nullptr) { temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); } - _impl_.message_of_obj_.community_message_ = nullptr; + _impl_.message_of_obj_.chargestation_message_ = nullptr; return temp; } else @@ -7189,23 +7189,23 @@ namespace protobuf return nullptr; } } - inline const ::protobuf::MessageOfCommunity& MessageOfObj::_internal_community_message() const + inline const ::protobuf::MessageOfChargeStation& MessageOfObj::_internal_chargestation_message() const { - return _internal_has_community_message() ? *_impl_.message_of_obj_.community_message_ : reinterpret_cast<::protobuf::MessageOfCommunity&>(::protobuf::_MessageOfCommunity_default_instance_); + return _internal_has_chargestation_message() ? *_impl_.message_of_obj_.chargestation_message_ : reinterpret_cast<::protobuf::MessageOfChargeStation&>(::protobuf::_MessageOfChargeStation_default_instance_); } - inline const ::protobuf::MessageOfCommunity& MessageOfObj::community_message() const + inline const ::protobuf::MessageOfChargeStation& MessageOfObj::chargestation_message() const { - // @@protoc_insertion_point(field_get:protobuf.MessageOfObj.community_message) - return _internal_community_message(); + // @@protoc_insertion_point(field_get:protobuf.MessageOfObj.chargestation_message) + return _internal_chargestation_message(); } - inline ::protobuf::MessageOfCommunity* MessageOfObj::unsafe_arena_release_community_message() + inline ::protobuf::MessageOfChargeStation* MessageOfObj::unsafe_arena_release_chargestation_message() { - // @@protoc_insertion_point(field_unsafe_arena_release:protobuf.MessageOfObj.community_message) - if (_internal_has_community_message()) + // @@protoc_insertion_point(field_unsafe_arena_release:protobuf.MessageOfObj.chargestation_message) + if (_internal_has_chargestation_message()) { clear_has_message_of_obj(); - ::protobuf::MessageOfCommunity* temp = _impl_.message_of_obj_.community_message_; - _impl_.message_of_obj_.community_message_ = nullptr; + ::protobuf::MessageOfChargeStation* temp = _impl_.message_of_obj_.chargestation_message_; + _impl_.message_of_obj_.chargestation_message_ = nullptr; return temp; } else @@ -7213,69 +7213,69 @@ namespace protobuf return nullptr; } } - inline void MessageOfObj::unsafe_arena_set_allocated_community_message(::protobuf::MessageOfCommunity* community_message) + inline void MessageOfObj::unsafe_arena_set_allocated_chargestation_message(::protobuf::MessageOfChargeStation* chargestation_message) { clear_message_of_obj(); - if (community_message) + if (chargestation_message) { - set_has_community_message(); - _impl_.message_of_obj_.community_message_ = community_message; + set_has_chargestation_message(); + _impl_.message_of_obj_.chargestation_message_ = chargestation_message; } - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:protobuf.MessageOfObj.community_message) + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:protobuf.MessageOfObj.chargestation_message) } - inline ::protobuf::MessageOfCommunity* MessageOfObj::_internal_mutable_community_message() + inline ::protobuf::MessageOfChargeStation* MessageOfObj::_internal_mutable_chargestation_message() { - if (!_internal_has_community_message()) + if (!_internal_has_chargestation_message()) { clear_message_of_obj(); - set_has_community_message(); - _impl_.message_of_obj_.community_message_ = CreateMaybeMessage<::protobuf::MessageOfCommunity>(GetArenaForAllocation()); + set_has_chargestation_message(); + _impl_.message_of_obj_.chargestation_message_ = CreateMaybeMessage<::protobuf::MessageOfChargeStation>(GetArenaForAllocation()); } - return _impl_.message_of_obj_.community_message_; + return _impl_.message_of_obj_.chargestation_message_; } - inline ::protobuf::MessageOfCommunity* MessageOfObj::mutable_community_message() + inline ::protobuf::MessageOfChargeStation* MessageOfObj::mutable_chargestation_message() { - ::protobuf::MessageOfCommunity* _msg = _internal_mutable_community_message(); - // @@protoc_insertion_point(field_mutable:protobuf.MessageOfObj.community_message) + ::protobuf::MessageOfChargeStation* _msg = _internal_mutable_chargestation_message(); + // @@protoc_insertion_point(field_mutable:protobuf.MessageOfObj.chargestation_message) return _msg; } - // .protobuf.MessageOfFort fort_message = 5; - inline bool MessageOfObj::_internal_has_fort_message() const + // .protobuf.MessageOfSignalTower signaltower_message = 5; + inline bool MessageOfObj::_internal_has_signaltower_message() const { - return message_of_obj_case() == kFortMessage; + return message_of_obj_case() == kSignaltowerMessage; } - inline bool MessageOfObj::has_fort_message() const + inline bool MessageOfObj::has_signaltower_message() const { - return _internal_has_fort_message(); + return _internal_has_signaltower_message(); } - inline void MessageOfObj::set_has_fort_message() + inline void MessageOfObj::set_has_signaltower_message() { - _impl_._oneof_case_[0] = kFortMessage; + _impl_._oneof_case_[0] = kSignaltowerMessage; } - inline void MessageOfObj::clear_fort_message() + inline void MessageOfObj::clear_signaltower_message() { - if (_internal_has_fort_message()) + if (_internal_has_signaltower_message()) { if (GetArenaForAllocation() == nullptr) { - delete _impl_.message_of_obj_.fort_message_; + delete _impl_.message_of_obj_.signaltower_message_; } clear_has_message_of_obj(); } } - inline ::protobuf::MessageOfFort* MessageOfObj::release_fort_message() + inline ::protobuf::MessageOfSignalTower* MessageOfObj::release_signaltower_message() { - // @@protoc_insertion_point(field_release:protobuf.MessageOfObj.fort_message) - if (_internal_has_fort_message()) + // @@protoc_insertion_point(field_release:protobuf.MessageOfObj.signaltower_message) + if (_internal_has_signaltower_message()) { clear_has_message_of_obj(); - ::protobuf::MessageOfFort* temp = _impl_.message_of_obj_.fort_message_; + ::protobuf::MessageOfSignalTower* temp = _impl_.message_of_obj_.signaltower_message_; if (GetArenaForAllocation() != nullptr) { temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); } - _impl_.message_of_obj_.fort_message_ = nullptr; + _impl_.message_of_obj_.signaltower_message_ = nullptr; return temp; } else @@ -7283,23 +7283,23 @@ namespace protobuf return nullptr; } } - inline const ::protobuf::MessageOfFort& MessageOfObj::_internal_fort_message() const + inline const ::protobuf::MessageOfSignalTower& MessageOfObj::_internal_signaltower_message() const { - return _internal_has_fort_message() ? *_impl_.message_of_obj_.fort_message_ : reinterpret_cast<::protobuf::MessageOfFort&>(::protobuf::_MessageOfFort_default_instance_); + return _internal_has_signaltower_message() ? *_impl_.message_of_obj_.signaltower_message_ : reinterpret_cast<::protobuf::MessageOfSignalTower&>(::protobuf::_MessageOfSignalTower_default_instance_); } - inline const ::protobuf::MessageOfFort& MessageOfObj::fort_message() const + inline const ::protobuf::MessageOfSignalTower& MessageOfObj::signaltower_message() const { - // @@protoc_insertion_point(field_get:protobuf.MessageOfObj.fort_message) - return _internal_fort_message(); + // @@protoc_insertion_point(field_get:protobuf.MessageOfObj.signaltower_message) + return _internal_signaltower_message(); } - inline ::protobuf::MessageOfFort* MessageOfObj::unsafe_arena_release_fort_message() + inline ::protobuf::MessageOfSignalTower* MessageOfObj::unsafe_arena_release_signaltower_message() { - // @@protoc_insertion_point(field_unsafe_arena_release:protobuf.MessageOfObj.fort_message) - if (_internal_has_fort_message()) + // @@protoc_insertion_point(field_unsafe_arena_release:protobuf.MessageOfObj.signaltower_message) + if (_internal_has_signaltower_message()) { clear_has_message_of_obj(); - ::protobuf::MessageOfFort* temp = _impl_.message_of_obj_.fort_message_; - _impl_.message_of_obj_.fort_message_ = nullptr; + ::protobuf::MessageOfSignalTower* temp = _impl_.message_of_obj_.signaltower_message_; + _impl_.message_of_obj_.signaltower_message_ = nullptr; return temp; } else @@ -7307,69 +7307,69 @@ namespace protobuf return nullptr; } } - inline void MessageOfObj::unsafe_arena_set_allocated_fort_message(::protobuf::MessageOfFort* fort_message) + inline void MessageOfObj::unsafe_arena_set_allocated_signaltower_message(::protobuf::MessageOfSignalTower* signaltower_message) { clear_message_of_obj(); - if (fort_message) + if (signaltower_message) { - set_has_fort_message(); - _impl_.message_of_obj_.fort_message_ = fort_message; + set_has_signaltower_message(); + _impl_.message_of_obj_.signaltower_message_ = signaltower_message; } - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:protobuf.MessageOfObj.fort_message) + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:protobuf.MessageOfObj.signaltower_message) } - inline ::protobuf::MessageOfFort* MessageOfObj::_internal_mutable_fort_message() + inline ::protobuf::MessageOfSignalTower* MessageOfObj::_internal_mutable_signaltower_message() { - if (!_internal_has_fort_message()) + if (!_internal_has_signaltower_message()) { clear_message_of_obj(); - set_has_fort_message(); - _impl_.message_of_obj_.fort_message_ = CreateMaybeMessage<::protobuf::MessageOfFort>(GetArenaForAllocation()); + set_has_signaltower_message(); + _impl_.message_of_obj_.signaltower_message_ = CreateMaybeMessage<::protobuf::MessageOfSignalTower>(GetArenaForAllocation()); } - return _impl_.message_of_obj_.fort_message_; + return _impl_.message_of_obj_.signaltower_message_; } - inline ::protobuf::MessageOfFort* MessageOfObj::mutable_fort_message() + inline ::protobuf::MessageOfSignalTower* MessageOfObj::mutable_signaltower_message() { - ::protobuf::MessageOfFort* _msg = _internal_mutable_fort_message(); - // @@protoc_insertion_point(field_mutable:protobuf.MessageOfObj.fort_message) + ::protobuf::MessageOfSignalTower* _msg = _internal_mutable_signaltower_message(); + // @@protoc_insertion_point(field_mutable:protobuf.MessageOfObj.signaltower_message) return _msg; } - // .protobuf.MessageOfWormhole wormhole_message = 6; - inline bool MessageOfObj::_internal_has_wormhole_message() const + // .protobuf.MessageOfBridge bridge_message = 6; + inline bool MessageOfObj::_internal_has_bridge_message() const { - return message_of_obj_case() == kWormholeMessage; + return message_of_obj_case() == kBridgeMessage; } - inline bool MessageOfObj::has_wormhole_message() const + inline bool MessageOfObj::has_bridge_message() const { - return _internal_has_wormhole_message(); + return _internal_has_bridge_message(); } - inline void MessageOfObj::set_has_wormhole_message() + inline void MessageOfObj::set_has_bridge_message() { - _impl_._oneof_case_[0] = kWormholeMessage; + _impl_._oneof_case_[0] = kBridgeMessage; } - inline void MessageOfObj::clear_wormhole_message() + inline void MessageOfObj::clear_bridge_message() { - if (_internal_has_wormhole_message()) + if (_internal_has_bridge_message()) { if (GetArenaForAllocation() == nullptr) { - delete _impl_.message_of_obj_.wormhole_message_; + delete _impl_.message_of_obj_.bridge_message_; } clear_has_message_of_obj(); } } - inline ::protobuf::MessageOfWormhole* MessageOfObj::release_wormhole_message() + inline ::protobuf::MessageOfBridge* MessageOfObj::release_bridge_message() { - // @@protoc_insertion_point(field_release:protobuf.MessageOfObj.wormhole_message) - if (_internal_has_wormhole_message()) + // @@protoc_insertion_point(field_release:protobuf.MessageOfObj.bridge_message) + if (_internal_has_bridge_message()) { clear_has_message_of_obj(); - ::protobuf::MessageOfWormhole* temp = _impl_.message_of_obj_.wormhole_message_; + ::protobuf::MessageOfBridge* temp = _impl_.message_of_obj_.bridge_message_; if (GetArenaForAllocation() != nullptr) { temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); } - _impl_.message_of_obj_.wormhole_message_ = nullptr; + _impl_.message_of_obj_.bridge_message_ = nullptr; return temp; } else @@ -7377,23 +7377,23 @@ namespace protobuf return nullptr; } } - inline const ::protobuf::MessageOfWormhole& MessageOfObj::_internal_wormhole_message() const + inline const ::protobuf::MessageOfBridge& MessageOfObj::_internal_bridge_message() const { - return _internal_has_wormhole_message() ? *_impl_.message_of_obj_.wormhole_message_ : reinterpret_cast<::protobuf::MessageOfWormhole&>(::protobuf::_MessageOfWormhole_default_instance_); + return _internal_has_bridge_message() ? *_impl_.message_of_obj_.bridge_message_ : reinterpret_cast<::protobuf::MessageOfBridge&>(::protobuf::_MessageOfBridge_default_instance_); } - inline const ::protobuf::MessageOfWormhole& MessageOfObj::wormhole_message() const + inline const ::protobuf::MessageOfBridge& MessageOfObj::bridge_message() const { - // @@protoc_insertion_point(field_get:protobuf.MessageOfObj.wormhole_message) - return _internal_wormhole_message(); + // @@protoc_insertion_point(field_get:protobuf.MessageOfObj.bridge_message) + return _internal_bridge_message(); } - inline ::protobuf::MessageOfWormhole* MessageOfObj::unsafe_arena_release_wormhole_message() + inline ::protobuf::MessageOfBridge* MessageOfObj::unsafe_arena_release_bridge_message() { - // @@protoc_insertion_point(field_unsafe_arena_release:protobuf.MessageOfObj.wormhole_message) - if (_internal_has_wormhole_message()) + // @@protoc_insertion_point(field_unsafe_arena_release:protobuf.MessageOfObj.bridge_message) + if (_internal_has_bridge_message()) { clear_has_message_of_obj(); - ::protobuf::MessageOfWormhole* temp = _impl_.message_of_obj_.wormhole_message_; - _impl_.message_of_obj_.wormhole_message_ = nullptr; + ::protobuf::MessageOfBridge* temp = _impl_.message_of_obj_.bridge_message_; + _impl_.message_of_obj_.bridge_message_ = nullptr; return temp; } else @@ -7401,30 +7401,30 @@ namespace protobuf return nullptr; } } - inline void MessageOfObj::unsafe_arena_set_allocated_wormhole_message(::protobuf::MessageOfWormhole* wormhole_message) + inline void MessageOfObj::unsafe_arena_set_allocated_bridge_message(::protobuf::MessageOfBridge* bridge_message) { clear_message_of_obj(); - if (wormhole_message) + if (bridge_message) { - set_has_wormhole_message(); - _impl_.message_of_obj_.wormhole_message_ = wormhole_message; + set_has_bridge_message(); + _impl_.message_of_obj_.bridge_message_ = bridge_message; } - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:protobuf.MessageOfObj.wormhole_message) + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:protobuf.MessageOfObj.bridge_message) } - inline ::protobuf::MessageOfWormhole* MessageOfObj::_internal_mutable_wormhole_message() + inline ::protobuf::MessageOfBridge* MessageOfObj::_internal_mutable_bridge_message() { - if (!_internal_has_wormhole_message()) + if (!_internal_has_bridge_message()) { clear_message_of_obj(); - set_has_wormhole_message(); - _impl_.message_of_obj_.wormhole_message_ = CreateMaybeMessage<::protobuf::MessageOfWormhole>(GetArenaForAllocation()); + set_has_bridge_message(); + _impl_.message_of_obj_.bridge_message_ = CreateMaybeMessage<::protobuf::MessageOfBridge>(GetArenaForAllocation()); } - return _impl_.message_of_obj_.wormhole_message_; + return _impl_.message_of_obj_.bridge_message_; } - inline ::protobuf::MessageOfWormhole* MessageOfObj::mutable_wormhole_message() + inline ::protobuf::MessageOfBridge* MessageOfObj::mutable_bridge_message() { - ::protobuf::MessageOfWormhole* _msg = _internal_mutable_wormhole_message(); - // @@protoc_insertion_point(field_mutable:protobuf.MessageOfObj.wormhole_message) + ::protobuf::MessageOfBridge* _msg = _internal_mutable_bridge_message(); + // @@protoc_insertion_point(field_mutable:protobuf.MessageOfObj.bridge_message) return _msg; } @@ -7522,42 +7522,42 @@ namespace protobuf return _msg; } - // .protobuf.MessageOfResource resource_message = 8; - inline bool MessageOfObj::_internal_has_resource_message() const + // .protobuf.MessageOfGarbage garbage_message = 8; + inline bool MessageOfObj::_internal_has_garbage_message() const { - return message_of_obj_case() == kResourceMessage; + return message_of_obj_case() == kGarbageMessage; } - inline bool MessageOfObj::has_resource_message() const + inline bool MessageOfObj::has_garbage_message() const { - return _internal_has_resource_message(); + return _internal_has_garbage_message(); } - inline void MessageOfObj::set_has_resource_message() + inline void MessageOfObj::set_has_garbage_message() { - _impl_._oneof_case_[0] = kResourceMessage; + _impl_._oneof_case_[0] = kGarbageMessage; } - inline void MessageOfObj::clear_resource_message() + inline void MessageOfObj::clear_garbage_message() { - if (_internal_has_resource_message()) + if (_internal_has_garbage_message()) { if (GetArenaForAllocation() == nullptr) { - delete _impl_.message_of_obj_.resource_message_; + delete _impl_.message_of_obj_.garbage_message_; } clear_has_message_of_obj(); } } - inline ::protobuf::MessageOfResource* MessageOfObj::release_resource_message() + inline ::protobuf::MessageOfGarbage* MessageOfObj::release_garbage_message() { - // @@protoc_insertion_point(field_release:protobuf.MessageOfObj.resource_message) - if (_internal_has_resource_message()) + // @@protoc_insertion_point(field_release:protobuf.MessageOfObj.garbage_message) + if (_internal_has_garbage_message()) { clear_has_message_of_obj(); - ::protobuf::MessageOfResource* temp = _impl_.message_of_obj_.resource_message_; + ::protobuf::MessageOfGarbage* temp = _impl_.message_of_obj_.garbage_message_; if (GetArenaForAllocation() != nullptr) { temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); } - _impl_.message_of_obj_.resource_message_ = nullptr; + _impl_.message_of_obj_.garbage_message_ = nullptr; return temp; } else @@ -7565,23 +7565,23 @@ namespace protobuf return nullptr; } } - inline const ::protobuf::MessageOfResource& MessageOfObj::_internal_resource_message() const + inline const ::protobuf::MessageOfGarbage& MessageOfObj::_internal_garbage_message() const { - return _internal_has_resource_message() ? *_impl_.message_of_obj_.resource_message_ : reinterpret_cast<::protobuf::MessageOfResource&>(::protobuf::_MessageOfResource_default_instance_); + return _internal_has_garbage_message() ? *_impl_.message_of_obj_.garbage_message_ : reinterpret_cast<::protobuf::MessageOfGarbage&>(::protobuf::_MessageOfGarbage_default_instance_); } - inline const ::protobuf::MessageOfResource& MessageOfObj::resource_message() const + inline const ::protobuf::MessageOfGarbage& MessageOfObj::garbage_message() const { - // @@protoc_insertion_point(field_get:protobuf.MessageOfObj.resource_message) - return _internal_resource_message(); + // @@protoc_insertion_point(field_get:protobuf.MessageOfObj.garbage_message) + return _internal_garbage_message(); } - inline ::protobuf::MessageOfResource* MessageOfObj::unsafe_arena_release_resource_message() + inline ::protobuf::MessageOfGarbage* MessageOfObj::unsafe_arena_release_garbage_message() { - // @@protoc_insertion_point(field_unsafe_arena_release:protobuf.MessageOfObj.resource_message) - if (_internal_has_resource_message()) + // @@protoc_insertion_point(field_unsafe_arena_release:protobuf.MessageOfObj.garbage_message) + if (_internal_has_garbage_message()) { clear_has_message_of_obj(); - ::protobuf::MessageOfResource* temp = _impl_.message_of_obj_.resource_message_; - _impl_.message_of_obj_.resource_message_ = nullptr; + ::protobuf::MessageOfGarbage* temp = _impl_.message_of_obj_.garbage_message_; + _impl_.message_of_obj_.garbage_message_ = nullptr; return temp; } else @@ -7589,30 +7589,30 @@ namespace protobuf return nullptr; } } - inline void MessageOfObj::unsafe_arena_set_allocated_resource_message(::protobuf::MessageOfResource* resource_message) + inline void MessageOfObj::unsafe_arena_set_allocated_garbage_message(::protobuf::MessageOfGarbage* garbage_message) { clear_message_of_obj(); - if (resource_message) + if (garbage_message) { - set_has_resource_message(); - _impl_.message_of_obj_.resource_message_ = resource_message; + set_has_garbage_message(); + _impl_.message_of_obj_.garbage_message_ = garbage_message; } - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:protobuf.MessageOfObj.resource_message) + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:protobuf.MessageOfObj.garbage_message) } - inline ::protobuf::MessageOfResource* MessageOfObj::_internal_mutable_resource_message() + inline ::protobuf::MessageOfGarbage* MessageOfObj::_internal_mutable_garbage_message() { - if (!_internal_has_resource_message()) + if (!_internal_has_garbage_message()) { clear_message_of_obj(); - set_has_resource_message(); - _impl_.message_of_obj_.resource_message_ = CreateMaybeMessage<::protobuf::MessageOfResource>(GetArenaForAllocation()); + set_has_garbage_message(); + _impl_.message_of_obj_.garbage_message_ = CreateMaybeMessage<::protobuf::MessageOfGarbage>(GetArenaForAllocation()); } - return _impl_.message_of_obj_.resource_message_; + return _impl_.message_of_obj_.garbage_message_; } - inline ::protobuf::MessageOfResource* MessageOfObj::mutable_resource_message() + inline ::protobuf::MessageOfGarbage* MessageOfObj::mutable_garbage_message() { - ::protobuf::MessageOfResource* _msg = _internal_mutable_resource_message(); - // @@protoc_insertion_point(field_mutable:protobuf.MessageOfObj.resource_message) + ::protobuf::MessageOfGarbage* _msg = _internal_mutable_garbage_message(); + // @@protoc_insertion_point(field_mutable:protobuf.MessageOfObj.garbage_message) return _msg; } @@ -8471,56 +8471,56 @@ namespace protobuf // ------------------------------------------------------------------- - // ShipInfoRes + // SweeperInfoRes - // repeated .protobuf.MessageOfShip ship_info = 1; - inline int ShipInfoRes::_internal_ship_info_size() const + // repeated .protobuf.MessageOfSweeper sweeper_info = 1; + inline int SweeperInfoRes::_internal_sweeper_info_size() const { - return _impl_.ship_info_.size(); + return _impl_.sweeper_info_.size(); } - inline int ShipInfoRes::ship_info_size() const + inline int SweeperInfoRes::sweeper_info_size() const { - return _internal_ship_info_size(); + return _internal_sweeper_info_size(); } - inline void ShipInfoRes::clear_ship_info() + inline void SweeperInfoRes::clear_sweeper_info() { - _impl_.ship_info_.Clear(); + _impl_.sweeper_info_.Clear(); } - inline ::protobuf::MessageOfShip* ShipInfoRes::mutable_ship_info(int index) + inline ::protobuf::MessageOfSweeper* SweeperInfoRes::mutable_sweeper_info(int index) { - // @@protoc_insertion_point(field_mutable:protobuf.ShipInfoRes.ship_info) - return _impl_.ship_info_.Mutable(index); + // @@protoc_insertion_point(field_mutable:protobuf.SweeperInfoRes.sweeper_info) + return _impl_.sweeper_info_.Mutable(index); } - inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<::protobuf::MessageOfShip>* - ShipInfoRes::mutable_ship_info() + inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<::protobuf::MessageOfSweeper>* + SweeperInfoRes::mutable_sweeper_info() { - // @@protoc_insertion_point(field_mutable_list:protobuf.ShipInfoRes.ship_info) - return &_impl_.ship_info_; + // @@protoc_insertion_point(field_mutable_list:protobuf.SweeperInfoRes.sweeper_info) + return &_impl_.sweeper_info_; } - inline const ::protobuf::MessageOfShip& ShipInfoRes::_internal_ship_info(int index) const + inline const ::protobuf::MessageOfSweeper& SweeperInfoRes::_internal_sweeper_info(int index) const { - return _impl_.ship_info_.Get(index); + return _impl_.sweeper_info_.Get(index); } - inline const ::protobuf::MessageOfShip& ShipInfoRes::ship_info(int index) const + inline const ::protobuf::MessageOfSweeper& SweeperInfoRes::sweeper_info(int index) const { - // @@protoc_insertion_point(field_get:protobuf.ShipInfoRes.ship_info) - return _internal_ship_info(index); + // @@protoc_insertion_point(field_get:protobuf.SweeperInfoRes.sweeper_info) + return _internal_sweeper_info(index); } - inline ::protobuf::MessageOfShip* ShipInfoRes::_internal_add_ship_info() + inline ::protobuf::MessageOfSweeper* SweeperInfoRes::_internal_add_sweeper_info() { - return _impl_.ship_info_.Add(); + return _impl_.sweeper_info_.Add(); } - inline ::protobuf::MessageOfShip* ShipInfoRes::add_ship_info() + inline ::protobuf::MessageOfSweeper* SweeperInfoRes::add_sweeper_info() { - ::protobuf::MessageOfShip* _add = _internal_add_ship_info(); - // @@protoc_insertion_point(field_add:protobuf.ShipInfoRes.ship_info) + ::protobuf::MessageOfSweeper* _add = _internal_add_sweeper_info(); + // @@protoc_insertion_point(field_add:protobuf.SweeperInfoRes.sweeper_info) return _add; } - inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<::protobuf::MessageOfShip>& - ShipInfoRes::ship_info() const + inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<::protobuf::MessageOfSweeper>& + SweeperInfoRes::sweeper_info() const { - // @@protoc_insertion_point(field_list:protobuf.ShipInfoRes.ship_info) - return _impl_.ship_info_; + // @@protoc_insertion_point(field_list:protobuf.SweeperInfoRes.sweeper_info) + return _impl_.sweeper_info_; } // ------------------------------------------------------------------- diff --git a/CAPI/cpp/proto/Message2Server.pb.cc b/CAPI/cpp/proto/Message2Server.pb.cc index de7eb835..ddebc09b 100644 --- a/CAPI/cpp/proto/Message2Server.pb.cc +++ b/CAPI/cpp/proto/Message2Server.pb.cc @@ -68,7 +68,7 @@ namespace protobuf ::_pbi::ConstantInitialized ) : _impl_{ - /*decltype(_impl_.player_id_)*/ int64_t{0}, /*decltype(_impl_.team_id_)*/ int64_t{0}, /*decltype(_impl_.ship_type_)*/ 0, /*decltype(_impl_.x_)*/ 0, /*decltype(_impl_.y_)*/ 0, /*decltype(_impl_._cached_size_)*/ {}} + /*decltype(_impl_.player_id_)*/ int64_t{0}, /*decltype(_impl_.team_id_)*/ int64_t{0}, /*decltype(_impl_.sweeper_type_)*/ 0, /*decltype(_impl_.x_)*/ 0, /*decltype(_impl_.y_)*/ 0, /*decltype(_impl_._cached_size_)*/ {}} { } struct PlayerMsgDefaultTypeInternal @@ -218,28 +218,28 @@ namespace protobuf }; }; PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 InstallMsgDefaultTypeInternal _InstallMsg_default_instance_; - PROTOBUF_CONSTEXPR BuildShipMsg::BuildShipMsg( + PROTOBUF_CONSTEXPR BuildSweeperMsg::BuildSweeperMsg( ::_pbi::ConstantInitialized ) : _impl_{ - /*decltype(_impl_.x_)*/ 0, /*decltype(_impl_.y_)*/ 0, /*decltype(_impl_.team_id_)*/ int64_t{0}, /*decltype(_impl_.ship_type_)*/ 0, /*decltype(_impl_._cached_size_)*/ {}} + /*decltype(_impl_.x_)*/ 0, /*decltype(_impl_.y_)*/ 0, /*decltype(_impl_.team_id_)*/ int64_t{0}, /*decltype(_impl_.sweeper_type_)*/ 0, /*decltype(_impl_._cached_size_)*/ {}} { } - struct BuildShipMsgDefaultTypeInternal + struct BuildSweeperMsgDefaultTypeInternal { - PROTOBUF_CONSTEXPR BuildShipMsgDefaultTypeInternal() : + PROTOBUF_CONSTEXPR BuildSweeperMsgDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) { } - ~BuildShipMsgDefaultTypeInternal() + ~BuildSweeperMsgDefaultTypeInternal() { } union { - BuildShipMsg _instance; + BuildSweeperMsg _instance; }; }; - PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 BuildShipMsgDefaultTypeInternal _BuildShipMsg_default_instance_; + PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 BuildSweeperMsgDefaultTypeInternal _BuildSweeperMsg_default_instance_; } // namespace protobuf static ::_pb::Metadata file_level_metadata_Message2Server_2eproto[10]; static constexpr ::_pb::EnumDescriptor const** file_level_enum_descriptors_Message2Server_2eproto = nullptr; @@ -268,7 +268,7 @@ const uint32_t TableStruct_Message2Server_2eproto::offsets[] PROTOBUF_SECTION_VA ~0u, // no _inlined_string_donated_ PROTOBUF_FIELD_OFFSET(::protobuf::PlayerMsg, _impl_.player_id_), PROTOBUF_FIELD_OFFSET(::protobuf::PlayerMsg, _impl_.team_id_), - PROTOBUF_FIELD_OFFSET(::protobuf::PlayerMsg, _impl_.ship_type_), + PROTOBUF_FIELD_OFFSET(::protobuf::PlayerMsg, _impl_.sweeper_type_), PROTOBUF_FIELD_OFFSET(::protobuf::PlayerMsg, _impl_.x_), PROTOBUF_FIELD_OFFSET(::protobuf::PlayerMsg, _impl_.y_), ~0u, // no _has_bits_ @@ -330,15 +330,15 @@ const uint32_t TableStruct_Message2Server_2eproto::offsets[] PROTOBUF_SECTION_VA PROTOBUF_FIELD_OFFSET(::protobuf::InstallMsg, _impl_.player_id_), PROTOBUF_FIELD_OFFSET(::protobuf::InstallMsg, _impl_.team_id_), ~0u, // no _has_bits_ - PROTOBUF_FIELD_OFFSET(::protobuf::BuildShipMsg, _internal_metadata_), + PROTOBUF_FIELD_OFFSET(::protobuf::BuildSweeperMsg, _internal_metadata_), ~0u, // no _extensions_ ~0u, // no _oneof_case_ ~0u, // no _weak_field_map_ ~0u, // no _inlined_string_donated_ - PROTOBUF_FIELD_OFFSET(::protobuf::BuildShipMsg, _impl_.x_), - PROTOBUF_FIELD_OFFSET(::protobuf::BuildShipMsg, _impl_.y_), - PROTOBUF_FIELD_OFFSET(::protobuf::BuildShipMsg, _impl_.ship_type_), - PROTOBUF_FIELD_OFFSET(::protobuf::BuildShipMsg, _impl_.team_id_), + PROTOBUF_FIELD_OFFSET(::protobuf::BuildSweeperMsg, _impl_.x_), + PROTOBUF_FIELD_OFFSET(::protobuf::BuildSweeperMsg, _impl_.y_), + PROTOBUF_FIELD_OFFSET(::protobuf::BuildSweeperMsg, _impl_.sweeper_type_), + PROTOBUF_FIELD_OFFSET(::protobuf::BuildSweeperMsg, _impl_.team_id_), }; static const ::_pbi::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { {0, -1, -1, sizeof(::protobuf::NullRequest)}, @@ -350,7 +350,7 @@ static const ::_pbi::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protode {56, -1, -1, sizeof(::protobuf::ConstructMsg)}, {65, -1, -1, sizeof(::protobuf::RecoverMsg)}, {74, -1, -1, sizeof(::protobuf::InstallMsg)}, - {83, -1, -1, sizeof(::protobuf::BuildShipMsg)}, + {83, -1, -1, sizeof(::protobuf::BuildSweeperMsg)}, }; static const ::_pb::Message* const file_default_instances[] = { @@ -363,32 +363,33 @@ static const ::_pb::Message* const file_default_instances[] = { &::protobuf::_ConstructMsg_default_instance_._instance, &::protobuf::_RecoverMsg_default_instance_._instance, &::protobuf::_InstallMsg_default_instance_._instance, - &::protobuf::_BuildShipMsg_default_instance_._instance, + &::protobuf::_BuildSweeperMsg_default_instance_._instance, }; const char descriptor_table_protodef_Message2Server_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = "\n\024Message2Server.proto\022\010protobuf\032\021Messag" "eType.proto\"\r\n\013NullRequest\"+\n\005IDMsg\022\021\n\tp" - "layer_id\030\001 \001(\003\022\017\n\007team_id\030\002 \001(\003\"l\n\tPlaye" + "layer_id\030\001 \001(\003\022\017\n\007team_id\030\002 \001(\003\"r\n\tPlaye" "rMsg\022\021\n\tplayer_id\030\001 \001(\003\022\017\n\007team_id\030\002 \001(\003" - "\022%\n\tship_type\030\003 \001(\0162\022.protobuf.ShipType\022" - "\t\n\001x\030\004 \001(\005\022\t\n\001y\030\005 \001(\005\"Z\n\007MoveMsg\022\021\n\tplay" - "er_id\030\001 \001(\003\022\r\n\005angle\030\002 \001(\001\022\034\n\024time_in_mi" - "lliseconds\030\003 \001(\003\022\017\n\007team_id\030\004 \001(\003\"\200\001\n\007Se" - "ndMsg\022\021\n\tplayer_id\030\001 \001(\003\022\024\n\014to_player_id" - "\030\002 \001(\003\022\026\n\014text_message\030\003 \001(\tH\000\022\030\n\016binary" - "_message\030\004 \001(\014H\000\022\017\n\007team_id\030\005 \001(\003B\t\n\007mes" - "sage\">\n\tAttackMsg\022\021\n\tplayer_id\030\001 \001(\003\022\r\n\005" - "angle\030\002 \001(\001\022\017\n\007team_id\030\003 \001(\003\"i\n\014Construc" - "tMsg\022\021\n\tplayer_id\030\001 \001(\003\0225\n\021construction_" - "type\030\002 \001(\0162\032.protobuf.ConstructionType\022\017" - "\n\007team_id\030\003 \001(\003\"A\n\nRecoverMsg\022\021\n\tplayer_" - "id\030\001 \001(\003\022\017\n\007recover\030\002 \001(\003\022\017\n\007team_id\030\003 \001" - "(\003\"[\n\nInstallMsg\022)\n\013module_type\030\001 \001(\0162\024." - "protobuf.ModuleType\022\021\n\tplayer_id\030\002 \001(\003\022\017" - "\n\007team_id\030\003 \001(\003\"\\\n\014BuildShipMsg\022\t\n\001x\030\001 \001" - "(\005\022\t\n\001y\030\002 \001(\005\022%\n\tship_type\030\003 \001(\0162\022.proto" - "buf.ShipType\022\017\n\007team_id\030\004 \001(\003b\006proto3"; + "\022+\n\014sweeper_type\030\003 \001(\0162\025.protobuf.Sweepe" + "rType\022\t\n\001x\030\004 \001(\005\022\t\n\001y\030\005 \001(\005\"Z\n\007MoveMsg\022\021" + "\n\tplayer_id\030\001 \001(\003\022\r\n\005angle\030\002 \001(\001\022\034\n\024time" + "_in_milliseconds\030\003 \001(\003\022\017\n\007team_id\030\004 \001(\003\"" + "\200\001\n\007SendMsg\022\021\n\tplayer_id\030\001 \001(\003\022\024\n\014to_pla" + "yer_id\030\002 \001(\003\022\026\n\014text_message\030\003 \001(\tH\000\022\030\n\016" + "binary_message\030\004 \001(\014H\000\022\017\n\007team_id\030\005 \001(\003B" + "\t\n\007message\">\n\tAttackMsg\022\021\n\tplayer_id\030\001 \001" + "(\003\022\r\n\005angle\030\002 \001(\001\022\017\n\007team_id\030\003 \001(\003\"i\n\014Co" + "nstructMsg\022\021\n\tplayer_id\030\001 \001(\003\0225\n\021constru" + "ction_type\030\002 \001(\0162\032.protobuf.Construction" + "Type\022\017\n\007team_id\030\003 \001(\003\"A\n\nRecoverMsg\022\021\n\tp" + "layer_id\030\001 \001(\003\022\017\n\007recover\030\002 \001(\003\022\017\n\007team_" + "id\030\003 \001(\003\"[\n\nInstallMsg\022)\n\013module_type\030\001 " + "\001(\0162\024.protobuf.ModuleType\022\021\n\tplayer_id\030\002" + " \001(\003\022\017\n\007team_id\030\003 \001(\003\"e\n\017BuildSweeperMsg" + "\022\t\n\001x\030\001 \001(\005\022\t\n\001y\030\002 \001(\005\022+\n\014sweeper_type\030\003" + " \001(\0162\025.protobuf.SweeperType\022\017\n\007team_id\030\004" + " \001(\003b\006proto3"; static const ::_pbi::DescriptorTable* const descriptor_table_Message2Server_2eproto_deps[1] = { &::descriptor_table_MessageType_2eproto, }; @@ -396,7 +397,7 @@ static ::_pbi::once_flag descriptor_table_Message2Server_2eproto_once; const ::_pbi::DescriptorTable descriptor_table_Message2Server_2eproto = { false, false, - 877, + 892, descriptor_table_protodef_Message2Server_2eproto, "Message2Server.proto", &descriptor_table_Message2Server_2eproto_once, @@ -717,7 +718,7 @@ namespace protobuf PlayerMsg* const _this = this; (void)_this; new (&_impl_) Impl_{ - decltype(_impl_.player_id_){}, decltype(_impl_.team_id_){}, decltype(_impl_.ship_type_){}, decltype(_impl_.x_){}, decltype(_impl_.y_){}, /*decltype(_impl_._cached_size_)*/ {}}; + decltype(_impl_.player_id_){}, decltype(_impl_.team_id_){}, decltype(_impl_.sweeper_type_){}, decltype(_impl_.x_){}, decltype(_impl_.y_){}, /*decltype(_impl_._cached_size_)*/ {}}; _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); ::memcpy(&_impl_.player_id_, &from._impl_.player_id_, static_cast(reinterpret_cast(&_impl_.y_) - reinterpret_cast(&_impl_.player_id_)) + sizeof(_impl_.y_)); @@ -731,7 +732,7 @@ namespace protobuf (void)arena; (void)is_message_owned; new (&_impl_) Impl_{ - decltype(_impl_.player_id_){int64_t{0}}, decltype(_impl_.team_id_){int64_t{0}}, decltype(_impl_.ship_type_){0}, decltype(_impl_.x_){0}, decltype(_impl_.y_){0}, /*decltype(_impl_._cached_size_)*/ {}}; + decltype(_impl_.player_id_){int64_t{0}}, decltype(_impl_.team_id_){int64_t{0}}, decltype(_impl_.sweeper_type_){0}, decltype(_impl_.x_){0}, decltype(_impl_.y_){0}, /*decltype(_impl_._cached_size_)*/ {}}; } PlayerMsg::~PlayerMsg() @@ -797,13 +798,13 @@ namespace protobuf else goto handle_unusual; continue; - // .protobuf.ShipType ship_type = 3; + // .protobuf.SweeperType sweeper_type = 3; case 3: if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 24)) { uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); CHK_(ptr); - _internal_set_ship_type(static_cast<::protobuf::ShipType>(val)); + _internal_set_sweeper_type(static_cast<::protobuf::SweeperType>(val)); } else goto handle_unusual; @@ -876,12 +877,12 @@ namespace protobuf target = ::_pbi::WireFormatLite::WriteInt64ToArray(2, this->_internal_team_id(), target); } - // .protobuf.ShipType ship_type = 3; - if (this->_internal_ship_type() != 0) + // .protobuf.SweeperType sweeper_type = 3; + if (this->_internal_sweeper_type() != 0) { target = stream->EnsureSpace(target); target = ::_pbi::WireFormatLite::WriteEnumToArray( - 3, this->_internal_ship_type(), target + 3, this->_internal_sweeper_type(), target ); } @@ -930,11 +931,11 @@ namespace protobuf total_size += ::_pbi::WireFormatLite::Int64SizePlusOne(this->_internal_team_id()); } - // .protobuf.ShipType ship_type = 3; - if (this->_internal_ship_type() != 0) + // .protobuf.SweeperType sweeper_type = 3; + if (this->_internal_sweeper_type() != 0) { total_size += 1 + - ::_pbi::WireFormatLite::EnumSize(this->_internal_ship_type()); + ::_pbi::WireFormatLite::EnumSize(this->_internal_sweeper_type()); } // int32 x = 4; @@ -977,9 +978,9 @@ namespace protobuf { _this->_internal_set_team_id(from._internal_team_id()); } - if (from._internal_ship_type() != 0) + if (from._internal_sweeper_type() != 0) { - _this->_internal_set_ship_type(from._internal_ship_type()); + _this->_internal_set_sweeper_type(from._internal_sweeper_type()); } if (from._internal_x() != 0) { @@ -2826,43 +2827,43 @@ namespace protobuf // =================================================================== - class BuildShipMsg::_Internal + class BuildSweeperMsg::_Internal { public: }; - BuildShipMsg::BuildShipMsg(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned) : + BuildSweeperMsg::BuildSweeperMsg(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned) : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { SharedCtor(arena, is_message_owned); - // @@protoc_insertion_point(arena_constructor:protobuf.BuildShipMsg) + // @@protoc_insertion_point(arena_constructor:protobuf.BuildSweeperMsg) } - BuildShipMsg::BuildShipMsg(const BuildShipMsg& from) : + BuildSweeperMsg::BuildSweeperMsg(const BuildSweeperMsg& from) : ::PROTOBUF_NAMESPACE_ID::Message() { - BuildShipMsg* const _this = this; + BuildSweeperMsg* const _this = this; (void)_this; new (&_impl_) Impl_{ - decltype(_impl_.x_){}, decltype(_impl_.y_){}, decltype(_impl_.team_id_){}, decltype(_impl_.ship_type_){}, /*decltype(_impl_._cached_size_)*/ {}}; + decltype(_impl_.x_){}, decltype(_impl_.y_){}, decltype(_impl_.team_id_){}, decltype(_impl_.sweeper_type_){}, /*decltype(_impl_._cached_size_)*/ {}}; _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); - ::memcpy(&_impl_.x_, &from._impl_.x_, static_cast(reinterpret_cast(&_impl_.ship_type_) - reinterpret_cast(&_impl_.x_)) + sizeof(_impl_.ship_type_)); - // @@protoc_insertion_point(copy_constructor:protobuf.BuildShipMsg) + ::memcpy(&_impl_.x_, &from._impl_.x_, static_cast(reinterpret_cast(&_impl_.sweeper_type_) - reinterpret_cast(&_impl_.x_)) + sizeof(_impl_.sweeper_type_)); + // @@protoc_insertion_point(copy_constructor:protobuf.BuildSweeperMsg) } - inline void BuildShipMsg::SharedCtor( + inline void BuildSweeperMsg::SharedCtor( ::_pb::Arena* arena, bool is_message_owned ) { (void)arena; (void)is_message_owned; new (&_impl_) Impl_{ - decltype(_impl_.x_){0}, decltype(_impl_.y_){0}, decltype(_impl_.team_id_){int64_t{0}}, decltype(_impl_.ship_type_){0}, /*decltype(_impl_._cached_size_)*/ {}}; + decltype(_impl_.x_){0}, decltype(_impl_.y_){0}, decltype(_impl_.team_id_){int64_t{0}}, decltype(_impl_.sweeper_type_){0}, /*decltype(_impl_._cached_size_)*/ {}}; } - BuildShipMsg::~BuildShipMsg() + BuildSweeperMsg::~BuildSweeperMsg() { - // @@protoc_insertion_point(destructor:protobuf.BuildShipMsg) + // @@protoc_insertion_point(destructor:protobuf.BuildSweeperMsg) if (auto* arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { (void)arena; @@ -2871,28 +2872,28 @@ namespace protobuf SharedDtor(); } - inline void BuildShipMsg::SharedDtor() + inline void BuildSweeperMsg::SharedDtor() { GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); } - void BuildShipMsg::SetCachedSize(int size) const + void BuildSweeperMsg::SetCachedSize(int size) const { _impl_._cached_size_.Set(size); } - void BuildShipMsg::Clear() + void BuildSweeperMsg::Clear() { - // @@protoc_insertion_point(message_clear_start:protobuf.BuildShipMsg) + // @@protoc_insertion_point(message_clear_start:protobuf.BuildSweeperMsg) uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void)cached_has_bits; - ::memset(&_impl_.x_, 0, static_cast(reinterpret_cast(&_impl_.ship_type_) - reinterpret_cast(&_impl_.x_)) + sizeof(_impl_.ship_type_)); + ::memset(&_impl_.x_, 0, static_cast(reinterpret_cast(&_impl_.sweeper_type_) - reinterpret_cast(&_impl_.x_)) + sizeof(_impl_.sweeper_type_)); _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } - const char* BuildShipMsg::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) + const char* BuildSweeperMsg::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { #define CHK_(x) \ if (PROTOBUF_PREDICT_FALSE(!(x))) \ @@ -2923,13 +2924,13 @@ namespace protobuf else goto handle_unusual; continue; - // .protobuf.ShipType ship_type = 3; + // .protobuf.SweeperType sweeper_type = 3; case 3: if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 24)) { uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); CHK_(ptr); - _internal_set_ship_type(static_cast<::protobuf::ShipType>(val)); + _internal_set_sweeper_type(static_cast<::protobuf::SweeperType>(val)); } else goto handle_unusual; @@ -2970,11 +2971,11 @@ namespace protobuf #undef CHK_ } - uint8_t* BuildShipMsg::_InternalSerialize( + uint8_t* BuildSweeperMsg::_InternalSerialize( uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream ) const { - // @@protoc_insertion_point(serialize_to_array_start:protobuf.BuildShipMsg) + // @@protoc_insertion_point(serialize_to_array_start:protobuf.BuildSweeperMsg) uint32_t cached_has_bits = 0; (void)cached_has_bits; @@ -2992,12 +2993,12 @@ namespace protobuf target = ::_pbi::WireFormatLite::WriteInt32ToArray(2, this->_internal_y(), target); } - // .protobuf.ShipType ship_type = 3; - if (this->_internal_ship_type() != 0) + // .protobuf.SweeperType sweeper_type = 3; + if (this->_internal_sweeper_type() != 0) { target = stream->EnsureSpace(target); target = ::_pbi::WireFormatLite::WriteEnumToArray( - 3, this->_internal_ship_type(), target + 3, this->_internal_sweeper_type(), target ); } @@ -3014,13 +3015,13 @@ namespace protobuf _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream ); } - // @@protoc_insertion_point(serialize_to_array_end:protobuf.BuildShipMsg) + // @@protoc_insertion_point(serialize_to_array_end:protobuf.BuildSweeperMsg) return target; } - size_t BuildShipMsg::ByteSizeLong() const + size_t BuildSweeperMsg::ByteSizeLong() const { - // @@protoc_insertion_point(message_byte_size_start:protobuf.BuildShipMsg) + // @@protoc_insertion_point(message_byte_size_start:protobuf.BuildSweeperMsg) size_t total_size = 0; uint32_t cached_has_bits = 0; @@ -3045,29 +3046,29 @@ namespace protobuf total_size += ::_pbi::WireFormatLite::Int64SizePlusOne(this->_internal_team_id()); } - // .protobuf.ShipType ship_type = 3; - if (this->_internal_ship_type() != 0) + // .protobuf.SweeperType sweeper_type = 3; + if (this->_internal_sweeper_type() != 0) { total_size += 1 + - ::_pbi::WireFormatLite::EnumSize(this->_internal_ship_type()); + ::_pbi::WireFormatLite::EnumSize(this->_internal_sweeper_type()); } return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); } - const ::PROTOBUF_NAMESPACE_ID::Message::ClassData BuildShipMsg::_class_data_ = { + const ::PROTOBUF_NAMESPACE_ID::Message::ClassData BuildSweeperMsg::_class_data_ = { ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, - BuildShipMsg::MergeImpl}; - const ::PROTOBUF_NAMESPACE_ID::Message::ClassData* BuildShipMsg::GetClassData() const + BuildSweeperMsg::MergeImpl}; + const ::PROTOBUF_NAMESPACE_ID::Message::ClassData* BuildSweeperMsg::GetClassData() const { return &_class_data_; } - void BuildShipMsg::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) + void BuildSweeperMsg::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { - auto* const _this = static_cast(&to_msg); - auto& from = static_cast(from_msg); - // @@protoc_insertion_point(class_specific_merge_from_start:protobuf.BuildShipMsg) + auto* const _this = static_cast(&to_msg); + auto& from = static_cast(from_msg); + // @@protoc_insertion_point(class_specific_merge_from_start:protobuf.BuildSweeperMsg) GOOGLE_DCHECK_NE(&from, _this); uint32_t cached_has_bits = 0; (void)cached_has_bits; @@ -3084,39 +3085,39 @@ namespace protobuf { _this->_internal_set_team_id(from._internal_team_id()); } - if (from._internal_ship_type() != 0) + if (from._internal_sweeper_type() != 0) { - _this->_internal_set_ship_type(from._internal_ship_type()); + _this->_internal_set_sweeper_type(from._internal_sweeper_type()); } _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); } - void BuildShipMsg::CopyFrom(const BuildShipMsg& from) + void BuildSweeperMsg::CopyFrom(const BuildSweeperMsg& from) { - // @@protoc_insertion_point(class_specific_copy_from_start:protobuf.BuildShipMsg) + // @@protoc_insertion_point(class_specific_copy_from_start:protobuf.BuildSweeperMsg) if (&from == this) return; Clear(); MergeFrom(from); } - bool BuildShipMsg::IsInitialized() const + bool BuildSweeperMsg::IsInitialized() const { return true; } - void BuildShipMsg::InternalSwap(BuildShipMsg* other) + void BuildSweeperMsg::InternalSwap(BuildSweeperMsg* other) { using std::swap; _internal_metadata_.InternalSwap(&other->_internal_metadata_); ::PROTOBUF_NAMESPACE_ID::internal::memswap< - PROTOBUF_FIELD_OFFSET(BuildShipMsg, _impl_.ship_type_) + sizeof(BuildShipMsg::_impl_.ship_type_) - PROTOBUF_FIELD_OFFSET(BuildShipMsg, _impl_.x_)>( + PROTOBUF_FIELD_OFFSET(BuildSweeperMsg, _impl_.sweeper_type_) + sizeof(BuildSweeperMsg::_impl_.sweeper_type_) - PROTOBUF_FIELD_OFFSET(BuildSweeperMsg, _impl_.x_)>( reinterpret_cast(&_impl_.x_), reinterpret_cast(&other->_impl_.x_) ); } - ::PROTOBUF_NAMESPACE_ID::Metadata BuildShipMsg::GetMetadata() const + ::PROTOBUF_NAMESPACE_ID::Metadata BuildSweeperMsg::GetMetadata() const { return ::_pbi::AssignDescriptors( &descriptor_table_Message2Server_2eproto_getter, &descriptor_table_Message2Server_2eproto_once, file_level_metadata_Message2Server_2eproto[9] @@ -3181,10 +3182,10 @@ PROTOBUF_NOINLINE ::protobuf::InstallMsg* return Arena::CreateMessageInternal<::protobuf::InstallMsg>(arena); } template<> -PROTOBUF_NOINLINE ::protobuf::BuildShipMsg* - Arena::CreateMaybeMessage<::protobuf::BuildShipMsg>(Arena* arena) +PROTOBUF_NOINLINE ::protobuf::BuildSweeperMsg* + Arena::CreateMaybeMessage<::protobuf::BuildSweeperMsg>(Arena* arena) { - return Arena::CreateMessageInternal<::protobuf::BuildShipMsg>(arena); + return Arena::CreateMessageInternal<::protobuf::BuildSweeperMsg>(arena); } PROTOBUF_NAMESPACE_CLOSE diff --git a/CAPI/cpp/proto/Message2Server.pb.h b/CAPI/cpp/proto/Message2Server.pb.h index 69bc9138..db139865 100644 --- a/CAPI/cpp/proto/Message2Server.pb.h +++ b/CAPI/cpp/proto/Message2Server.pb.h @@ -53,9 +53,9 @@ namespace protobuf class AttackMsg; struct AttackMsgDefaultTypeInternal; extern AttackMsgDefaultTypeInternal _AttackMsg_default_instance_; - class BuildShipMsg; - struct BuildShipMsgDefaultTypeInternal; - extern BuildShipMsgDefaultTypeInternal _BuildShipMsg_default_instance_; + class BuildSweeperMsg; + struct BuildSweeperMsgDefaultTypeInternal; + extern BuildSweeperMsgDefaultTypeInternal _BuildSweeperMsg_default_instance_; class ConstructMsg; struct ConstructMsgDefaultTypeInternal; extern ConstructMsgDefaultTypeInternal _ConstructMsg_default_instance_; @@ -85,7 +85,7 @@ PROTOBUF_NAMESPACE_OPEN template<> ::protobuf::AttackMsg* Arena::CreateMaybeMessage<::protobuf::AttackMsg>(Arena*); template<> -::protobuf::BuildShipMsg* Arena::CreateMaybeMessage<::protobuf::BuildShipMsg>(Arena*); +::protobuf::BuildSweeperMsg* Arena::CreateMaybeMessage<::protobuf::BuildSweeperMsg>(Arena*); template<> ::protobuf::ConstructMsg* Arena::CreateMaybeMessage<::protobuf::ConstructMsg>(Arena*); template<> @@ -625,7 +625,7 @@ namespace protobuf { kPlayerIdFieldNumber = 1, kTeamIdFieldNumber = 2, - kShipTypeFieldNumber = 3, + kSweeperTypeFieldNumber = 3, kXFieldNumber = 4, kYFieldNumber = 5, }; @@ -649,14 +649,14 @@ namespace protobuf void _internal_set_team_id(int64_t value); public: - // .protobuf.ShipType ship_type = 3; - void clear_ship_type(); - ::protobuf::ShipType ship_type() const; - void set_ship_type(::protobuf::ShipType value); + // .protobuf.SweeperType sweeper_type = 3; + void clear_sweeper_type(); + ::protobuf::SweeperType sweeper_type() const; + void set_sweeper_type(::protobuf::SweeperType value); private: - ::protobuf::ShipType _internal_ship_type() const; - void _internal_set_ship_type(::protobuf::ShipType value); + ::protobuf::SweeperType _internal_sweeper_type() const; + void _internal_set_sweeper_type(::protobuf::SweeperType value); public: // int32 x = 4; @@ -692,7 +692,7 @@ namespace protobuf { int64_t player_id_; int64_t team_id_; - int ship_type_; + int sweeper_type_; int32_t x_; int32_t y_; mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; @@ -2082,31 +2082,31 @@ namespace protobuf }; // ------------------------------------------------------------------- - class BuildShipMsg final : - public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:protobuf.BuildShipMsg) */ + class BuildSweeperMsg final : + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:protobuf.BuildSweeperMsg) */ { public: - inline BuildShipMsg() : - BuildShipMsg(nullptr) + inline BuildSweeperMsg() : + BuildSweeperMsg(nullptr) { } - ~BuildShipMsg() override; - explicit PROTOBUF_CONSTEXPR BuildShipMsg(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + ~BuildSweeperMsg() override; + explicit PROTOBUF_CONSTEXPR BuildSweeperMsg(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); - BuildShipMsg(const BuildShipMsg& from); - BuildShipMsg(BuildShipMsg&& from) noexcept + BuildSweeperMsg(const BuildSweeperMsg& from); + BuildSweeperMsg(BuildSweeperMsg&& from) noexcept : - BuildShipMsg() + BuildSweeperMsg() { *this = ::std::move(from); } - inline BuildShipMsg& operator=(const BuildShipMsg& from) + inline BuildSweeperMsg& operator=(const BuildSweeperMsg& from) { CopyFrom(from); return *this; } - inline BuildShipMsg& operator=(BuildShipMsg&& from) noexcept + inline BuildSweeperMsg& operator=(BuildSweeperMsg&& from) noexcept { if (this == &from) return *this; @@ -2137,24 +2137,24 @@ namespace protobuf { return default_instance().GetMetadata().reflection; } - static const BuildShipMsg& default_instance() + static const BuildSweeperMsg& default_instance() { return *internal_default_instance(); } - static inline const BuildShipMsg* internal_default_instance() + static inline const BuildSweeperMsg* internal_default_instance() { - return reinterpret_cast( - &_BuildShipMsg_default_instance_ + return reinterpret_cast( + &_BuildSweeperMsg_default_instance_ ); } static constexpr int kIndexInFileMessages = 9; - friend void swap(BuildShipMsg& a, BuildShipMsg& b) + friend void swap(BuildSweeperMsg& a, BuildSweeperMsg& b) { a.Swap(&b); } - inline void Swap(BuildShipMsg* other) + inline void Swap(BuildSweeperMsg* other) { if (other == this) return; @@ -2173,7 +2173,7 @@ namespace protobuf ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); } } - void UnsafeArenaSwap(BuildShipMsg* other) + void UnsafeArenaSwap(BuildSweeperMsg* other) { if (other == this) return; @@ -2183,16 +2183,16 @@ namespace protobuf // implements Message ---------------------------------------------- - BuildShipMsg* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final + BuildSweeperMsg* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { - return CreateMaybeMessage(arena); + return CreateMaybeMessage(arena); } using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; - void CopyFrom(const BuildShipMsg& from); + void CopyFrom(const BuildSweeperMsg& from); using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; - void MergeFrom(const BuildShipMsg& from) + void MergeFrom(const BuildSweeperMsg& from) { - BuildShipMsg::MergeImpl(*this, from); + BuildSweeperMsg::MergeImpl(*this, from); } private: @@ -2216,17 +2216,17 @@ namespace protobuf void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); void SharedDtor(); void SetCachedSize(int size) const final; - void InternalSwap(BuildShipMsg* other); + void InternalSwap(BuildSweeperMsg* other); private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "protobuf.BuildShipMsg"; + return "protobuf.BuildSweeperMsg"; } protected: - explicit BuildShipMsg(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); + explicit BuildSweeperMsg(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); public: static const ClassData _class_data_; @@ -2243,7 +2243,7 @@ namespace protobuf kXFieldNumber = 1, kYFieldNumber = 2, kTeamIdFieldNumber = 4, - kShipTypeFieldNumber = 3, + kSweeperTypeFieldNumber = 3, }; // int32 x = 1; void clear_x(); @@ -2275,17 +2275,17 @@ namespace protobuf void _internal_set_team_id(int64_t value); public: - // .protobuf.ShipType ship_type = 3; - void clear_ship_type(); - ::protobuf::ShipType ship_type() const; - void set_ship_type(::protobuf::ShipType value); + // .protobuf.SweeperType sweeper_type = 3; + void clear_sweeper_type(); + ::protobuf::SweeperType sweeper_type() const; + void set_sweeper_type(::protobuf::SweeperType value); private: - ::protobuf::ShipType _internal_ship_type() const; - void _internal_set_ship_type(::protobuf::ShipType value); + ::protobuf::SweeperType _internal_sweeper_type() const; + void _internal_set_sweeper_type(::protobuf::SweeperType value); public: - // @@protoc_insertion_point(class_scope:protobuf.BuildShipMsg) + // @@protoc_insertion_point(class_scope:protobuf.BuildSweeperMsg) private: class _Internal; @@ -2299,7 +2299,7 @@ namespace protobuf int32_t x_; int32_t y_; int64_t team_id_; - int ship_type_; + int sweeper_type_; mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; }; union @@ -2422,28 +2422,28 @@ namespace protobuf // @@protoc_insertion_point(field_set:protobuf.PlayerMsg.team_id) } - // .protobuf.ShipType ship_type = 3; - inline void PlayerMsg::clear_ship_type() + // .protobuf.SweeperType sweeper_type = 3; + inline void PlayerMsg::clear_sweeper_type() { - _impl_.ship_type_ = 0; + _impl_.sweeper_type_ = 0; } - inline ::protobuf::ShipType PlayerMsg::_internal_ship_type() const + inline ::protobuf::SweeperType PlayerMsg::_internal_sweeper_type() const { - return static_cast<::protobuf::ShipType>(_impl_.ship_type_); + return static_cast<::protobuf::SweeperType>(_impl_.sweeper_type_); } - inline ::protobuf::ShipType PlayerMsg::ship_type() const + inline ::protobuf::SweeperType PlayerMsg::sweeper_type() const { - // @@protoc_insertion_point(field_get:protobuf.PlayerMsg.ship_type) - return _internal_ship_type(); + // @@protoc_insertion_point(field_get:protobuf.PlayerMsg.sweeper_type) + return _internal_sweeper_type(); } - inline void PlayerMsg::_internal_set_ship_type(::protobuf::ShipType value) + inline void PlayerMsg::_internal_set_sweeper_type(::protobuf::SweeperType value) { - _impl_.ship_type_ = value; + _impl_.sweeper_type_ = value; } - inline void PlayerMsg::set_ship_type(::protobuf::ShipType value) + inline void PlayerMsg::set_sweeper_type(::protobuf::SweeperType value) { - _internal_set_ship_type(value); - // @@protoc_insertion_point(field_set:protobuf.PlayerMsg.ship_type) + _internal_set_sweeper_type(value); + // @@protoc_insertion_point(field_set:protobuf.PlayerMsg.sweeper_type) } // int32 x = 4; @@ -3186,102 +3186,102 @@ namespace protobuf // ------------------------------------------------------------------- - // BuildShipMsg + // BuildSweeperMsg // int32 x = 1; - inline void BuildShipMsg::clear_x() + inline void BuildSweeperMsg::clear_x() { _impl_.x_ = 0; } - inline int32_t BuildShipMsg::_internal_x() const + inline int32_t BuildSweeperMsg::_internal_x() const { return _impl_.x_; } - inline int32_t BuildShipMsg::x() const + inline int32_t BuildSweeperMsg::x() const { - // @@protoc_insertion_point(field_get:protobuf.BuildShipMsg.x) + // @@protoc_insertion_point(field_get:protobuf.BuildSweeperMsg.x) return _internal_x(); } - inline void BuildShipMsg::_internal_set_x(int32_t value) + inline void BuildSweeperMsg::_internal_set_x(int32_t value) { _impl_.x_ = value; } - inline void BuildShipMsg::set_x(int32_t value) + inline void BuildSweeperMsg::set_x(int32_t value) { _internal_set_x(value); - // @@protoc_insertion_point(field_set:protobuf.BuildShipMsg.x) + // @@protoc_insertion_point(field_set:protobuf.BuildSweeperMsg.x) } // int32 y = 2; - inline void BuildShipMsg::clear_y() + inline void BuildSweeperMsg::clear_y() { _impl_.y_ = 0; } - inline int32_t BuildShipMsg::_internal_y() const + inline int32_t BuildSweeperMsg::_internal_y() const { return _impl_.y_; } - inline int32_t BuildShipMsg::y() const + inline int32_t BuildSweeperMsg::y() const { - // @@protoc_insertion_point(field_get:protobuf.BuildShipMsg.y) + // @@protoc_insertion_point(field_get:protobuf.BuildSweeperMsg.y) return _internal_y(); } - inline void BuildShipMsg::_internal_set_y(int32_t value) + inline void BuildSweeperMsg::_internal_set_y(int32_t value) { _impl_.y_ = value; } - inline void BuildShipMsg::set_y(int32_t value) + inline void BuildSweeperMsg::set_y(int32_t value) { _internal_set_y(value); - // @@protoc_insertion_point(field_set:protobuf.BuildShipMsg.y) + // @@protoc_insertion_point(field_set:protobuf.BuildSweeperMsg.y) } - // .protobuf.ShipType ship_type = 3; - inline void BuildShipMsg::clear_ship_type() + // .protobuf.SweeperType sweeper_type = 3; + inline void BuildSweeperMsg::clear_sweeper_type() { - _impl_.ship_type_ = 0; + _impl_.sweeper_type_ = 0; } - inline ::protobuf::ShipType BuildShipMsg::_internal_ship_type() const + inline ::protobuf::SweeperType BuildSweeperMsg::_internal_sweeper_type() const { - return static_cast<::protobuf::ShipType>(_impl_.ship_type_); + return static_cast<::protobuf::SweeperType>(_impl_.sweeper_type_); } - inline ::protobuf::ShipType BuildShipMsg::ship_type() const + inline ::protobuf::SweeperType BuildSweeperMsg::sweeper_type() const { - // @@protoc_insertion_point(field_get:protobuf.BuildShipMsg.ship_type) - return _internal_ship_type(); + // @@protoc_insertion_point(field_get:protobuf.BuildSweeperMsg.sweeper_type) + return _internal_sweeper_type(); } - inline void BuildShipMsg::_internal_set_ship_type(::protobuf::ShipType value) + inline void BuildSweeperMsg::_internal_set_sweeper_type(::protobuf::SweeperType value) { - _impl_.ship_type_ = value; + _impl_.sweeper_type_ = value; } - inline void BuildShipMsg::set_ship_type(::protobuf::ShipType value) + inline void BuildSweeperMsg::set_sweeper_type(::protobuf::SweeperType value) { - _internal_set_ship_type(value); - // @@protoc_insertion_point(field_set:protobuf.BuildShipMsg.ship_type) + _internal_set_sweeper_type(value); + // @@protoc_insertion_point(field_set:protobuf.BuildSweeperMsg.sweeper_type) } // int64 team_id = 4; - inline void BuildShipMsg::clear_team_id() + inline void BuildSweeperMsg::clear_team_id() { _impl_.team_id_ = int64_t{0}; } - inline int64_t BuildShipMsg::_internal_team_id() const + inline int64_t BuildSweeperMsg::_internal_team_id() const { return _impl_.team_id_; } - inline int64_t BuildShipMsg::team_id() const + inline int64_t BuildSweeperMsg::team_id() const { - // @@protoc_insertion_point(field_get:protobuf.BuildShipMsg.team_id) + // @@protoc_insertion_point(field_get:protobuf.BuildSweeperMsg.team_id) return _internal_team_id(); } - inline void BuildShipMsg::_internal_set_team_id(int64_t value) + inline void BuildSweeperMsg::_internal_set_team_id(int64_t value) { _impl_.team_id_ = value; } - inline void BuildShipMsg::set_team_id(int64_t value) + inline void BuildSweeperMsg::set_team_id(int64_t value) { _internal_set_team_id(value); - // @@protoc_insertion_point(field_set:protobuf.BuildShipMsg.team_id) + // @@protoc_insertion_point(field_set:protobuf.BuildSweeperMsg.team_id) } #ifdef __GNUC__ diff --git a/CAPI/cpp/proto/MessageType.pb.cc b/CAPI/cpp/proto/MessageType.pb.cc index a86cbfb1..fb6438f9 100644 --- a/CAPI/cpp/proto/MessageType.pb.cc +++ b/CAPI/cpp/proto/MessageType.pb.cc @@ -32,53 +32,54 @@ static constexpr ::_pb::Message* const* file_default_instances = nullptr; const char descriptor_table_protodef_MessageType_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = "\n\021MessageType.proto\022\010protobuf*P\n\tGameSta" "te\022\023\n\017NULL_GAME_STATE\020\000\022\016\n\nGAME_START\020\001\022" - "\020\n\014GAME_RUNNING\020\002\022\014\n\010GAME_END\020\003*\207\001\n\tPlac" - "eType\022\023\n\017NULL_PLACE_TYPE\020\000\022\010\n\004HOME\020\001\022\t\n\005" - "SPACE\020\002\022\010\n\004RUIN\020\003\022\n\n\006SHADOW\020\004\022\014\n\010ASTEROI" - "D\020\005\022\014\n\010RESOURCE\020\006\022\020\n\014CONSTRUCTION\020\007\022\014\n\010W" - "ORMHOLE\020\010*8\n\tShapeType\022\023\n\017NULL_SHAPE_TYP" - "E\020\000\022\n\n\006CIRCLE\020\001\022\n\n\006SQUARE\020\002*6\n\nPlayerTyp" - "e\022\024\n\020NULL_PLAYER_TYPE\020\000\022\010\n\004SHIP\020\001\022\010\n\004TEA" - "M\020\002*S\n\010ShipType\022\022\n\016NULL_SHIP_TYPE\020\000\022\021\n\rC" - "IVILIAN_SHIP\020\001\022\021\n\rMILITARY_SHIP\020\002\022\r\n\tFLA" - "G_SHIP\020\003*\234\001\n\tShipState\022\017\n\013NULL_STATUS\020\000\022" - "\010\n\004IDLE\020\001\022\r\n\tPRODUCING\020\002\022\020\n\014CONSTRUCTING" - "\020\003\022\016\n\nRECOVERING\020\004\022\r\n\tRECYCLING\020\005\022\r\n\tATT" - "ACKING\020\006\022\014\n\010SWINGING\020\007\022\013\n\007STUNNED\020\010\022\n\n\006M" - "OVING\020\t*i\n\nWeaponType\022\024\n\020NULL_WEAPON_TYP" - "E\020\000\022\014\n\010LASERGUN\020\001\022\r\n\tPLASMAGUN\020\002\022\014\n\010SHEL" - "LGUN\020\003\022\016\n\nMISSILEGUN\020\004\022\n\n\006ARCGUN\020\005*b\n\017Co" - "nstructorType\022\031\n\025NULL_CONSTRUCTOR_TYPE\020\000" - "\022\020\n\014CONSTRUCTOR1\020\001\022\020\n\014CONSTRUCTOR2\020\002\022\020\n\014" - "CONSTRUCTOR3\020\003*D\n\tArmorType\022\023\n\017NULL_ARMO" - "R_TYPE\020\000\022\n\n\006ARMOR1\020\001\022\n\n\006ARMOR2\020\002\022\n\n\006ARMO" - "R3\020\003*I\n\nShieldType\022\024\n\020NULL_SHIELD_TYPE\020\000" - "\022\013\n\007SHIELD1\020\001\022\013\n\007SHIELD2\020\002\022\013\n\007SHIELD3\020\003*" - "S\n\014ProducerType\022\026\n\022NULL_PRODUCER_TYPE\020\000\022" - "\r\n\tPRODUCER1\020\001\022\r\n\tPRODUCER2\020\002\022\r\n\tPRODUCE" - "R3\020\003*\216\003\n\nModuleType\022\024\n\020NULL_MODULE_TYPE\020" - "\000\022\024\n\020MODULE_PRODUCER1\020\001\022\024\n\020MODULE_PRODUC" - "ER2\020\002\022\024\n\020MODULE_PRODUCER3\020\003\022\027\n\023MODULE_CO" - "NSTRUCTOR1\020\004\022\027\n\023MODULE_CONSTRUCTOR2\020\005\022\027\n" - "\023MODULE_CONSTRUCTOR3\020\006\022\021\n\rMODULE_ARMOR1\020" - "\007\022\021\n\rMODULE_ARMOR2\020\010\022\021\n\rMODULE_ARMOR3\020\t\022" - "\022\n\016MODULE_SHIELD1\020\n\022\022\n\016MODULE_SHIELD2\020\013\022" - "\022\n\016MODULE_SHIELD3\020\014\022\023\n\017MODULE_LASERGUN\020\r" - "\022\024\n\020MODULE_PLASMAGUN\020\016\022\023\n\017MODULE_SHELLGU" - "N\020\017\022\025\n\021MODULE_MISSILEGUN\020\020\022\021\n\rMODULE_ARC" - "GUN\020\021*Z\n\nBulletType\022\024\n\020NULL_BULLET_TYPE\020" - "\000\022\t\n\005LASER\020\001\022\n\n\006PLASMA\020\002\022\t\n\005SHELL\020\003\022\013\n\007M" - "ISSILE\020\004\022\007\n\003ARC\020\005*T\n\020ConstructionType\022\032\n" - "\026NULL_CONSTRUCTION_TYPE\020\000\022\013\n\007FACTORY\020\001\022\r" - "\n\tCOMMUNITY\020\002\022\010\n\004FORT\020\003*4\n\010NewsType\022\022\n\016N" - "ULL_NEWS_TYPE\020\000\022\010\n\004TEXT\020\001\022\n\n\006BINARY\020\002*.\n" - "\nPlayerTeam\022\r\n\tNULL_TEAM\020\000\022\007\n\003RED\020\001\022\010\n\004B" - "LUE\020\002b\006proto3"; + "\020\n\014GAME_RUNNING\020\002\022\014\n\010GAME_END\020\003*\201\001\n\tPlac" + "eType\022\023\n\017NULL_PLACE_TYPE\020\000\022\010\n\004HOME\020\001\022\n\n\006" + "GROUND\020\002\022\010\n\004WALL\020\003\022\t\n\005GRASS\020\004\022\t\n\005RIVER\020\005" + "\022\013\n\007GARBAGE\020\006\022\020\n\014CONSTRUCTION\020\007\022\n\n\006BRIDG" + "E\020\010*8\n\tShapeType\022\023\n\017NULL_SHAPE_TYPE\020\000\022\n\n" + "\006CIRCLE\020\001\022\n\n\006SQUARE\020\002*9\n\nPlayerType\022\024\n\020N" + "ULL_PLAYER_TYPE\020\000\022\013\n\007SWEEPER\020\001\022\010\n\004TEAM\020\002" + "*b\n\013SweeperType\022\025\n\021NULL_SWEEPER_TYPE\020\000\022\024" + "\n\020CIVILIAN_SWEEPER\020\001\022\024\n\020MILITARY_SWEEPER" + "\020\002\022\020\n\014FLAG_SWEEPER\020\003*\237\001\n\014SweeperState\022\017\n" + "\013NULL_STATUS\020\000\022\010\n\004IDLE\020\001\022\r\n\tPRODUCING\020\002\022" + "\020\n\014CONSTRUCTING\020\003\022\016\n\nRECOVERING\020\004\022\r\n\tREC" + "YCLING\020\005\022\r\n\tATTACKING\020\006\022\014\n\010SWINGING\020\007\022\013\n" + "\007STUNNED\020\010\022\n\n\006MOVING\020\t*i\n\nWeaponType\022\024\n\020" + "NULL_WEAPON_TYPE\020\000\022\014\n\010LASERGUN\020\001\022\r\n\tPLAS" + "MAGUN\020\002\022\014\n\010SHELLGUN\020\003\022\016\n\nMISSILEGUN\020\004\022\n\n" + "\006ARCGUN\020\005*b\n\017ConstructorType\022\031\n\025NULL_CON" + "STRUCTOR_TYPE\020\000\022\020\n\014CONSTRUCTOR1\020\001\022\020\n\014CON" + "STRUCTOR2\020\002\022\020\n\014CONSTRUCTOR3\020\003*D\n\tArmorTy" + "pe\022\023\n\017NULL_ARMOR_TYPE\020\000\022\n\n\006ARMOR1\020\001\022\n\n\006A" + "RMOR2\020\002\022\n\n\006ARMOR3\020\003*I\n\nShieldType\022\024\n\020NUL" + "L_SHIELD_TYPE\020\000\022\013\n\007SHIELD1\020\001\022\013\n\007SHIELD2\020" + "\002\022\013\n\007SHIELD3\020\003*S\n\014ProducerType\022\026\n\022NULL_P" + "RODUCER_TYPE\020\000\022\r\n\tPRODUCER1\020\001\022\r\n\tPRODUCE" + "R2\020\002\022\r\n\tPRODUCER3\020\003*\216\003\n\nModuleType\022\024\n\020NU" + "LL_MODULE_TYPE\020\000\022\024\n\020MODULE_PRODUCER1\020\001\022\024" + "\n\020MODULE_PRODUCER2\020\002\022\024\n\020MODULE_PRODUCER3" + "\020\003\022\027\n\023MODULE_CONSTRUCTOR1\020\004\022\027\n\023MODULE_CO" + "NSTRUCTOR2\020\005\022\027\n\023MODULE_CONSTRUCTOR3\020\006\022\021\n" + "\rMODULE_ARMOR1\020\007\022\021\n\rMODULE_ARMOR2\020\010\022\021\n\rM" + "ODULE_ARMOR3\020\t\022\022\n\016MODULE_SHIELD1\020\n\022\022\n\016MO" + "DULE_SHIELD2\020\013\022\022\n\016MODULE_SHIELD3\020\014\022\023\n\017MO" + "DULE_LASERGUN\020\r\022\024\n\020MODULE_PLASMAGUN\020\016\022\023\n" + "\017MODULE_SHELLGUN\020\017\022\025\n\021MODULE_MISSILEGUN\020" + "\020\022\021\n\rMODULE_ARCGUN\020\021*Z\n\nBulletType\022\024\n\020NU" + "LL_BULLET_TYPE\020\000\022\t\n\005LASER\020\001\022\n\n\006PLASMA\020\002\022" + "\t\n\005SHELL\020\003\022\013\n\007MISSILE\020\004\022\007\n\003ARC\020\005*c\n\020Cons" + "tructionType\022\032\n\026NULL_CONSTRUCTION_TYPE\020\000" + "\022\017\n\013RECYCLEBANK\020\001\022\021\n\rCHARGESTATION\020\002\022\017\n\013" + "SIGNALTOWER\020\003*4\n\010NewsType\022\022\n\016NULL_NEWS_T" + "YPE\020\000\022\010\n\004TEXT\020\001\022\n\n\006BINARY\020\002*.\n\nPlayerTea" + "m\022\r\n\tNULL_TEAM\020\000\022\007\n\003RED\020\001\022\010\n\004BLUE\020\002b\006pro" + "to3"; static ::_pbi::once_flag descriptor_table_MessageType_2eproto_once; const ::_pbi::DescriptorTable descriptor_table_MessageType_2eproto = { false, false, - 1733, + 1763, descriptor_table_protodef_MessageType_2eproto, "MessageType.proto", &descriptor_table_MessageType_2eproto_once, @@ -180,12 +181,12 @@ namespace protobuf } } - const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* ShipType_descriptor() + const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* SweeperType_descriptor() { ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_MessageType_2eproto); return file_level_enum_descriptors_MessageType_2eproto[4]; } - bool ShipType_IsValid(int value) + bool SweeperType_IsValid(int value) { switch (value) { @@ -199,12 +200,12 @@ namespace protobuf } } - const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* ShipState_descriptor() + const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* SweeperState_descriptor() { ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_MessageType_2eproto); return file_level_enum_descriptors_MessageType_2eproto[5]; } - bool ShipState_IsValid(int value) + bool SweeperState_IsValid(int value) { switch (value) { diff --git a/CAPI/cpp/proto/MessageType.pb.h b/CAPI/cpp/proto/MessageType.pb.h index 8b4e82d4..d8d0ef43 100644 --- a/CAPI/cpp/proto/MessageType.pb.h +++ b/CAPI/cpp/proto/MessageType.pb.h @@ -85,19 +85,19 @@ namespace protobuf { NULL_PLACE_TYPE = 0, HOME = 1, - SPACE = 2, - RUIN = 3, - SHADOW = 4, - ASTEROID = 5, - RESOURCE = 6, + GROUND = 2, + WALL = 3, + GRASS = 4, + RIVER = 5, + GARBAGE = 6, CONSTRUCTION = 7, - WORMHOLE = 8, + BRIDGE = 8, PlaceType_INT_MIN_SENTINEL_DO_NOT_USE_ = std::numeric_limits::min(), PlaceType_INT_MAX_SENTINEL_DO_NOT_USE_ = std::numeric_limits::max() }; bool PlaceType_IsValid(int value); constexpr PlaceType PlaceType_MIN = NULL_PLACE_TYPE; - constexpr PlaceType PlaceType_MAX = WORMHOLE; + constexpr PlaceType PlaceType_MAX = BRIDGE; constexpr int PlaceType_ARRAYSIZE = PlaceType_MAX + 1; const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* PlaceType_descriptor(); @@ -150,7 +150,7 @@ namespace protobuf enum PlayerType : int { NULL_PLAYER_TYPE = 0, - SHIP = 1, + SWEEPER = 1, TEAM = 2, PlayerType_INT_MIN_SENTINEL_DO_NOT_USE_ = std::numeric_limits::min(), PlayerType_INT_MAX_SENTINEL_DO_NOT_USE_ = std::numeric_limits::max() @@ -177,38 +177,38 @@ namespace protobuf PlayerType_descriptor(), name, value ); } - enum ShipType : int + enum SweeperType : int { - NULL_SHIP_TYPE = 0, - CIVILIAN_SHIP = 1, - MILITARY_SHIP = 2, - FLAG_SHIP = 3, - ShipType_INT_MIN_SENTINEL_DO_NOT_USE_ = std::numeric_limits::min(), - ShipType_INT_MAX_SENTINEL_DO_NOT_USE_ = std::numeric_limits::max() + NULL_SWEEPER_TYPE = 0, + CIVILIAN_SWEEPER = 1, + MILITARY_SWEEPER = 2, + FLAG_SWEEPER = 3, + SweeperType_INT_MIN_SENTINEL_DO_NOT_USE_ = std::numeric_limits::min(), + SweeperType_INT_MAX_SENTINEL_DO_NOT_USE_ = std::numeric_limits::max() }; - bool ShipType_IsValid(int value); - constexpr ShipType ShipType_MIN = NULL_SHIP_TYPE; - constexpr ShipType ShipType_MAX = FLAG_SHIP; - constexpr int ShipType_ARRAYSIZE = ShipType_MAX + 1; + bool SweeperType_IsValid(int value); + constexpr SweeperType SweeperType_MIN = NULL_SWEEPER_TYPE; + constexpr SweeperType SweeperType_MAX = FLAG_SWEEPER; + constexpr int SweeperType_ARRAYSIZE = SweeperType_MAX + 1; - const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* ShipType_descriptor(); + const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* SweeperType_descriptor(); template - inline const std::string& ShipType_Name(T enum_t_value) + inline const std::string& SweeperType_Name(T enum_t_value) { - static_assert(::std::is_same::value || ::std::is_integral::value, "Incorrect type passed to function ShipType_Name."); + static_assert(::std::is_same::value || ::std::is_integral::value, "Incorrect type passed to function SweeperType_Name."); return ::PROTOBUF_NAMESPACE_ID::internal::NameOfEnum( - ShipType_descriptor(), enum_t_value + SweeperType_descriptor(), enum_t_value ); } - inline bool ShipType_Parse( - ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, ShipType* value + inline bool SweeperType_Parse( + ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, SweeperType* value ) { - return ::PROTOBUF_NAMESPACE_ID::internal::ParseNamedEnum( - ShipType_descriptor(), name, value + return ::PROTOBUF_NAMESPACE_ID::internal::ParseNamedEnum( + SweeperType_descriptor(), name, value ); } - enum ShipState : int + enum SweeperState : int { NULL_STATUS = 0, IDLE = 1, @@ -220,29 +220,29 @@ namespace protobuf SWINGING = 7, STUNNED = 8, MOVING = 9, - ShipState_INT_MIN_SENTINEL_DO_NOT_USE_ = std::numeric_limits::min(), - ShipState_INT_MAX_SENTINEL_DO_NOT_USE_ = std::numeric_limits::max() + SweeperState_INT_MIN_SENTINEL_DO_NOT_USE_ = std::numeric_limits::min(), + SweeperState_INT_MAX_SENTINEL_DO_NOT_USE_ = std::numeric_limits::max() }; - bool ShipState_IsValid(int value); - constexpr ShipState ShipState_MIN = NULL_STATUS; - constexpr ShipState ShipState_MAX = MOVING; - constexpr int ShipState_ARRAYSIZE = ShipState_MAX + 1; + bool SweeperState_IsValid(int value); + constexpr SweeperState SweeperState_MIN = NULL_STATUS; + constexpr SweeperState SweeperState_MAX = MOVING; + constexpr int SweeperState_ARRAYSIZE = SweeperState_MAX + 1; - const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* ShipState_descriptor(); + const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* SweeperState_descriptor(); template - inline const std::string& ShipState_Name(T enum_t_value) + inline const std::string& SweeperState_Name(T enum_t_value) { - static_assert(::std::is_same::value || ::std::is_integral::value, "Incorrect type passed to function ShipState_Name."); + static_assert(::std::is_same::value || ::std::is_integral::value, "Incorrect type passed to function SweeperState_Name."); return ::PROTOBUF_NAMESPACE_ID::internal::NameOfEnum( - ShipState_descriptor(), enum_t_value + SweeperState_descriptor(), enum_t_value ); } - inline bool ShipState_Parse( - ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, ShipState* value + inline bool SweeperState_Parse( + ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, SweeperState* value ) { - return ::PROTOBUF_NAMESPACE_ID::internal::ParseNamedEnum( - ShipState_descriptor(), name, value + return ::PROTOBUF_NAMESPACE_ID::internal::ParseNamedEnum( + SweeperState_descriptor(), name, value ); } enum WeaponType : int @@ -483,15 +483,15 @@ namespace protobuf enum ConstructionType : int { NULL_CONSTRUCTION_TYPE = 0, - FACTORY = 1, - COMMUNITY = 2, - FORT = 3, + RECYCLEBANK = 1, + CHARGESTATION = 2, + SIGNALTOWER = 3, ConstructionType_INT_MIN_SENTINEL_DO_NOT_USE_ = std::numeric_limits::min(), ConstructionType_INT_MAX_SENTINEL_DO_NOT_USE_ = std::numeric_limits::max() }; bool ConstructionType_IsValid(int value); constexpr ConstructionType ConstructionType_MIN = NULL_CONSTRUCTION_TYPE; - constexpr ConstructionType ConstructionType_MAX = FORT; + constexpr ConstructionType ConstructionType_MAX = SIGNALTOWER; constexpr int ConstructionType_ARRAYSIZE = ConstructionType_MAX + 1; const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* ConstructionType_descriptor(); @@ -628,22 +628,22 @@ inline const EnumDescriptor* GetEnumDescriptor<::protobuf::PlayerType>() return ::protobuf::PlayerType_descriptor(); } template<> -struct is_proto_enum<::protobuf::ShipType> : ::std::true_type +struct is_proto_enum<::protobuf::SweeperType> : ::std::true_type { }; template<> -inline const EnumDescriptor* GetEnumDescriptor<::protobuf::ShipType>() +inline const EnumDescriptor* GetEnumDescriptor<::protobuf::SweeperType>() { - return ::protobuf::ShipType_descriptor(); + return ::protobuf::SweeperType_descriptor(); } template<> -struct is_proto_enum<::protobuf::ShipState> : ::std::true_type +struct is_proto_enum<::protobuf::SweeperState> : ::std::true_type { }; template<> -inline const EnumDescriptor* GetEnumDescriptor<::protobuf::ShipState>() +inline const EnumDescriptor* GetEnumDescriptor<::protobuf::SweeperState>() { - return ::protobuf::ShipState_descriptor(); + return ::protobuf::SweeperState_descriptor(); } template<> struct is_proto_enum<::protobuf::WeaponType> : ::std::true_type diff --git a/CAPI/cpp/proto/Services.grpc.pb.cc b/CAPI/cpp/proto/Services.grpc.pb.cc index c1cbfd8b..6641ae3d 100644 --- a/CAPI/cpp/proto/Services.grpc.pb.cc +++ b/CAPI/cpp/proto/Services.grpc.pb.cc @@ -35,7 +35,7 @@ namespace protobuf "/protobuf.AvailableService/Send", "/protobuf.AvailableService/InstallModule", "/protobuf.AvailableService/Recycle", - "/protobuf.AvailableService/BuildShip", + "/protobuf.AvailableService/BuildSweeper", "/protobuf.AvailableService/EndAllAction", }; @@ -60,7 +60,7 @@ namespace protobuf rpcmethod_Send_(AvailableService_method_names[9], options.suffix_for_stats(), ::grpc::internal::RpcMethod::NORMAL_RPC, channel), rpcmethod_InstallModule_(AvailableService_method_names[10], options.suffix_for_stats(), ::grpc::internal::RpcMethod::NORMAL_RPC, channel), rpcmethod_Recycle_(AvailableService_method_names[11], options.suffix_for_stats(), ::grpc::internal::RpcMethod::NORMAL_RPC, channel), - rpcmethod_BuildShip_(AvailableService_method_names[12], options.suffix_for_stats(), ::grpc::internal::RpcMethod::NORMAL_RPC, channel), + rpcmethod_BuildSweeper_(AvailableService_method_names[12], options.suffix_for_stats(), ::grpc::internal::RpcMethod::NORMAL_RPC, channel), rpcmethod_EndAllAction_(AvailableService_method_names[13], options.suffix_for_stats(), ::grpc::internal::RpcMethod::NORMAL_RPC, channel) { } @@ -393,30 +393,30 @@ namespace protobuf return result; } - ::grpc::Status AvailableService::Stub::BuildShip(::grpc::ClientContext* context, const ::protobuf::BuildShipMsg& request, ::protobuf::BoolRes* response) + ::grpc::Status AvailableService::Stub::BuildSweeper(::grpc::ClientContext* context, const ::protobuf::BuildSweeperMsg& request, ::protobuf::BoolRes* response) { - return ::grpc::internal::BlockingUnaryCall<::protobuf::BuildShipMsg, ::protobuf::BoolRes, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), rpcmethod_BuildShip_, context, request, response); + return ::grpc::internal::BlockingUnaryCall<::protobuf::BuildSweeperMsg, ::protobuf::BoolRes, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), rpcmethod_BuildSweeper_, context, request, response); } - void AvailableService::Stub::async::BuildShip(::grpc::ClientContext* context, const ::protobuf::BuildShipMsg* request, ::protobuf::BoolRes* response, std::function f) + void AvailableService::Stub::async::BuildSweeper(::grpc::ClientContext* context, const ::protobuf::BuildSweeperMsg* request, ::protobuf::BoolRes* response, std::function f) { - ::grpc::internal::CallbackUnaryCall<::protobuf::BuildShipMsg, ::protobuf::BoolRes, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_BuildShip_, context, request, response, std::move(f)); + ::grpc::internal::CallbackUnaryCall<::protobuf::BuildSweeperMsg, ::protobuf::BoolRes, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_BuildSweeper_, context, request, response, std::move(f)); } - void AvailableService::Stub::async::BuildShip(::grpc::ClientContext* context, const ::protobuf::BuildShipMsg* request, ::protobuf::BoolRes* response, ::grpc::ClientUnaryReactor* reactor) + void AvailableService::Stub::async::BuildSweeper(::grpc::ClientContext* context, const ::protobuf::BuildSweeperMsg* request, ::protobuf::BoolRes* response, ::grpc::ClientUnaryReactor* reactor) { - ::grpc::internal::ClientCallbackUnaryFactory::Create<::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_BuildShip_, context, request, response, reactor); + ::grpc::internal::ClientCallbackUnaryFactory::Create<::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_BuildSweeper_, context, request, response, reactor); } - ::grpc::ClientAsyncResponseReader<::protobuf::BoolRes>* AvailableService::Stub::PrepareAsyncBuildShipRaw(::grpc::ClientContext* context, const ::protobuf::BuildShipMsg& request, ::grpc::CompletionQueue* cq) + ::grpc::ClientAsyncResponseReader<::protobuf::BoolRes>* AvailableService::Stub::PrepareAsyncBuildSweeperRaw(::grpc::ClientContext* context, const ::protobuf::BuildSweeperMsg& request, ::grpc::CompletionQueue* cq) { - return ::grpc::internal::ClientAsyncResponseReaderHelper::Create<::protobuf::BoolRes, ::protobuf::BuildShipMsg, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), cq, rpcmethod_BuildShip_, context, request); + return ::grpc::internal::ClientAsyncResponseReaderHelper::Create<::protobuf::BoolRes, ::protobuf::BuildSweeperMsg, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), cq, rpcmethod_BuildSweeper_, context, request); } - ::grpc::ClientAsyncResponseReader<::protobuf::BoolRes>* AvailableService::Stub::AsyncBuildShipRaw(::grpc::ClientContext* context, const ::protobuf::BuildShipMsg& request, ::grpc::CompletionQueue* cq) + ::grpc::ClientAsyncResponseReader<::protobuf::BoolRes>* AvailableService::Stub::AsyncBuildSweeperRaw(::grpc::ClientContext* context, const ::protobuf::BuildSweeperMsg& request, ::grpc::CompletionQueue* cq) { auto* result = - this->PrepareAsyncBuildShipRaw(context, request, cq); + this->PrepareAsyncBuildSweeperRaw(context, request, cq); result->StartCall(); return result; } @@ -622,13 +622,13 @@ namespace protobuf AddMethod(new ::grpc::internal::RpcServiceMethod( AvailableService_method_names[12], ::grpc::internal::RpcMethod::NORMAL_RPC, - new ::grpc::internal::RpcMethodHandler( + new ::grpc::internal::RpcMethodHandler( [](AvailableService::Service* service, ::grpc::ServerContext* ctx, - const ::protobuf::BuildShipMsg* req, + const ::protobuf::BuildSweeperMsg* req, ::protobuf::BoolRes* resp) { - return service->BuildShip(ctx, req, resp); + return service->BuildSweeper(ctx, req, resp); }, this ) @@ -749,7 +749,7 @@ namespace protobuf return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } - ::grpc::Status AvailableService::Service::BuildShip(::grpc::ServerContext* context, const ::protobuf::BuildShipMsg* request, ::protobuf::BoolRes* response) + ::grpc::Status AvailableService::Service::BuildSweeper(::grpc::ServerContext* context, const ::protobuf::BuildSweeperMsg* request, ::protobuf::BoolRes* response) { (void)context; (void)request; diff --git a/CAPI/cpp/proto/Services.grpc.pb.h b/CAPI/cpp/proto/Services.grpc.pb.h index 3fdff8d0..2378a538 100644 --- a/CAPI/cpp/proto/Services.grpc.pb.h +++ b/CAPI/cpp/proto/Services.grpc.pb.h @@ -164,14 +164,14 @@ namespace protobuf { return std::unique_ptr<::grpc::ClientAsyncResponseReaderInterface<::protobuf::BoolRes>>(PrepareAsyncRecycleRaw(context, request, cq)); } - virtual ::grpc::Status BuildShip(::grpc::ClientContext* context, const ::protobuf::BuildShipMsg& request, ::protobuf::BoolRes* response) = 0; - std::unique_ptr<::grpc::ClientAsyncResponseReaderInterface<::protobuf::BoolRes>> AsyncBuildShip(::grpc::ClientContext* context, const ::protobuf::BuildShipMsg& request, ::grpc::CompletionQueue* cq) + virtual ::grpc::Status BuildSweeper(::grpc::ClientContext* context, const ::protobuf::BuildSweeperMsg& request, ::protobuf::BoolRes* response) = 0; + std::unique_ptr<::grpc::ClientAsyncResponseReaderInterface<::protobuf::BoolRes>> AsyncBuildSweeper(::grpc::ClientContext* context, const ::protobuf::BuildSweeperMsg& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr<::grpc::ClientAsyncResponseReaderInterface<::protobuf::BoolRes>>(AsyncBuildShipRaw(context, request, cq)); + return std::unique_ptr<::grpc::ClientAsyncResponseReaderInterface<::protobuf::BoolRes>>(AsyncBuildSweeperRaw(context, request, cq)); } - std::unique_ptr<::grpc::ClientAsyncResponseReaderInterface<::protobuf::BoolRes>> PrepareAsyncBuildShip(::grpc::ClientContext* context, const ::protobuf::BuildShipMsg& request, ::grpc::CompletionQueue* cq) + std::unique_ptr<::grpc::ClientAsyncResponseReaderInterface<::protobuf::BoolRes>> PrepareAsyncBuildSweeper(::grpc::ClientContext* context, const ::protobuf::BuildSweeperMsg& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr<::grpc::ClientAsyncResponseReaderInterface<::protobuf::BoolRes>>(PrepareAsyncBuildShipRaw(context, request, cq)); + return std::unique_ptr<::grpc::ClientAsyncResponseReaderInterface<::protobuf::BoolRes>>(PrepareAsyncBuildSweeperRaw(context, request, cq)); } virtual ::grpc::Status EndAllAction(::grpc::ClientContext* context, const ::protobuf::IDMsg& request, ::protobuf::BoolRes* response) = 0; std::unique_ptr<::grpc::ClientAsyncResponseReaderInterface<::protobuf::BoolRes>> AsyncEndAllAction(::grpc::ClientContext* context, const ::protobuf::IDMsg& request, ::grpc::CompletionQueue* cq) @@ -224,8 +224,8 @@ namespace protobuf virtual void InstallModule(::grpc::ClientContext* context, const ::protobuf::InstallMsg* request, ::protobuf::BoolRes* response, ::grpc::ClientUnaryReactor* reactor) = 0; virtual void Recycle(::grpc::ClientContext* context, const ::protobuf::IDMsg* request, ::protobuf::BoolRes* response, std::function) = 0; virtual void Recycle(::grpc::ClientContext* context, const ::protobuf::IDMsg* request, ::protobuf::BoolRes* response, ::grpc::ClientUnaryReactor* reactor) = 0; - virtual void BuildShip(::grpc::ClientContext* context, const ::protobuf::BuildShipMsg* request, ::protobuf::BoolRes* response, std::function) = 0; - virtual void BuildShip(::grpc::ClientContext* context, const ::protobuf::BuildShipMsg* request, ::protobuf::BoolRes* response, ::grpc::ClientUnaryReactor* reactor) = 0; + virtual void BuildSweeper(::grpc::ClientContext* context, const ::protobuf::BuildSweeperMsg* request, ::protobuf::BoolRes* response, std::function) = 0; + virtual void BuildSweeper(::grpc::ClientContext* context, const ::protobuf::BuildSweeperMsg* request, ::protobuf::BoolRes* response, ::grpc::ClientUnaryReactor* reactor) = 0; virtual void EndAllAction(::grpc::ClientContext* context, const ::protobuf::IDMsg* request, ::protobuf::BoolRes* response, std::function) = 0; virtual void EndAllAction(::grpc::ClientContext* context, const ::protobuf::IDMsg* request, ::protobuf::BoolRes* response, ::grpc::ClientUnaryReactor* reactor) = 0; // 结束所有动作 @@ -266,8 +266,8 @@ namespace protobuf virtual ::grpc::ClientAsyncResponseReaderInterface<::protobuf::BoolRes>* PrepareAsyncInstallModuleRaw(::grpc::ClientContext* context, const ::protobuf::InstallMsg& request, ::grpc::CompletionQueue* cq) = 0; virtual ::grpc::ClientAsyncResponseReaderInterface<::protobuf::BoolRes>* AsyncRecycleRaw(::grpc::ClientContext* context, const ::protobuf::IDMsg& request, ::grpc::CompletionQueue* cq) = 0; virtual ::grpc::ClientAsyncResponseReaderInterface<::protobuf::BoolRes>* PrepareAsyncRecycleRaw(::grpc::ClientContext* context, const ::protobuf::IDMsg& request, ::grpc::CompletionQueue* cq) = 0; - virtual ::grpc::ClientAsyncResponseReaderInterface<::protobuf::BoolRes>* AsyncBuildShipRaw(::grpc::ClientContext* context, const ::protobuf::BuildShipMsg& request, ::grpc::CompletionQueue* cq) = 0; - virtual ::grpc::ClientAsyncResponseReaderInterface<::protobuf::BoolRes>* PrepareAsyncBuildShipRaw(::grpc::ClientContext* context, const ::protobuf::BuildShipMsg& request, ::grpc::CompletionQueue* cq) = 0; + virtual ::grpc::ClientAsyncResponseReaderInterface<::protobuf::BoolRes>* AsyncBuildSweeperRaw(::grpc::ClientContext* context, const ::protobuf::BuildSweeperMsg& request, ::grpc::CompletionQueue* cq) = 0; + virtual ::grpc::ClientAsyncResponseReaderInterface<::protobuf::BoolRes>* PrepareAsyncBuildSweeperRaw(::grpc::ClientContext* context, const ::protobuf::BuildSweeperMsg& request, ::grpc::CompletionQueue* cq) = 0; virtual ::grpc::ClientAsyncResponseReaderInterface<::protobuf::BoolRes>* AsyncEndAllActionRaw(::grpc::ClientContext* context, const ::protobuf::IDMsg& request, ::grpc::CompletionQueue* cq) = 0; virtual ::grpc::ClientAsyncResponseReaderInterface<::protobuf::BoolRes>* PrepareAsyncEndAllActionRaw(::grpc::ClientContext* context, const ::protobuf::IDMsg& request, ::grpc::CompletionQueue* cq) = 0; }; @@ -386,14 +386,14 @@ namespace protobuf { return std::unique_ptr<::grpc::ClientAsyncResponseReader<::protobuf::BoolRes>>(PrepareAsyncRecycleRaw(context, request, cq)); } - ::grpc::Status BuildShip(::grpc::ClientContext* context, const ::protobuf::BuildShipMsg& request, ::protobuf::BoolRes* response) override; - std::unique_ptr<::grpc::ClientAsyncResponseReader<::protobuf::BoolRes>> AsyncBuildShip(::grpc::ClientContext* context, const ::protobuf::BuildShipMsg& request, ::grpc::CompletionQueue* cq) + ::grpc::Status BuildSweeper(::grpc::ClientContext* context, const ::protobuf::BuildSweeperMsg& request, ::protobuf::BoolRes* response) override; + std::unique_ptr<::grpc::ClientAsyncResponseReader<::protobuf::BoolRes>> AsyncBuildSweeper(::grpc::ClientContext* context, const ::protobuf::BuildSweeperMsg& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr<::grpc::ClientAsyncResponseReader<::protobuf::BoolRes>>(AsyncBuildShipRaw(context, request, cq)); + return std::unique_ptr<::grpc::ClientAsyncResponseReader<::protobuf::BoolRes>>(AsyncBuildSweeperRaw(context, request, cq)); } - std::unique_ptr<::grpc::ClientAsyncResponseReader<::protobuf::BoolRes>> PrepareAsyncBuildShip(::grpc::ClientContext* context, const ::protobuf::BuildShipMsg& request, ::grpc::CompletionQueue* cq) + std::unique_ptr<::grpc::ClientAsyncResponseReader<::protobuf::BoolRes>> PrepareAsyncBuildSweeper(::grpc::ClientContext* context, const ::protobuf::BuildSweeperMsg& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr<::grpc::ClientAsyncResponseReader<::protobuf::BoolRes>>(PrepareAsyncBuildShipRaw(context, request, cq)); + return std::unique_ptr<::grpc::ClientAsyncResponseReader<::protobuf::BoolRes>>(PrepareAsyncBuildSweeperRaw(context, request, cq)); } ::grpc::Status EndAllAction(::grpc::ClientContext* context, const ::protobuf::IDMsg& request, ::protobuf::BoolRes* response) override; std::unique_ptr<::grpc::ClientAsyncResponseReader<::protobuf::BoolRes>> AsyncEndAllAction(::grpc::ClientContext* context, const ::protobuf::IDMsg& request, ::grpc::CompletionQueue* cq) @@ -431,8 +431,8 @@ namespace protobuf void InstallModule(::grpc::ClientContext* context, const ::protobuf::InstallMsg* request, ::protobuf::BoolRes* response, ::grpc::ClientUnaryReactor* reactor) override; void Recycle(::grpc::ClientContext* context, const ::protobuf::IDMsg* request, ::protobuf::BoolRes* response, std::function) override; void Recycle(::grpc::ClientContext* context, const ::protobuf::IDMsg* request, ::protobuf::BoolRes* response, ::grpc::ClientUnaryReactor* reactor) override; - void BuildShip(::grpc::ClientContext* context, const ::protobuf::BuildShipMsg* request, ::protobuf::BoolRes* response, std::function) override; - void BuildShip(::grpc::ClientContext* context, const ::protobuf::BuildShipMsg* request, ::protobuf::BoolRes* response, ::grpc::ClientUnaryReactor* reactor) override; + void BuildSweeper(::grpc::ClientContext* context, const ::protobuf::BuildSweeperMsg* request, ::protobuf::BoolRes* response, std::function) override; + void BuildSweeper(::grpc::ClientContext* context, const ::protobuf::BuildSweeperMsg* request, ::protobuf::BoolRes* response, ::grpc::ClientUnaryReactor* reactor) override; void EndAllAction(::grpc::ClientContext* context, const ::protobuf::IDMsg* request, ::protobuf::BoolRes* response, std::function) override; void EndAllAction(::grpc::ClientContext* context, const ::protobuf::IDMsg* request, ::protobuf::BoolRes* response, ::grpc::ClientUnaryReactor* reactor) override; @@ -484,8 +484,8 @@ namespace protobuf ::grpc::ClientAsyncResponseReader<::protobuf::BoolRes>* PrepareAsyncInstallModuleRaw(::grpc::ClientContext* context, const ::protobuf::InstallMsg& request, ::grpc::CompletionQueue* cq) override; ::grpc::ClientAsyncResponseReader<::protobuf::BoolRes>* AsyncRecycleRaw(::grpc::ClientContext* context, const ::protobuf::IDMsg& request, ::grpc::CompletionQueue* cq) override; ::grpc::ClientAsyncResponseReader<::protobuf::BoolRes>* PrepareAsyncRecycleRaw(::grpc::ClientContext* context, const ::protobuf::IDMsg& request, ::grpc::CompletionQueue* cq) override; - ::grpc::ClientAsyncResponseReader<::protobuf::BoolRes>* AsyncBuildShipRaw(::grpc::ClientContext* context, const ::protobuf::BuildShipMsg& request, ::grpc::CompletionQueue* cq) override; - ::grpc::ClientAsyncResponseReader<::protobuf::BoolRes>* PrepareAsyncBuildShipRaw(::grpc::ClientContext* context, const ::protobuf::BuildShipMsg& request, ::grpc::CompletionQueue* cq) override; + ::grpc::ClientAsyncResponseReader<::protobuf::BoolRes>* AsyncBuildSweeperRaw(::grpc::ClientContext* context, const ::protobuf::BuildSweeperMsg& request, ::grpc::CompletionQueue* cq) override; + ::grpc::ClientAsyncResponseReader<::protobuf::BoolRes>* PrepareAsyncBuildSweeperRaw(::grpc::ClientContext* context, const ::protobuf::BuildSweeperMsg& request, ::grpc::CompletionQueue* cq) override; ::grpc::ClientAsyncResponseReader<::protobuf::BoolRes>* AsyncEndAllActionRaw(::grpc::ClientContext* context, const ::protobuf::IDMsg& request, ::grpc::CompletionQueue* cq) override; ::grpc::ClientAsyncResponseReader<::protobuf::BoolRes>* PrepareAsyncEndAllActionRaw(::grpc::ClientContext* context, const ::protobuf::IDMsg& request, ::grpc::CompletionQueue* cq) override; const ::grpc::internal::RpcMethod rpcmethod_TryConnection_; @@ -500,7 +500,7 @@ namespace protobuf const ::grpc::internal::RpcMethod rpcmethod_Send_; const ::grpc::internal::RpcMethod rpcmethod_InstallModule_; const ::grpc::internal::RpcMethod rpcmethod_Recycle_; - const ::grpc::internal::RpcMethod rpcmethod_BuildShip_; + const ::grpc::internal::RpcMethod rpcmethod_BuildSweeper_; const ::grpc::internal::RpcMethod rpcmethod_EndAllAction_; }; static std::unique_ptr NewStub(const std::shared_ptr<::grpc::ChannelInterface>& channel, const ::grpc::StubOptions& options = ::grpc::StubOptions()); @@ -534,7 +534,7 @@ namespace protobuf // 大本营 virtual ::grpc::Status InstallModule(::grpc::ServerContext* context, const ::protobuf::InstallMsg* request, ::protobuf::BoolRes* response); virtual ::grpc::Status Recycle(::grpc::ServerContext* context, const ::protobuf::IDMsg* request, ::protobuf::BoolRes* response); - virtual ::grpc::Status BuildShip(::grpc::ServerContext* context, const ::protobuf::BuildShipMsg* request, ::protobuf::BoolRes* response); + virtual ::grpc::Status BuildSweeper(::grpc::ServerContext* context, const ::protobuf::BuildSweeperMsg* request, ::protobuf::BoolRes* response); virtual ::grpc::Status EndAllAction(::grpc::ServerContext* context, const ::protobuf::IDMsg* request, ::protobuf::BoolRes* response); // 结束所有动作 }; @@ -875,7 +875,7 @@ namespace protobuf } }; template - class WithAsyncMethod_BuildShip : public BaseClass + class WithAsyncMethod_BuildSweeper : public BaseClass { private: void BaseClassMustBeDerivedFromService(const Service* /*service*/) @@ -883,21 +883,21 @@ namespace protobuf } public: - WithAsyncMethod_BuildShip() + WithAsyncMethod_BuildSweeper() { ::grpc::Service::MarkMethodAsync(12); } - ~WithAsyncMethod_BuildShip() override + ~WithAsyncMethod_BuildSweeper() override { BaseClassMustBeDerivedFromService(this); } // disable synchronous version of this method - ::grpc::Status BuildShip(::grpc::ServerContext* /*context*/, const ::protobuf::BuildShipMsg* /*request*/, ::protobuf::BoolRes* /*response*/) override + ::grpc::Status BuildSweeper(::grpc::ServerContext* /*context*/, const ::protobuf::BuildSweeperMsg* /*request*/, ::protobuf::BoolRes* /*response*/) override { abort(); return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } - void RequestBuildShip(::grpc::ServerContext* context, ::protobuf::BuildShipMsg* request, ::grpc::ServerAsyncResponseWriter<::protobuf::BoolRes>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void* tag) + void RequestBuildSweeper(::grpc::ServerContext* context, ::protobuf::BuildSweeperMsg* request, ::grpc::ServerAsyncResponseWriter<::protobuf::BoolRes>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void* tag) { ::grpc::Service::RequestAsyncUnary(12, context, request, response, new_call_cq, notification_cq, tag); } @@ -930,7 +930,7 @@ namespace protobuf ::grpc::Service::RequestAsyncUnary(13, context, request, response, new_call_cq, notification_cq, tag); } }; - typedef WithAsyncMethod_TryConnection>>>>>>>>>>>>> AsyncService; + typedef WithAsyncMethod_TryConnection>>>>>>>>>>>>> AsyncService; template class WithCallbackMethod_TryConnection : public BaseClass { @@ -1392,7 +1392,7 @@ namespace protobuf } }; template - class WithCallbackMethod_BuildShip : public BaseClass + class WithCallbackMethod_BuildSweeper : public BaseClass { private: void BaseClassMustBeDerivedFromService(const Service* /*service*/) @@ -1400,31 +1400,31 @@ namespace protobuf } public: - WithCallbackMethod_BuildShip() + WithCallbackMethod_BuildSweeper() { - ::grpc::Service::MarkMethodCallback(12, new ::grpc::internal::CallbackUnaryHandler<::protobuf::BuildShipMsg, ::protobuf::BoolRes>([this](::grpc::CallbackServerContext* context, const ::protobuf::BuildShipMsg* request, ::protobuf::BoolRes* response) - { return this->BuildShip(context, request, response); })); + ::grpc::Service::MarkMethodCallback(12, new ::grpc::internal::CallbackUnaryHandler<::protobuf::BuildSweeperMsg, ::protobuf::BoolRes>([this](::grpc::CallbackServerContext* context, const ::protobuf::BuildSweeperMsg* request, ::protobuf::BoolRes* response) + { return this->BuildSweeper(context, request, response); })); } - void SetMessageAllocatorFor_BuildShip( - ::grpc::MessageAllocator<::protobuf::BuildShipMsg, ::protobuf::BoolRes>* allocator + void SetMessageAllocatorFor_BuildSweeper( + ::grpc::MessageAllocator<::protobuf::BuildSweeperMsg, ::protobuf::BoolRes>* allocator ) { ::grpc::internal::MethodHandler* const handler = ::grpc::Service::GetHandler(12); - static_cast<::grpc::internal::CallbackUnaryHandler<::protobuf::BuildShipMsg, ::protobuf::BoolRes>*>(handler) + static_cast<::grpc::internal::CallbackUnaryHandler<::protobuf::BuildSweeperMsg, ::protobuf::BoolRes>*>(handler) ->SetMessageAllocator(allocator); } - ~WithCallbackMethod_BuildShip() override + ~WithCallbackMethod_BuildSweeper() override { BaseClassMustBeDerivedFromService(this); } // disable synchronous version of this method - ::grpc::Status BuildShip(::grpc::ServerContext* /*context*/, const ::protobuf::BuildShipMsg* /*request*/, ::protobuf::BoolRes* /*response*/) override + ::grpc::Status BuildSweeper(::grpc::ServerContext* /*context*/, const ::protobuf::BuildSweeperMsg* /*request*/, ::protobuf::BoolRes* /*response*/) override { abort(); return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } - virtual ::grpc::ServerUnaryReactor* BuildShip( - ::grpc::CallbackServerContext* /*context*/, const ::protobuf::BuildShipMsg* /*request*/, ::protobuf::BoolRes* /*response*/ + virtual ::grpc::ServerUnaryReactor* BuildSweeper( + ::grpc::CallbackServerContext* /*context*/, const ::protobuf::BuildSweeperMsg* /*request*/, ::protobuf::BoolRes* /*response*/ ) { return nullptr; @@ -1469,7 +1469,7 @@ namespace protobuf return nullptr; } }; - typedef WithCallbackMethod_TryConnection>>>>>>>>>>>>> CallbackService; + typedef WithCallbackMethod_TryConnection>>>>>>>>>>>>> CallbackService; typedef CallbackService ExperimentalCallbackService; template class WithGenericMethod_TryConnection : public BaseClass @@ -1760,7 +1760,7 @@ namespace protobuf } }; template - class WithGenericMethod_BuildShip : public BaseClass + class WithGenericMethod_BuildSweeper : public BaseClass { private: void BaseClassMustBeDerivedFromService(const Service* /*service*/) @@ -1768,16 +1768,16 @@ namespace protobuf } public: - WithGenericMethod_BuildShip() + WithGenericMethod_BuildSweeper() { ::grpc::Service::MarkMethodGeneric(12); } - ~WithGenericMethod_BuildShip() override + ~WithGenericMethod_BuildSweeper() override { BaseClassMustBeDerivedFromService(this); } // disable synchronous version of this method - ::grpc::Status BuildShip(::grpc::ServerContext* /*context*/, const ::protobuf::BuildShipMsg* /*request*/, ::protobuf::BoolRes* /*response*/) override + ::grpc::Status BuildSweeper(::grpc::ServerContext* /*context*/, const ::protobuf::BuildSweeperMsg* /*request*/, ::protobuf::BoolRes* /*response*/) override { abort(); return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); @@ -2144,7 +2144,7 @@ namespace protobuf } }; template - class WithRawMethod_BuildShip : public BaseClass + class WithRawMethod_BuildSweeper : public BaseClass { private: void BaseClassMustBeDerivedFromService(const Service* /*service*/) @@ -2152,21 +2152,21 @@ namespace protobuf } public: - WithRawMethod_BuildShip() + WithRawMethod_BuildSweeper() { ::grpc::Service::MarkMethodRaw(12); } - ~WithRawMethod_BuildShip() override + ~WithRawMethod_BuildSweeper() override { BaseClassMustBeDerivedFromService(this); } // disable synchronous version of this method - ::grpc::Status BuildShip(::grpc::ServerContext* /*context*/, const ::protobuf::BuildShipMsg* /*request*/, ::protobuf::BoolRes* /*response*/) override + ::grpc::Status BuildSweeper(::grpc::ServerContext* /*context*/, const ::protobuf::BuildSweeperMsg* /*request*/, ::protobuf::BoolRes* /*response*/) override { abort(); return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } - void RequestBuildShip(::grpc::ServerContext* context, ::grpc::ByteBuffer* request, ::grpc::ServerAsyncResponseWriter<::grpc::ByteBuffer>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void* tag) + void RequestBuildSweeper(::grpc::ServerContext* context, ::grpc::ByteBuffer* request, ::grpc::ServerAsyncResponseWriter<::grpc::ByteBuffer>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void* tag) { ::grpc::Service::RequestAsyncUnary(12, context, request, response, new_call_cq, notification_cq, tag); } @@ -2572,7 +2572,7 @@ namespace protobuf } }; template - class WithRawCallbackMethod_BuildShip : public BaseClass + class WithRawCallbackMethod_BuildSweeper : public BaseClass { private: void BaseClassMustBeDerivedFromService(const Service* /*service*/) @@ -2580,22 +2580,22 @@ namespace protobuf } public: - WithRawCallbackMethod_BuildShip() + WithRawCallbackMethod_BuildSweeper() { ::grpc::Service::MarkMethodRawCallback(12, new ::grpc::internal::CallbackUnaryHandler<::grpc::ByteBuffer, ::grpc::ByteBuffer>([this](::grpc::CallbackServerContext* context, const ::grpc::ByteBuffer* request, ::grpc::ByteBuffer* response) - { return this->BuildShip(context, request, response); })); + { return this->BuildSweeper(context, request, response); })); } - ~WithRawCallbackMethod_BuildShip() override + ~WithRawCallbackMethod_BuildSweeper() override { BaseClassMustBeDerivedFromService(this); } // disable synchronous version of this method - ::grpc::Status BuildShip(::grpc::ServerContext* /*context*/, const ::protobuf::BuildShipMsg* /*request*/, ::protobuf::BoolRes* /*response*/) override + ::grpc::Status BuildSweeper(::grpc::ServerContext* /*context*/, const ::protobuf::BuildSweeperMsg* /*request*/, ::protobuf::BoolRes* /*response*/) override { abort(); return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } - virtual ::grpc::ServerUnaryReactor* BuildShip( + virtual ::grpc::ServerUnaryReactor* BuildSweeper( ::grpc::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/ ) { @@ -2931,7 +2931,7 @@ namespace protobuf virtual ::grpc::Status StreamedRecycle(::grpc::ServerContext* context, ::grpc::ServerUnaryStreamer<::protobuf::IDMsg, ::protobuf::BoolRes>* server_unary_streamer) = 0; }; template - class WithStreamedUnaryMethod_BuildShip : public BaseClass + class WithStreamedUnaryMethod_BuildSweeper : public BaseClass { private: void BaseClassMustBeDerivedFromService(const Service* /*service*/) @@ -2939,23 +2939,23 @@ namespace protobuf } public: - WithStreamedUnaryMethod_BuildShip() + WithStreamedUnaryMethod_BuildSweeper() { - ::grpc::Service::MarkMethodStreamed(12, new ::grpc::internal::StreamedUnaryHandler<::protobuf::BuildShipMsg, ::protobuf::BoolRes>([this](::grpc::ServerContext* context, ::grpc::ServerUnaryStreamer<::protobuf::BuildShipMsg, ::protobuf::BoolRes>* streamer) - { return this->StreamedBuildShip(context, streamer); })); + ::grpc::Service::MarkMethodStreamed(12, new ::grpc::internal::StreamedUnaryHandler<::protobuf::BuildSweeperMsg, ::protobuf::BoolRes>([this](::grpc::ServerContext* context, ::grpc::ServerUnaryStreamer<::protobuf::BuildSweeperMsg, ::protobuf::BoolRes>* streamer) + { return this->StreamedBuildSweeper(context, streamer); })); } - ~WithStreamedUnaryMethod_BuildShip() override + ~WithStreamedUnaryMethod_BuildSweeper() override { BaseClassMustBeDerivedFromService(this); } // disable regular version of this method - ::grpc::Status BuildShip(::grpc::ServerContext* /*context*/, const ::protobuf::BuildShipMsg* /*request*/, ::protobuf::BoolRes* /*response*/) override + ::grpc::Status BuildSweeper(::grpc::ServerContext* /*context*/, const ::protobuf::BuildSweeperMsg* /*request*/, ::protobuf::BoolRes* /*response*/) override { abort(); return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); } // replace default version of method with streamed unary - virtual ::grpc::Status StreamedBuildShip(::grpc::ServerContext* context, ::grpc::ServerUnaryStreamer<::protobuf::BuildShipMsg, ::protobuf::BoolRes>* server_unary_streamer) = 0; + virtual ::grpc::Status StreamedBuildSweeper(::grpc::ServerContext* context, ::grpc::ServerUnaryStreamer<::protobuf::BuildSweeperMsg, ::protobuf::BoolRes>* server_unary_streamer) = 0; }; template class WithStreamedUnaryMethod_EndAllAction : public BaseClass @@ -2984,7 +2984,7 @@ namespace protobuf // replace default version of method with streamed unary virtual ::grpc::Status StreamedEndAllAction(::grpc::ServerContext* context, ::grpc::ServerUnaryStreamer<::protobuf::IDMsg, ::protobuf::BoolRes>* server_unary_streamer) = 0; }; - typedef WithStreamedUnaryMethod_TryConnection>>>>>>>>>>>> StreamedUnaryService; + typedef WithStreamedUnaryMethod_TryConnection>>>>>>>>>>>> StreamedUnaryService; template class WithSplitStreamingMethod_AddPlayer : public BaseClass { @@ -3013,7 +3013,7 @@ namespace protobuf virtual ::grpc::Status StreamedAddPlayer(::grpc::ServerContext* context, ::grpc::ServerSplitStreamer<::protobuf::PlayerMsg, ::protobuf::MessageToClient>* server_split_streamer) = 0; }; typedef WithSplitStreamingMethod_AddPlayer SplitStreamedService; - typedef WithStreamedUnaryMethod_TryConnection>>>>>>>>>>>>> StreamedService; + typedef WithStreamedUnaryMethod_TryConnection>>>>>>>>>>>>> StreamedService; }; } // namespace protobuf diff --git a/CAPI/cpp/proto/Services.pb.cc b/CAPI/cpp/proto/Services.pb.cc index 54eabe0f..7ab5d69c 100644 --- a/CAPI/cpp/proto/Services.pb.cc +++ b/CAPI/cpp/proto/Services.pb.cc @@ -31,7 +31,7 @@ static constexpr ::_pb::Message* const* file_default_instances = nullptr; const char descriptor_table_protodef_Services_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = "\n\016Services.proto\022\010protobuf\032\025Message2Clie" - "nts.proto\032\024Message2Server.proto2\363\005\n\020Avai" + "nts.proto\032\024Message2Server.proto2\371\005\n\020Avai" "lableService\0223\n\rTryConnection\022\017.protobuf" ".IDMsg\032\021.protobuf.BoolRes\022=\n\tAddPlayer\022\023" ".protobuf.PlayerMsg\032\031.protobuf.MessageTo" @@ -48,9 +48,10 @@ const char descriptor_table_protodef_Services_2eproto[] PROTOBUF_SECTION_VARIABL "protobuf.BoolRes\0228\n\rInstallModule\022\024.prot" "obuf.InstallMsg\032\021.protobuf.BoolRes\022-\n\007Re" "cycle\022\017.protobuf.IDMsg\032\021.protobuf.BoolRe" - "s\0226\n\tBuildShip\022\026.protobuf.BuildShipMsg\032\021" - ".protobuf.BoolRes\0222\n\014EndAllAction\022\017.prot" - "obuf.IDMsg\032\021.protobuf.BoolResb\006proto3"; + "s\022<\n\014BuildSweeper\022\031.protobuf.BuildSweepe" + "rMsg\032\021.protobuf.BoolRes\0222\n\014EndAllAction\022" + "\017.protobuf.IDMsg\032\021.protobuf.BoolResb\006pro" + "to3"; static const ::_pbi::DescriptorTable* const descriptor_table_Services_2eproto_deps[2] = { &::descriptor_table_Message2Clients_2eproto, &::descriptor_table_Message2Server_2eproto, @@ -59,7 +60,7 @@ static ::_pbi::once_flag descriptor_table_Services_2eproto_once; const ::_pbi::DescriptorTable descriptor_table_Services_2eproto = { false, false, - 837, + 843, descriptor_table_protodef_Services_2eproto, "Services.proto", &descriptor_table_Services_2eproto_once, diff --git a/dependency/proto/Message2Clients.proto b/dependency/proto/Message2Clients.proto index 99f058f0..85235443 100755 --- a/dependency/proto/Message2Clients.proto +++ b/dependency/proto/Message2Clients.proto @@ -4,7 +4,7 @@ package protobuf; import "MessageType.proto"; -message MessageOfShip +message MessageOfSweeper { int32 x = 1; int32 y = 2; @@ -15,8 +15,8 @@ message MessageOfShip int64 team_id = 7; int64 player_id = 8; int64 guid = 9; - ShipState ship_state = 10; - ShipType ship_type = 11; + SweeperState sweeper_state = 10; + SweeperType sweeper_type = 11; int32 view_range = 12; ProducerType producer_type = 13; ConstructorType constructor_type = 14; @@ -50,7 +50,7 @@ message MessageOfBombedBullet //for Unity,直接继承自THUAI5 double bomb_range = 6; } -message MessageOfFactory +message MessageOfRecycleBank { int32 x = 1; int32 y = 2; @@ -58,7 +58,7 @@ message MessageOfFactory int64 team_id = 4; } -message MessageOfCommunity +message MessageOfChargeStation { int32 x = 1; int32 y = 2; @@ -66,7 +66,7 @@ message MessageOfCommunity int64 team_id = 4; } -message MessageOfFort +message MessageOfSignalTower { int32 x = 1; int32 y = 2; @@ -74,14 +74,14 @@ message MessageOfFort int64 team_id = 4; } -message MessageOfWormhole +message MessageOfBridge { int32 x = 1; int32 y = 2; int32 hp = 3; // 剩余的血量 } -message MessageOfResource +message MessageOfGarbage { int32 x = 1; int32 y = 2; @@ -120,14 +120,14 @@ message MessageOfObj { oneof message_of_obj { - MessageOfShip ship_message = 1; + MessageOfSweeper sweeper_message = 1; MessageOfBullet bullet_message = 2; - MessageOfFactory factory_message = 3; - MessageOfCommunity community_message = 4; - MessageOfFort fort_message = 5; - MessageOfWormhole wormhole_message = 6; + MessageOfRecycleBank recyclebank_message = 3; + MessageOfChargeStation chargestation_message = 4; + MessageOfSignalTower signaltower_message = 5; + MessageOfBridge bridge_message = 6; MessageOfHome home_message = 7; - MessageOfResource resource_message = 8; + MessageOfGarbage garbage_message = 8; MessageOfMap map_message = 9; MessageOfNews news_message = 10; MessageOfBombedBullet bombed_bullet_message = 11; @@ -165,9 +165,9 @@ message BoolRes bool act_success = 1; } -message ShipInfoRes +message SweeperInfoRes { - repeated MessageOfShip ship_info = 1; + repeated MessageOfSweeper sweeper_info = 1; } message EcoRes diff --git a/dependency/proto/Message2Server.proto b/dependency/proto/Message2Server.proto index 7281994f..dadccbb8 100755 --- a/dependency/proto/Message2Server.proto +++ b/dependency/proto/Message2Server.proto @@ -14,7 +14,7 @@ message PlayerMsg { int64 player_id = 1; int64 team_id = 2; - ShipType ship_type = 3; + SweeperType sweeper_type = 3; int32 x = 4; int32 y = 5; } @@ -67,10 +67,10 @@ message InstallMsg int64 player_id = 2; int64 team_id = 3; } -message BuildShipMsg +message BuildSweeperMsg { int32 x = 1; int32 y = 2; - ShipType ship_type = 3; + SweeperType sweeper_type = 3; int64 team_id = 4; } \ No newline at end of file diff --git a/dependency/proto/MessageType.proto b/dependency/proto/MessageType.proto index abfacee2..35950933 100755 --- a/dependency/proto/MessageType.proto +++ b/dependency/proto/MessageType.proto @@ -15,13 +15,13 @@ enum PlaceType // 地图中的所有建筑/地点类型 { NULL_PLACE_TYPE = 0; HOME = 1; - SPACE = 2; - RUIN = 3; - SHADOW = 4; - ASTEROID = 5; - RESOURCE = 6; + GROUND = 2; + WALL = 3; + GRASS = 4; + RIVER = 5; + GARBAGE = 6; CONSTRUCTION = 7; - WORMHOLE = 8; + BRIDGE = 8; } enum ShapeType @@ -35,19 +35,19 @@ enum ShapeType enum PlayerType { NULL_PLAYER_TYPE = 0; - SHIP = 1; + SWEEPER = 1; TEAM = 2; } -enum ShipType +enum SweeperType { - NULL_SHIP_TYPE = 0; - CIVILIAN_SHIP = 1; - MILITARY_SHIP = 2; - FLAG_SHIP = 3; + NULL_SWEEPER_TYPE = 0; + CIVILIAN_SWEEPER = 1; + MILITARY_SWEEPER = 2; + FLAG_SWEEPER = 3; } -enum ShipState +enum SweeperState { NULL_STATUS = 0; IDLE = 1; @@ -138,9 +138,9 @@ enum BulletType enum ConstructionType { NULL_CONSTRUCTION_TYPE = 0; - FACTORY = 1; - COMMUNITY = 2; - FORT = 3; + RECYCLEBANK = 1; + CHARGESTATION = 2; + SIGNALTOWER = 3; } enum NewsType diff --git a/dependency/proto/Services.proto b/dependency/proto/Services.proto index 607b8e3f..0680c364 100755 --- a/dependency/proto/Services.proto +++ b/dependency/proto/Services.proto @@ -22,6 +22,6 @@ service AvailableService // 大本营 rpc InstallModule(InstallMsg) returns (BoolRes); rpc Recycle(IDMsg) returns (BoolRes); - rpc BuildShip(BuildShipMsg) returns (BoolRes); + rpc BuildSweeper(BuildSweeperMsg) returns (BoolRes); rpc EndAllAction(IDMsg) returns (BoolRes); // 结束所有动作 } \ No newline at end of file From 361e45d15ff5eedc2b3d4978b99ed36f5ce82fb9 Mon Sep 17 00:00:00 2001 From: Xuc Pan Date: Mon, 11 Mar 2024 20:13:08 +0800 Subject: [PATCH 07/16] fix: :bug: Update Transformation --- logic/ClientTest/Program.cs | 2 +- logic/Preparation/Utility/Transformation.cs | 102 ++++++++++---------- 2 files changed, 52 insertions(+), 52 deletions(-) diff --git a/logic/ClientTest/Program.cs b/logic/ClientTest/Program.cs index 3ee322f3..744ff3ad 100755 --- a/logic/ClientTest/Program.cs +++ b/logic/ClientTest/Program.cs @@ -14,7 +14,7 @@ public static Task Main(string[] args) { PlayerId = 0, TeamId = 0, - ShipType = ShipType.CivilianShip, + SweeperType = SweeperType.CivilianSweeper, X = 30000, Y = 46000 }; diff --git a/logic/Preparation/Utility/Transformation.cs b/logic/Preparation/Utility/Transformation.cs index ed58b5c9..99e5bd47 100755 --- a/logic/Preparation/Utility/Transformation.cs +++ b/logic/Preparation/Utility/Transformation.cs @@ -9,8 +9,8 @@ using ProtoProducer = Protobuf.ProducerType; using ProtoShape = Protobuf.ShapeType; using ProtoShield = Protobuf.ShieldType; -using ProtoShip = Protobuf.ShipType; -using ProtoShipState = Protobuf.ShipState; +using ProtoSweeper = Protobuf.SweeperType; +using ProtoSweeperState = Protobuf.SweeperState; using ProtoWeapon = Protobuf.WeaponType; #endregion @@ -57,16 +57,16 @@ public static class Transformation #region Construction public static ProtoConstruction ConstructionToProto(ConstructionType constructionType) => constructionType switch { - ConstructionType.Factory => ProtoConstruction.Factory, - ConstructionType.Community => ProtoConstruction.Community, - ConstructionType.Fort => ProtoConstruction.Fort, + ConstructionType.Factory => ProtoConstruction.Recyclebank, + ConstructionType.Community => ProtoConstruction.Chargestation, + ConstructionType.Fort => ProtoConstruction.Signaltower, _ => ProtoConstruction.NullConstructionType }; public static ConstructionType ConstructionFromProto(ProtoConstruction constructionType) => constructionType switch { - ProtoConstruction.Factory => ConstructionType.Factory, - ProtoConstruction.Community => ConstructionType.Community, - ProtoConstruction.Fort => ConstructionType.Fort, + ProtoConstruction.Recyclebank => ConstructionType.Factory, + ProtoConstruction.Chargestation => ConstructionType.Community, + ProtoConstruction.Signaltower => ConstructionType.Fort, _ => ConstructionType.Null }; #endregion @@ -133,25 +133,25 @@ public static class Transformation #region Place public static ProtoPlace PlaceTypeToProto(PlaceType placeType) => placeType switch { - PlaceType.Null => ProtoPlace.Space, - PlaceType.Ruin => ProtoPlace.Ruin, - PlaceType.Shadow => ProtoPlace.Shadow, - PlaceType.Asteroid => ProtoPlace.Asteroid, - PlaceType.Resource => ProtoPlace.Resource, + PlaceType.Null => ProtoPlace.Ground, + PlaceType.Ruin => ProtoPlace.Wall, + PlaceType.Shadow => ProtoPlace.Grass, + PlaceType.Asteroid => ProtoPlace.River, + PlaceType.Resource => ProtoPlace.Garbage, PlaceType.Construction => ProtoPlace.Construction, - PlaceType.Wormhole => ProtoPlace.Wormhole, + PlaceType.Wormhole => ProtoPlace.Bridge, PlaceType.Home => ProtoPlace.Home, _ => ProtoPlace.NullPlaceType }; public static PlaceType PlaceTypeFromProto(ProtoPlace placeType) => placeType switch { - ProtoPlace.Space => PlaceType.Null, - ProtoPlace.Ruin => PlaceType.Ruin, - ProtoPlace.Shadow => PlaceType.Shadow, - ProtoPlace.Asteroid => PlaceType.Asteroid, - ProtoPlace.Resource => PlaceType.Resource, + ProtoPlace.Ground => PlaceType.Null, + ProtoPlace.Wall => PlaceType.Ruin, + ProtoPlace.Grass => PlaceType.Shadow, + ProtoPlace.River => PlaceType.Asteroid, + ProtoPlace.Garbage => PlaceType.Resource, ProtoPlace.Construction => PlaceType.Construction, - ProtoPlace.Wormhole => PlaceType.Wormhole, + ProtoPlace.Bridge => PlaceType.Wormhole, ProtoPlace.Home => PlaceType.Home, _ => PlaceType.Null }; @@ -159,13 +159,13 @@ public static class Transformation #region Player public static ProtoPlayer PlayerToProto(GameObjType playerType) => playerType switch { - GameObjType.Ship => ProtoPlayer.Ship, + GameObjType.Ship => ProtoPlayer.Sweeper, GameObjType.Home => ProtoPlayer.Team, _ => ProtoPlayer.NullPlayerType }; public static GameObjType PlayerFromProto(ProtoPlayer playerType) => playerType switch { - ProtoPlayer.Ship => GameObjType.Ship, + ProtoPlayer.Sweeper => GameObjType.Ship, ProtoPlayer.Team => GameObjType.Home, _ => GameObjType.Null }; @@ -217,45 +217,45 @@ public static class Transformation }; #endregion #region ShipState - public static ProtoShipState ShipStateToProto(ShipStateType shipStateType) => shipStateType switch + public static ProtoSweeperState ShipStateToProto(ShipStateType shipStateType) => shipStateType switch { - ShipStateType.Null => ProtoShipState.Idle, - ShipStateType.Producing => ProtoShipState.Producing, - ShipStateType.Constructing => ProtoShipState.Constructing, - ShipStateType.Recovering => ProtoShipState.Recovering, - ShipStateType.Recycling => ProtoShipState.Recycling, - ShipStateType.Attacking => ProtoShipState.Attacking, - ShipStateType.Swinging => ProtoShipState.Swinging, - ShipStateType.Stunned => ProtoShipState.Stunned, - ShipStateType.Moving => ProtoShipState.Moving, - _ => ProtoShipState.NullStatus + ShipStateType.Null => ProtoSweeperState.Idle, + ShipStateType.Producing => ProtoSweeperState.Producing, + ShipStateType.Constructing => ProtoSweeperState.Constructing, + ShipStateType.Recovering => ProtoSweeperState.Recovering, + ShipStateType.Recycling => ProtoSweeperState.Recycling, + ShipStateType.Attacking => ProtoSweeperState.Attacking, + ShipStateType.Swinging => ProtoSweeperState.Swinging, + ShipStateType.Stunned => ProtoSweeperState.Stunned, + ShipStateType.Moving => ProtoSweeperState.Moving, + _ => ProtoSweeperState.NullStatus }; - public static ShipStateType ShipStateFromProto(ProtoShipState shipStateType) => shipStateType switch + public static ShipStateType ShipStateFromProto(ProtoSweeperState shipStateType) => shipStateType switch { - ProtoShipState.Producing => ShipStateType.Producing, - ProtoShipState.Constructing => ShipStateType.Constructing, - ProtoShipState.Recovering => ShipStateType.Recovering, - ProtoShipState.Recycling => ShipStateType.Recycling, - ProtoShipState.Attacking => ShipStateType.Attacking, - ProtoShipState.Swinging => ShipStateType.Swinging, - ProtoShipState.Stunned => ShipStateType.Stunned, - ProtoShipState.Moving => ShipStateType.Moving, + ProtoSweeperState.Producing => ShipStateType.Producing, + ProtoSweeperState.Constructing => ShipStateType.Constructing, + ProtoSweeperState.Recovering => ShipStateType.Recovering, + ProtoSweeperState.Recycling => ShipStateType.Recycling, + ProtoSweeperState.Attacking => ShipStateType.Attacking, + ProtoSweeperState.Swinging => ShipStateType.Swinging, + ProtoSweeperState.Stunned => ShipStateType.Stunned, + ProtoSweeperState.Moving => ShipStateType.Moving, _ => ShipStateType.Null }; #endregion #region ShipType - public static ProtoShip ShipTypeToProto(ShipType shipType) => shipType switch + public static ProtoSweeper ShipTypeToProto(ShipType shipType) => shipType switch { - ShipType.CivilShip => ProtoShip.CivilianShip, - ShipType.WarShip => ProtoShip.MilitaryShip, - ShipType.FlagShip => ProtoShip.FlagShip, - _ => ProtoShip.NullShipType + ShipType.CivilShip => ProtoSweeper.CivilianSweeper, + ShipType.WarShip => ProtoSweeper.MilitarySweeper, + ShipType.FlagShip => ProtoSweeper.FlagSweeper, + _ => ProtoSweeper.NullSweeperType }; - public static ShipType ShipTypeFromProto(ProtoShip shipType) => shipType switch + public static ShipType ShipTypeFromProto(ProtoSweeper shipType) => shipType switch { - ProtoShip.CivilianShip => ShipType.CivilShip, - ProtoShip.MilitaryShip => ShipType.WarShip, - ProtoShip.FlagShip => ShipType.FlagShip, + ProtoSweeper.CivilianSweeper => ShipType.CivilShip, + ProtoSweeper.MilitarySweeper => ShipType.WarShip, + ProtoSweeper.FlagSweeper => ShipType.FlagShip, _ => ShipType.Null }; #endregion From e9151ae41188b691d0826bdff8544bff7fb9e4ef Mon Sep 17 00:00:00 2001 From: sigureling <1678348940@qq.com> Date: Tue, 12 Mar 2024 00:26:14 +0800 Subject: [PATCH 08/16] style: remove initial x and y when adding player --- CAPI/cpp/API/include/Communication.h | 2 +- CAPI/cpp/API/src/Communication.cpp | 4 +- CAPI/cpp/proto/Message2Server.pb.cc | 121 +++++++------------------- CAPI/cpp/proto/Message2Server.pb.h | 72 --------------- dependency/proto/Message2Server.proto | 2 - 5 files changed, 35 insertions(+), 166 deletions(-) diff --git a/CAPI/cpp/API/include/Communication.h b/CAPI/cpp/API/include/Communication.h index 7f111626..649503c7 100755 --- a/CAPI/cpp/API/include/Communication.h +++ b/CAPI/cpp/API/include/Communication.h @@ -29,7 +29,7 @@ class Communication } bool TryConnection(int64_t playerID, int64_t teamID); protobuf::MessageToClient GetMessage2Client(); - void AddPlayer(int64_t playerID, int64_t teamID, THUAI7::SweeperType SweeperType, int32_t x, int32_t y); + void AddPlayer(int64_t playerID, int64_t teamID, THUAI7::SweeperType SweeperType); bool EndAllAction(int64_t playerID, int64_t teamID); // Sweeper bool Move(int64_t playerID, int64_t teamID, int64_t time, double angle); diff --git a/CAPI/cpp/API/src/Communication.cpp b/CAPI/cpp/API/src/Communication.cpp index 7d322a1e..dcb2503d 100755 --- a/CAPI/cpp/API/src/Communication.cpp +++ b/CAPI/cpp/API/src/Communication.cpp @@ -223,11 +223,11 @@ bool Communication::TryConnection(int64_t playerID, int64_t teamID) return false; } -void Communication::AddPlayer(int64_t playerID, int64_t teamID, THUAI7::SweeperType SweeperType, int32_t x, int32_t y) +void Communication::AddPlayer(int64_t playerID, int64_t teamID, THUAI7::SweeperType SweeperType) { auto tMessage = [=]() { - protobuf::PlayerMsg playerMsg = THUAI72Proto::THUAI72ProtobufPlayerMsg(playerID, teamID, SweeperType, x, y); + protobuf::PlayerMsg playerMsg = THUAI72Proto::THUAI72ProtobufPlayerMsg(playerID, teamID, SweeperType); grpc::ClientContext context; auto MessageReader = THUAI7Stub->AddPlayer(&context, playerMsg); diff --git a/CAPI/cpp/proto/Message2Server.pb.cc b/CAPI/cpp/proto/Message2Server.pb.cc index ddebc09b..45954d56 100644 --- a/CAPI/cpp/proto/Message2Server.pb.cc +++ b/CAPI/cpp/proto/Message2Server.pb.cc @@ -68,7 +68,7 @@ namespace protobuf ::_pbi::ConstantInitialized ) : _impl_{ - /*decltype(_impl_.player_id_)*/ int64_t{0}, /*decltype(_impl_.team_id_)*/ int64_t{0}, /*decltype(_impl_.sweeper_type_)*/ 0, /*decltype(_impl_.x_)*/ 0, /*decltype(_impl_.y_)*/ 0, /*decltype(_impl_._cached_size_)*/ {}} + /*decltype(_impl_.player_id_)*/ int64_t{0}, /*decltype(_impl_.team_id_)*/ int64_t{0}, /*decltype(_impl_.sweeper_type_)*/ 0, /*decltype(_impl_._cached_size_)*/ {}} { } struct PlayerMsgDefaultTypeInternal @@ -269,8 +269,6 @@ const uint32_t TableStruct_Message2Server_2eproto::offsets[] PROTOBUF_SECTION_VA PROTOBUF_FIELD_OFFSET(::protobuf::PlayerMsg, _impl_.player_id_), PROTOBUF_FIELD_OFFSET(::protobuf::PlayerMsg, _impl_.team_id_), PROTOBUF_FIELD_OFFSET(::protobuf::PlayerMsg, _impl_.sweeper_type_), - PROTOBUF_FIELD_OFFSET(::protobuf::PlayerMsg, _impl_.x_), - PROTOBUF_FIELD_OFFSET(::protobuf::PlayerMsg, _impl_.y_), ~0u, // no _has_bits_ PROTOBUF_FIELD_OFFSET(::protobuf::MoveMsg, _internal_metadata_), ~0u, // no _extensions_ @@ -344,13 +342,13 @@ static const ::_pbi::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protode {0, -1, -1, sizeof(::protobuf::NullRequest)}, {6, -1, -1, sizeof(::protobuf::IDMsg)}, {14, -1, -1, sizeof(::protobuf::PlayerMsg)}, - {25, -1, -1, sizeof(::protobuf::MoveMsg)}, - {35, -1, -1, sizeof(::protobuf::SendMsg)}, - {47, -1, -1, sizeof(::protobuf::AttackMsg)}, - {56, -1, -1, sizeof(::protobuf::ConstructMsg)}, - {65, -1, -1, sizeof(::protobuf::RecoverMsg)}, - {74, -1, -1, sizeof(::protobuf::InstallMsg)}, - {83, -1, -1, sizeof(::protobuf::BuildSweeperMsg)}, + {23, -1, -1, sizeof(::protobuf::MoveMsg)}, + {33, -1, -1, sizeof(::protobuf::SendMsg)}, + {45, -1, -1, sizeof(::protobuf::AttackMsg)}, + {54, -1, -1, sizeof(::protobuf::ConstructMsg)}, + {63, -1, -1, sizeof(::protobuf::RecoverMsg)}, + {72, -1, -1, sizeof(::protobuf::InstallMsg)}, + {81, -1, -1, sizeof(::protobuf::BuildSweeperMsg)}, }; static const ::_pb::Message* const file_default_instances[] = { @@ -369,27 +367,26 @@ static const ::_pb::Message* const file_default_instances[] = { const char descriptor_table_protodef_Message2Server_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = "\n\024Message2Server.proto\022\010protobuf\032\021Messag" "eType.proto\"\r\n\013NullRequest\"+\n\005IDMsg\022\021\n\tp" - "layer_id\030\001 \001(\003\022\017\n\007team_id\030\002 \001(\003\"r\n\tPlaye" + "layer_id\030\001 \001(\003\022\017\n\007team_id\030\002 \001(\003\"\\\n\tPlaye" "rMsg\022\021\n\tplayer_id\030\001 \001(\003\022\017\n\007team_id\030\002 \001(\003" "\022+\n\014sweeper_type\030\003 \001(\0162\025.protobuf.Sweepe" - "rType\022\t\n\001x\030\004 \001(\005\022\t\n\001y\030\005 \001(\005\"Z\n\007MoveMsg\022\021" - "\n\tplayer_id\030\001 \001(\003\022\r\n\005angle\030\002 \001(\001\022\034\n\024time" - "_in_milliseconds\030\003 \001(\003\022\017\n\007team_id\030\004 \001(\003\"" - "\200\001\n\007SendMsg\022\021\n\tplayer_id\030\001 \001(\003\022\024\n\014to_pla" - "yer_id\030\002 \001(\003\022\026\n\014text_message\030\003 \001(\tH\000\022\030\n\016" - "binary_message\030\004 \001(\014H\000\022\017\n\007team_id\030\005 \001(\003B" - "\t\n\007message\">\n\tAttackMsg\022\021\n\tplayer_id\030\001 \001" - "(\003\022\r\n\005angle\030\002 \001(\001\022\017\n\007team_id\030\003 \001(\003\"i\n\014Co" - "nstructMsg\022\021\n\tplayer_id\030\001 \001(\003\0225\n\021constru" - "ction_type\030\002 \001(\0162\032.protobuf.Construction" - "Type\022\017\n\007team_id\030\003 \001(\003\"A\n\nRecoverMsg\022\021\n\tp" - "layer_id\030\001 \001(\003\022\017\n\007recover\030\002 \001(\003\022\017\n\007team_" - "id\030\003 \001(\003\"[\n\nInstallMsg\022)\n\013module_type\030\001 " - "\001(\0162\024.protobuf.ModuleType\022\021\n\tplayer_id\030\002" - " \001(\003\022\017\n\007team_id\030\003 \001(\003\"e\n\017BuildSweeperMsg" - "\022\t\n\001x\030\001 \001(\005\022\t\n\001y\030\002 \001(\005\022+\n\014sweeper_type\030\003" - " \001(\0162\025.protobuf.SweeperType\022\017\n\007team_id\030\004" - " \001(\003b\006proto3"; + "rType\"Z\n\007MoveMsg\022\021\n\tplayer_id\030\001 \001(\003\022\r\n\005a" + "ngle\030\002 \001(\001\022\034\n\024time_in_milliseconds\030\003 \001(\003" + "\022\017\n\007team_id\030\004 \001(\003\"\200\001\n\007SendMsg\022\021\n\tplayer_" + "id\030\001 \001(\003\022\024\n\014to_player_id\030\002 \001(\003\022\026\n\014text_m" + "essage\030\003 \001(\tH\000\022\030\n\016binary_message\030\004 \001(\014H\000" + "\022\017\n\007team_id\030\005 \001(\003B\t\n\007message\">\n\tAttackMs" + "g\022\021\n\tplayer_id\030\001 \001(\003\022\r\n\005angle\030\002 \001(\001\022\017\n\007t" + "eam_id\030\003 \001(\003\"i\n\014ConstructMsg\022\021\n\tplayer_i" + "d\030\001 \001(\003\0225\n\021construction_type\030\002 \001(\0162\032.pro" + "tobuf.ConstructionType\022\017\n\007team_id\030\003 \001(\003\"" + "A\n\nRecoverMsg\022\021\n\tplayer_id\030\001 \001(\003\022\017\n\007reco" + "ver\030\002 \001(\003\022\017\n\007team_id\030\003 \001(\003\"[\n\nInstallMsg" + "\022)\n\013module_type\030\001 \001(\0162\024.protobuf.ModuleT" + "ype\022\021\n\tplayer_id\030\002 \001(\003\022\017\n\007team_id\030\003 \001(\003\"" + "e\n\017BuildSweeperMsg\022\t\n\001x\030\001 \001(\005\022\t\n\001y\030\002 \001(\005" + "\022+\n\014sweeper_type\030\003 \001(\0162\025.protobuf.Sweepe" + "rType\022\017\n\007team_id\030\004 \001(\003b\006proto3"; static const ::_pbi::DescriptorTable* const descriptor_table_Message2Server_2eproto_deps[1] = { &::descriptor_table_MessageType_2eproto, }; @@ -397,7 +394,7 @@ static ::_pbi::once_flag descriptor_table_Message2Server_2eproto_once; const ::_pbi::DescriptorTable descriptor_table_Message2Server_2eproto = { false, false, - 892, + 870, descriptor_table_protodef_Message2Server_2eproto, "Message2Server.proto", &descriptor_table_Message2Server_2eproto_once, @@ -718,10 +715,10 @@ namespace protobuf PlayerMsg* const _this = this; (void)_this; new (&_impl_) Impl_{ - decltype(_impl_.player_id_){}, decltype(_impl_.team_id_){}, decltype(_impl_.sweeper_type_){}, decltype(_impl_.x_){}, decltype(_impl_.y_){}, /*decltype(_impl_._cached_size_)*/ {}}; + decltype(_impl_.player_id_){}, decltype(_impl_.team_id_){}, decltype(_impl_.sweeper_type_){}, /*decltype(_impl_._cached_size_)*/ {}}; _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); - ::memcpy(&_impl_.player_id_, &from._impl_.player_id_, static_cast(reinterpret_cast(&_impl_.y_) - reinterpret_cast(&_impl_.player_id_)) + sizeof(_impl_.y_)); + ::memcpy(&_impl_.player_id_, &from._impl_.player_id_, static_cast(reinterpret_cast(&_impl_.sweeper_type_) - reinterpret_cast(&_impl_.player_id_)) + sizeof(_impl_.sweeper_type_)); // @@protoc_insertion_point(copy_constructor:protobuf.PlayerMsg) } @@ -732,7 +729,7 @@ namespace protobuf (void)arena; (void)is_message_owned; new (&_impl_) Impl_{ - decltype(_impl_.player_id_){int64_t{0}}, decltype(_impl_.team_id_){int64_t{0}}, decltype(_impl_.sweeper_type_){0}, decltype(_impl_.x_){0}, decltype(_impl_.y_){0}, /*decltype(_impl_._cached_size_)*/ {}}; + decltype(_impl_.player_id_){int64_t{0}}, decltype(_impl_.team_id_){int64_t{0}}, decltype(_impl_.sweeper_type_){0}, /*decltype(_impl_._cached_size_)*/ {}}; } PlayerMsg::~PlayerMsg() @@ -763,7 +760,7 @@ namespace protobuf // Prevent compiler warnings about cached_has_bits being unused (void)cached_has_bits; - ::memset(&_impl_.player_id_, 0, static_cast(reinterpret_cast(&_impl_.y_) - reinterpret_cast(&_impl_.player_id_)) + sizeof(_impl_.y_)); + ::memset(&_impl_.player_id_, 0, static_cast(reinterpret_cast(&_impl_.sweeper_type_) - reinterpret_cast(&_impl_.player_id_)) + sizeof(_impl_.sweeper_type_)); _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } @@ -809,26 +806,6 @@ namespace protobuf else goto handle_unusual; continue; - // int32 x = 4; - case 4: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 32)) - { - _impl_.x_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr); - CHK_(ptr); - } - else - goto handle_unusual; - continue; - // int32 y = 5; - case 5: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 40)) - { - _impl_.y_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr); - CHK_(ptr); - } - else - goto handle_unusual; - continue; default: goto handle_unusual; } // switch @@ -886,20 +863,6 @@ namespace protobuf ); } - // int32 x = 4; - if (this->_internal_x() != 0) - { - target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteInt32ToArray(4, this->_internal_x(), target); - } - - // int32 y = 5; - if (this->_internal_y() != 0) - { - target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteInt32ToArray(5, this->_internal_y(), target); - } - if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( @@ -938,18 +901,6 @@ namespace protobuf ::_pbi::WireFormatLite::EnumSize(this->_internal_sweeper_type()); } - // int32 x = 4; - if (this->_internal_x() != 0) - { - total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_x()); - } - - // int32 y = 5; - if (this->_internal_y() != 0) - { - total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_y()); - } - return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); } @@ -982,14 +933,6 @@ namespace protobuf { _this->_internal_set_sweeper_type(from._internal_sweeper_type()); } - if (from._internal_x() != 0) - { - _this->_internal_set_x(from._internal_x()); - } - if (from._internal_y() != 0) - { - _this->_internal_set_y(from._internal_y()); - } _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); } @@ -1012,7 +955,7 @@ namespace protobuf using std::swap; _internal_metadata_.InternalSwap(&other->_internal_metadata_); ::PROTOBUF_NAMESPACE_ID::internal::memswap< - PROTOBUF_FIELD_OFFSET(PlayerMsg, _impl_.y_) + sizeof(PlayerMsg::_impl_.y_) - PROTOBUF_FIELD_OFFSET(PlayerMsg, _impl_.player_id_)>( + PROTOBUF_FIELD_OFFSET(PlayerMsg, _impl_.sweeper_type_) + sizeof(PlayerMsg::_impl_.sweeper_type_) - PROTOBUF_FIELD_OFFSET(PlayerMsg, _impl_.player_id_)>( reinterpret_cast(&_impl_.player_id_), reinterpret_cast(&other->_impl_.player_id_) ); diff --git a/CAPI/cpp/proto/Message2Server.pb.h b/CAPI/cpp/proto/Message2Server.pb.h index db139865..7165a7bc 100644 --- a/CAPI/cpp/proto/Message2Server.pb.h +++ b/CAPI/cpp/proto/Message2Server.pb.h @@ -626,8 +626,6 @@ namespace protobuf kPlayerIdFieldNumber = 1, kTeamIdFieldNumber = 2, kSweeperTypeFieldNumber = 3, - kXFieldNumber = 4, - kYFieldNumber = 5, }; // int64 player_id = 1; void clear_player_id(); @@ -658,26 +656,6 @@ namespace protobuf ::protobuf::SweeperType _internal_sweeper_type() const; void _internal_set_sweeper_type(::protobuf::SweeperType value); - public: - // int32 x = 4; - void clear_x(); - int32_t x() const; - void set_x(int32_t value); - - private: - int32_t _internal_x() const; - void _internal_set_x(int32_t value); - - public: - // int32 y = 5; - void clear_y(); - int32_t y() const; - void set_y(int32_t value); - - private: - int32_t _internal_y() const; - void _internal_set_y(int32_t value); - public: // @@protoc_insertion_point(class_scope:protobuf.PlayerMsg) @@ -693,8 +671,6 @@ namespace protobuf int64_t player_id_; int64_t team_id_; int sweeper_type_; - int32_t x_; - int32_t y_; mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; }; union @@ -2446,54 +2422,6 @@ namespace protobuf // @@protoc_insertion_point(field_set:protobuf.PlayerMsg.sweeper_type) } - // int32 x = 4; - inline void PlayerMsg::clear_x() - { - _impl_.x_ = 0; - } - inline int32_t PlayerMsg::_internal_x() const - { - return _impl_.x_; - } - inline int32_t PlayerMsg::x() const - { - // @@protoc_insertion_point(field_get:protobuf.PlayerMsg.x) - return _internal_x(); - } - inline void PlayerMsg::_internal_set_x(int32_t value) - { - _impl_.x_ = value; - } - inline void PlayerMsg::set_x(int32_t value) - { - _internal_set_x(value); - // @@protoc_insertion_point(field_set:protobuf.PlayerMsg.x) - } - - // int32 y = 5; - inline void PlayerMsg::clear_y() - { - _impl_.y_ = 0; - } - inline int32_t PlayerMsg::_internal_y() const - { - return _impl_.y_; - } - inline int32_t PlayerMsg::y() const - { - // @@protoc_insertion_point(field_get:protobuf.PlayerMsg.y) - return _internal_y(); - } - inline void PlayerMsg::_internal_set_y(int32_t value) - { - _impl_.y_ = value; - } - inline void PlayerMsg::set_y(int32_t value) - { - _internal_set_y(value); - // @@protoc_insertion_point(field_set:protobuf.PlayerMsg.y) - } - // ------------------------------------------------------------------- // MoveMsg diff --git a/dependency/proto/Message2Server.proto b/dependency/proto/Message2Server.proto index dadccbb8..d3c788e1 100755 --- a/dependency/proto/Message2Server.proto +++ b/dependency/proto/Message2Server.proto @@ -15,8 +15,6 @@ message PlayerMsg int64 player_id = 1; int64 team_id = 2; SweeperType sweeper_type = 3; - int32 x = 4; - int32 y = 5; } message MoveMsg From 7aff9e2618edcdbac5e04cb3032a19cd1508d5ec Mon Sep 17 00:00:00 2001 From: sigureling <1678348940@qq.com> Date: Tue, 12 Mar 2024 00:26:32 +0800 Subject: [PATCH 09/16] style: :art: rename money as energy --- CAPI/cpp/API/include/API.h | 12 +- CAPI/cpp/API/include/constants.h | 10 +- CAPI/cpp/API/include/logic.h | 2 +- CAPI/cpp/API/include/structures.h | 6 +- CAPI/cpp/API/include/utils.hpp | 10 +- CAPI/cpp/API/src/API.cpp | 8 +- CAPI/cpp/API/src/DebugAPI.cpp | 10 +- CAPI/cpp/API/src/logic.cpp | 15 ++- CAPI/cpp/proto/Message2Clients.pb.cc | 154 ++++++++++++------------- CAPI/cpp/proto/Message2Clients.pb.h | 126 ++++++++++---------- CAPI/python/PyAPI/constants.py | 10 +- dependency/proto/Message2Clients.proto | 6 +- 12 files changed, 183 insertions(+), 186 deletions(-) diff --git a/CAPI/cpp/API/include/API.h b/CAPI/cpp/API/include/API.h index 3fcc50bd..e46c66cd 100755 --- a/CAPI/cpp/API/include/API.h +++ b/CAPI/cpp/API/include/API.h @@ -49,7 +49,7 @@ class ILogic [[nodiscard]] virtual int32_t GetBridgeHp(int32_t cellX, int32_t cellY) const = 0; [[nodiscard]] virtual int32_t GetGarbageState(int32_t cellX, int32_t cellY) const = 0; [[nodiscard]] virtual int32_t GetHomeHp() const = 0; - [[nodiscard]] virtual int32_t GetMoney() const = 0; + [[nodiscard]] virtual int32_t GetEnergy() const = 0; [[nodiscard]] virtual int32_t GetScore() const = 0; // 供IAPI使用的操作相关的公共部分 @@ -101,7 +101,7 @@ class IAPI [[nodiscard]] virtual int32_t GetBridgeHp(int32_t cellX, int32_t cellY) const = 0; [[nodiscard]] virtual int32_t GetGarbageState(int32_t cellX, int32_t cellY) const = 0; [[nodiscard]] virtual int32_t GetHomeHp() const = 0; - [[nodiscard]] virtual int32_t GetMoney() const = 0; + [[nodiscard]] virtual int32_t GetEnergy() const = 0; [[nodiscard]] virtual int32_t GetScore() const = 0; [[nodiscard]] virtual std::vector GetPlayerGUIDs() const = 0; @@ -211,7 +211,7 @@ class SweeperAPI : public ISweeperAPI, public IGameTimer [[nodiscard]] std::vector GetPlayerGUIDs() const override; [[nodiscard]] std::shared_ptr GetSelfInfo() const override; [[nodiscard]] bool HaveView(int32_t gridX, int32_t gridY) const override; - [[nodiscard]] int32_t GetMoney() const override; + [[nodiscard]] int32_t GetEnergy() const override; [[nodiscard]] int32_t GetScore() const override; void Print(std::string str) const { @@ -268,7 +268,7 @@ class TeamAPI : public ITeamAPI, public IGameTimer [[nodiscard]] std::shared_ptr GetSelfInfo() const override; [[nodiscard]] int32_t GetScore() const override; - [[nodiscard]] int32_t GetMoney() const override; + [[nodiscard]] int32_t GetEnergy() const override; std::future InstallModule(int64_t playerID, THUAI7::ModuleType moduleType) override; std::future Recycle(int64_t playerID) override; std::future BuildSweeper(THUAI7::SweeperType SweeperType, int32_t cellX, int32_t cellY) override; @@ -328,7 +328,7 @@ class SweeperDebugAPI : public ISweeperAPI, public IGameTimer [[nodiscard]] std::vector GetPlayerGUIDs() const override; [[nodiscard]] std::shared_ptr GetSelfInfo() const override; [[nodiscard]] bool HaveView(int32_t gridX, int32_t gridY) const override; - [[nodiscard]] int32_t GetMoney() const override; + [[nodiscard]] int32_t GetEnergy() const override; [[nodiscard]] int32_t GetScore() const override; void Print(std::string str) const override; @@ -375,7 +375,7 @@ class TeamDebugAPI : public ITeamAPI, public IGameTimer [[nodiscard]] std::shared_ptr GetSelfInfo() const override; [[nodiscard]] int32_t GetScore() const override; - [[nodiscard]] int32_t GetMoney() const override; + [[nodiscard]] int32_t GetEnergy() const override; std::future InstallModule(int64_t playerID, THUAI7::ModuleType moduleType) override; std::future Recycle(int64_t playerID) override; std::future BuildSweeper(THUAI7::SweeperType SweeperType, int32_t cellX, int32_t cellY) override; diff --git a/CAPI/cpp/API/include/constants.h b/CAPI/cpp/API/include/constants.h index 295ce47c..809ea1a3 100755 --- a/CAPI/cpp/API/include/constants.h +++ b/CAPI/cpp/API/include/constants.h @@ -26,12 +26,12 @@ namespace Constants struct Home { SCCI int32_t maxHp = 24000; - SCCI int32_t moneySpeed = 1; + SCCI int32_t energySpeed = 1; }; struct RecycleBank { SCCI int32_t maxHp = 8000; - SCCI int32_t moneySpeed = 3; + SCCI int32_t energySpeed = 3; }; struct ChargeStation { @@ -74,9 +74,9 @@ namespace Constants // 模块 struct Producer { - SCCI int32_t moneySpeed1 = 5; - SCCI int32_t moneySpeed2 = 7; - SCCI int32_t moneySpeed3 = 10; + SCCI int32_t energySpeed1 = 5; + SCCI int32_t energySpeed2 = 7; + SCCI int32_t energySpeed3 = 10; SCCI int32_t Cost1 = 0; SCCI int32_t Cost2 = 40; SCCI int32_t Cost3 = 80; diff --git a/CAPI/cpp/API/include/logic.h b/CAPI/cpp/API/include/logic.h index a79e9fcd..a0fa47bc 100755 --- a/CAPI/cpp/API/include/logic.h +++ b/CAPI/cpp/API/include/logic.h @@ -102,7 +102,7 @@ class Logic : public ILogic [[nodiscard]] int32_t GetBridgeHp(int32_t cellX, int32_t cellY) const; [[nodiscard]] int32_t GetGarbageState(int32_t cellX, int32_t cellY) const; [[nodiscard]] int32_t GetHomeHp() const; - [[nodiscard]] int32_t GetMoney() const; + [[nodiscard]] int32_t GetEnergy() const; [[nodiscard]] int32_t GetScore() const; // 供IAPI使用的操作相关的部分 diff --git a/CAPI/cpp/API/include/structures.h b/CAPI/cpp/API/include/structures.h index 6160a356..5d80742e 100755 --- a/CAPI/cpp/API/include/structures.h +++ b/CAPI/cpp/API/include/structures.h @@ -216,7 +216,7 @@ namespace THUAI7 int64_t playerID; int64_t teamID; int32_t score; - int32_t money; + int32_t energy; }; struct Home @@ -268,10 +268,10 @@ namespace THUAI7 { int32_t gameTime; int32_t redScore; - int32_t redMoney; + int32_t redEnergy; int32_t redHomeHp; int32_t blueScore; - int32_t blueMoney; + int32_t blueEnergy; int32_t blueHomeHp; }; diff --git a/CAPI/cpp/API/include/utils.hpp b/CAPI/cpp/API/include/utils.hpp index c0ad1cc9..7f57bc97 100755 --- a/CAPI/cpp/API/include/utils.hpp +++ b/CAPI/cpp/API/include/utils.hpp @@ -280,7 +280,7 @@ namespace Proto2THUAI7 team->playerID = teamMsg.player_id(); team->teamID = teamMsg.team_id(); team->score = teamMsg.score(); - team->money = teamMsg.money(); + team->energy = teamMsg.energy(); return team; } @@ -289,10 +289,10 @@ namespace Proto2THUAI7 auto gameInfo = std::make_shared(); gameInfo->gameTime = allMsg.game_time(); gameInfo->redScore = allMsg.red_team_score(); - gameInfo->redMoney = allMsg.red_team_score(); + gameInfo->redEnergy = allMsg.red_team_energy(); gameInfo->redHomeHp = allMsg.red_home_hp(); gameInfo->blueScore = allMsg.blue_team_score(); - gameInfo->blueMoney = allMsg.blue_team_score(); + gameInfo->blueEnergy = allMsg.blue_team_energy(); gameInfo->blueHomeHp = allMsg.blue_home_hp(); return gameInfo; } @@ -530,14 +530,12 @@ namespace THUAI72Proto return buildSweeperMsg; } - inline protobuf::PlayerMsg THUAI72ProtobufPlayerMsg(int64_t playerID, int64_t teamID, THUAI7::SweeperType SweeperType, int32_t x, int32_t y) + inline protobuf::PlayerMsg THUAI72ProtobufPlayerMsg(int64_t playerID, int64_t teamID, THUAI7::SweeperType SweeperType) { protobuf::PlayerMsg playerMsg; playerMsg.set_player_id(playerID); playerMsg.set_team_id(teamID); playerMsg.set_sweeper_type(THUAI72Proto::SweeperTypeDict[SweeperType]); - playerMsg.set_x(x); - playerMsg.set_y(y); return playerMsg; } diff --git a/CAPI/cpp/API/src/API.cpp b/CAPI/cpp/API/src/API.cpp index a006fb60..1d0cc7ce 100755 --- a/CAPI/cpp/API/src/API.cpp +++ b/CAPI/cpp/API/src/API.cpp @@ -220,14 +220,14 @@ int32_t TeamAPI::GetScore() const return logic.GetScore(); } -int32_t SweeperAPI::GetMoney() const +int32_t SweeperAPI::GetEnergy() const { - return logic.GetMoney(); + return logic.GetEnergy(); } -int32_t TeamAPI::GetMoney() const +int32_t TeamAPI::GetEnergy() const { - return logic.GetMoney(); + return logic.GetEnergy(); } // Sweeper独有 diff --git a/CAPI/cpp/API/src/DebugAPI.cpp b/CAPI/cpp/API/src/DebugAPI.cpp index a2bb7392..a6e1337e 100755 --- a/CAPI/cpp/API/src/DebugAPI.cpp +++ b/CAPI/cpp/API/src/DebugAPI.cpp @@ -226,9 +226,9 @@ bool SweeperDebugAPI::HaveView(int32_t gridX, int32_t gridY) const return logic.HaveView(gridX, gridY, selfInfo->x, selfInfo->y, selfInfo->viewRange); } -int32_t SweeperDebugAPI::GetMoney() const +int32_t SweeperDebugAPI::GetEnergy() const { - return logic.GetMoney(); + return logic.GetEnergy(); } int32_t SweeperDebugAPI::GetScore() const @@ -414,9 +414,9 @@ std::shared_ptr TeamDebugAPI::GetSelfInfo() const return logic.TeamGetSelfInfo(); } -int32_t TeamDebugAPI::GetMoney() const +int32_t TeamDebugAPI::GetEnergy() const { - return logic.GetMoney(); + return logic.GetEnergy(); } int32_t TeamDebugAPI::GetScore() const @@ -446,7 +446,7 @@ void TeamDebugAPI::PrintSelfInfo() const { auto Team = logic.TeamGetSelfInfo(); logger->info("******Self Info******"); - logger->info("playerID={}, teamID={}, score={}, money={}", Team->playerID, Team->teamID, Team->score, Team->money); + logger->info("playerID={}, teamID={}, score={}, energy={}", Team->playerID, Team->teamID, Team->score, Team->energy); logger->info("*********************\n"); } diff --git a/CAPI/cpp/API/src/logic.cpp b/CAPI/cpp/API/src/logic.cpp index 6f5106eb..6dba7ad8 100755 --- a/CAPI/cpp/API/src/logic.cpp +++ b/CAPI/cpp/API/src/logic.cpp @@ -155,14 +155,14 @@ int32_t Logic::GetGarbageState(int32_t cellX, int32_t cellY) const } } -int32_t Logic::GetMoney() const +int32_t Logic::GetEnergy() const { std::unique_lock lock(mtxState); - logger->debug("Called GetMoney"); + logger->debug("Called GetEnergy"); if (playerTeam == THUAI7::PlayerTeam::Red) - return currentState->gameInfo->redMoney; + return currentState->gameInfo->redEnergy; else if (playerTeam == THUAI7::PlayerTeam::Blue) - return currentState->gameInfo->blueMoney; + return currentState->gameInfo->blueEnergy; else { logger->warn("Invalid playerTeam"); @@ -292,10 +292,8 @@ void Logic::ProcessMessage() try { // TODO - int32_t x = 0; - int32_t y = 0; logger->info("Message thread start!"); - pComm->AddPlayer(playerID, teamID, SweeperType, x, y); + pComm->AddPlayer(playerID, teamID, SweeperType); while (gameState != THUAI7::GameState::GameEnd) { auto clientMsg = pComm->GetMessage2Client(); // 在获得新消息之前阻塞 @@ -430,7 +428,8 @@ void Logic::LoadBufferCase(const protobuf::MessageOfObj& item) { if (AssistFunction::HaveView(x, y, item.sweeper_message().x(), item.sweeper_message().y(), viewRange, bufferState->gameMap)) { - bufferState->enemySweepers.push_back(Proto2THUAI7::Protobuf2THUAI7Sweeper(item.sweeper_message())); + std::shared_ptr Sweeper = Proto2THUAI7::Protobuf2THUAI7Sweeper(item.sweeper_message()); + bufferState->enemySweepers.push_back(Sweeper); logger->debug("Add EnemySweeper!"); } } diff --git a/CAPI/cpp/proto/Message2Clients.pb.cc b/CAPI/cpp/proto/Message2Clients.pb.cc index c9c99821..1d5d702c 100644 --- a/CAPI/cpp/proto/Message2Clients.pb.cc +++ b/CAPI/cpp/proto/Message2Clients.pb.cc @@ -268,7 +268,7 @@ namespace protobuf ::_pbi::ConstantInitialized ) : _impl_{ - /*decltype(_impl_.team_id_)*/ int64_t{0}, /*decltype(_impl_.player_id_)*/ int64_t{0}, /*decltype(_impl_.score_)*/ 0, /*decltype(_impl_.money_)*/ 0, /*decltype(_impl_.guid_)*/ int64_t{0}, /*decltype(_impl_._cached_size_)*/ {}} + /*decltype(_impl_.team_id_)*/ int64_t{0}, /*decltype(_impl_.player_id_)*/ int64_t{0}, /*decltype(_impl_.score_)*/ 0, /*decltype(_impl_.energy_)*/ 0, /*decltype(_impl_.guid_)*/ int64_t{0}, /*decltype(_impl_._cached_size_)*/ {}} { } struct MessageOfTeamDefaultTypeInternal @@ -312,7 +312,7 @@ namespace protobuf ::_pbi::ConstantInitialized ) : _impl_{ - /*decltype(_impl_.game_time_)*/ 0, /*decltype(_impl_.red_team_score_)*/ 0, /*decltype(_impl_.blue_team_score_)*/ 0, /*decltype(_impl_.red_team_money_)*/ 0, /*decltype(_impl_.blue_team_money_)*/ 0, /*decltype(_impl_.red_home_hp_)*/ 0, /*decltype(_impl_.blue_home_hp_)*/ 0, /*decltype(_impl_._cached_size_)*/ {}} + /*decltype(_impl_.game_time_)*/ 0, /*decltype(_impl_.red_team_score_)*/ 0, /*decltype(_impl_.blue_team_score_)*/ 0, /*decltype(_impl_.red_team_energy_)*/ 0, /*decltype(_impl_.blue_team_energy_)*/ 0, /*decltype(_impl_.red_home_hp_)*/ 0, /*decltype(_impl_.blue_home_hp_)*/ 0, /*decltype(_impl_._cached_size_)*/ {}} { } struct MessageOfAllDefaultTypeInternal @@ -602,7 +602,7 @@ const uint32_t TableStruct_Message2Clients_2eproto::offsets[] PROTOBUF_SECTION_V PROTOBUF_FIELD_OFFSET(::protobuf::MessageOfTeam, _impl_.team_id_), PROTOBUF_FIELD_OFFSET(::protobuf::MessageOfTeam, _impl_.player_id_), PROTOBUF_FIELD_OFFSET(::protobuf::MessageOfTeam, _impl_.score_), - PROTOBUF_FIELD_OFFSET(::protobuf::MessageOfTeam, _impl_.money_), + PROTOBUF_FIELD_OFFSET(::protobuf::MessageOfTeam, _impl_.energy_), PROTOBUF_FIELD_OFFSET(::protobuf::MessageOfTeam, _impl_.guid_), ~0u, // no _has_bits_ PROTOBUF_FIELD_OFFSET(::protobuf::MessageOfObj, _internal_metadata_), @@ -632,8 +632,8 @@ const uint32_t TableStruct_Message2Clients_2eproto::offsets[] PROTOBUF_SECTION_V PROTOBUF_FIELD_OFFSET(::protobuf::MessageOfAll, _impl_.game_time_), PROTOBUF_FIELD_OFFSET(::protobuf::MessageOfAll, _impl_.red_team_score_), PROTOBUF_FIELD_OFFSET(::protobuf::MessageOfAll, _impl_.blue_team_score_), - PROTOBUF_FIELD_OFFSET(::protobuf::MessageOfAll, _impl_.red_team_money_), - PROTOBUF_FIELD_OFFSET(::protobuf::MessageOfAll, _impl_.blue_team_money_), + PROTOBUF_FIELD_OFFSET(::protobuf::MessageOfAll, _impl_.red_team_energy_), + PROTOBUF_FIELD_OFFSET(::protobuf::MessageOfAll, _impl_.blue_team_energy_), PROTOBUF_FIELD_OFFSET(::protobuf::MessageOfAll, _impl_.red_home_hp_), PROTOBUF_FIELD_OFFSET(::protobuf::MessageOfAll, _impl_.blue_home_hp_), ~0u, // no _has_bits_ @@ -770,43 +770,43 @@ const char descriptor_table_protodef_Message2Clients_2eproto[] PROTOBUF_SECTION_ "sageOfMap\022\016\n\006height\030\001 \001(\r\022\r\n\005width\030\002 \001(\r" "\022(\n\004rows\030\003 \003(\0132\032.protobuf.MessageOfMap.R" "ow\032(\n\003Row\022!\n\004cols\030\001 \003(\0162\023.protobuf.Place" - "Type\"_\n\rMessageOfTeam\022\017\n\007team_id\030\001 \001(\003\022\021" - "\n\tplayer_id\030\002 \001(\003\022\r\n\005score\030\003 \001(\005\022\r\n\005mone" - "y\030\004 \001(\005\022\014\n\004guid\030\005 \001(\003\"\275\005\n\014MessageOfObj\0225" - "\n\017sweeper_message\030\001 \001(\0132\032.protobuf.Messa" - "geOfSweeperH\000\0223\n\016bullet_message\030\002 \001(\0132\031." - "protobuf.MessageOfBulletH\000\022=\n\023recycleban" - "k_message\030\003 \001(\0132\036.protobuf.MessageOfRecy" - "cleBankH\000\022A\n\025chargestation_message\030\004 \001(\013" - "2 .protobuf.MessageOfChargeStationH\000\022=\n\023" - "signaltower_message\030\005 \001(\0132\036.protobuf.Mes" - "sageOfSignalTowerH\000\0223\n\016bridge_message\030\006 " - "\001(\0132\031.protobuf.MessageOfBridgeH\000\022/\n\014home" - "_message\030\007 \001(\0132\027.protobuf.MessageOfHomeH" - "\000\0225\n\017garbage_message\030\010 \001(\0132\032.protobuf.Me" - "ssageOfGarbageH\000\022-\n\013map_message\030\t \001(\0132\026." - "protobuf.MessageOfMapH\000\022/\n\014news_message\030" - "\n \001(\0132\027.protobuf.MessageOfNewsH\000\022@\n\025bomb" - "ed_bullet_message\030\013 \001(\0132\037.protobuf.Messa" - "geOfBombedBulletH\000\022/\n\014team_message\030\014 \001(\013" - "2\027.protobuf.MessageOfTeamH\000B\020\n\016message_o" - "f_obj\"\256\001\n\014MessageOfAll\022\021\n\tgame_time\030\001 \001(" - "\005\022\026\n\016red_team_score\030\002 \001(\005\022\027\n\017blue_team_s" - "core\030\003 \001(\005\022\026\n\016red_team_money\030\004 \001(\005\022\027\n\017bl" - "ue_team_money\030\005 \001(\005\022\023\n\013red_home_hp\030\006 \001(\005" - "\022\024\n\014blue_home_hp\030\007 \001(\005\"\224\001\n\017MessageToClie" - "nt\022+\n\013obj_message\030\001 \003(\0132\026.protobuf.Messa" - "geOfObj\022\'\n\ngame_state\030\002 \001(\0162\023.protobuf.G" - "ameState\022+\n\013all_message\030\003 \001(\0132\026.protobuf" - ".MessageOfAll\"J\n\007MoveRes\022\024\n\014actual_speed" - "\030\001 \001(\003\022\024\n\014actual_angle\030\002 \001(\001\022\023\n\013act_succ" - "ess\030\003 \001(\010\"\036\n\007BoolRes\022\023\n\013act_success\030\001 \001(" - "\010\"B\n\016SweeperInfoRes\0220\n\014sweeper_info\030\001 \003(" - "\0132\032.protobuf.MessageOfSweeper\"\031\n\006EcoRes\022" - "\017\n\007economy\030\001 \001(\003\"i\n\rMessageOfNews\022\026\n\014tex" - "t_message\030\001 \001(\tH\000\022\030\n\016binary_message\030\004 \001(" - "\014H\000\022\017\n\007from_id\030\002 \001(\003\022\r\n\005to_id\030\003 \001(\003B\006\n\004n" - "ewsb\006proto3"; + "Type\"`\n\rMessageOfTeam\022\017\n\007team_id\030\001 \001(\003\022\021" + "\n\tplayer_id\030\002 \001(\003\022\r\n\005score\030\003 \001(\005\022\016\n\006ener" + "gy\030\004 \001(\005\022\014\n\004guid\030\005 \001(\003\"\275\005\n\014MessageOfObj\022" + "5\n\017sweeper_message\030\001 \001(\0132\032.protobuf.Mess" + "ageOfSweeperH\000\0223\n\016bullet_message\030\002 \001(\0132\031" + ".protobuf.MessageOfBulletH\000\022=\n\023recycleba" + "nk_message\030\003 \001(\0132\036.protobuf.MessageOfRec" + "ycleBankH\000\022A\n\025chargestation_message\030\004 \001(" + "\0132 .protobuf.MessageOfChargeStationH\000\022=\n" + "\023signaltower_message\030\005 \001(\0132\036.protobuf.Me" + "ssageOfSignalTowerH\000\0223\n\016bridge_message\030\006" + " \001(\0132\031.protobuf.MessageOfBridgeH\000\022/\n\014hom" + "e_message\030\007 \001(\0132\027.protobuf.MessageOfHome" + "H\000\0225\n\017garbage_message\030\010 \001(\0132\032.protobuf.M" + "essageOfGarbageH\000\022-\n\013map_message\030\t \001(\0132\026" + ".protobuf.MessageOfMapH\000\022/\n\014news_message" + "\030\n \001(\0132\027.protobuf.MessageOfNewsH\000\022@\n\025bom" + "bed_bullet_message\030\013 \001(\0132\037.protobuf.Mess" + "ageOfBombedBulletH\000\022/\n\014team_message\030\014 \001(" + "\0132\027.protobuf.MessageOfTeamH\000B\020\n\016message_" + "of_obj\"\260\001\n\014MessageOfAll\022\021\n\tgame_time\030\001 \001" + "(\005\022\026\n\016red_team_score\030\002 \001(\005\022\027\n\017blue_team_" + "score\030\003 \001(\005\022\027\n\017red_team_energy\030\004 \001(\005\022\030\n\020" + "blue_team_energy\030\005 \001(\005\022\023\n\013red_home_hp\030\006 " + "\001(\005\022\024\n\014blue_home_hp\030\007 \001(\005\"\224\001\n\017MessageToC" + "lient\022+\n\013obj_message\030\001 \003(\0132\026.protobuf.Me" + "ssageOfObj\022\'\n\ngame_state\030\002 \001(\0162\023.protobu" + "f.GameState\022+\n\013all_message\030\003 \001(\0132\026.proto" + "buf.MessageOfAll\"J\n\007MoveRes\022\024\n\014actual_sp" + "eed\030\001 \001(\003\022\024\n\014actual_angle\030\002 \001(\001\022\023\n\013act_s" + "uccess\030\003 \001(\010\"\036\n\007BoolRes\022\023\n\013act_success\030\001" + " \001(\010\"B\n\016SweeperInfoRes\0220\n\014sweeper_info\030\001" + " \003(\0132\032.protobuf.MessageOfSweeper\"\031\n\006EcoR" + "es\022\017\n\007economy\030\001 \001(\003\"i\n\rMessageOfNews\022\026\n\014" + "text_message\030\001 \001(\tH\000\022\030\n\016binary_message\030\004" + " \001(\014H\000\022\017\n\007from_id\030\002 \001(\003\022\r\n\005to_id\030\003 \001(\003B\006" + "\n\004newsb\006proto3"; static const ::_pbi::DescriptorTable* const descriptor_table_Message2Clients_2eproto_deps[1] = { &::descriptor_table_MessageType_2eproto, }; @@ -814,7 +814,7 @@ static ::_pbi::once_flag descriptor_table_Message2Clients_2eproto_once; const ::_pbi::DescriptorTable descriptor_table_Message2Clients_2eproto = { false, false, - 2891, + 2894, descriptor_table_protodef_Message2Clients_2eproto, "Message2Clients.proto", &descriptor_table_Message2Clients_2eproto_once, @@ -4633,7 +4633,7 @@ namespace protobuf MessageOfTeam* const _this = this; (void)_this; new (&_impl_) Impl_{ - decltype(_impl_.team_id_){}, decltype(_impl_.player_id_){}, decltype(_impl_.score_){}, decltype(_impl_.money_){}, decltype(_impl_.guid_){}, /*decltype(_impl_._cached_size_)*/ {}}; + decltype(_impl_.team_id_){}, decltype(_impl_.player_id_){}, decltype(_impl_.score_){}, decltype(_impl_.energy_){}, decltype(_impl_.guid_){}, /*decltype(_impl_._cached_size_)*/ {}}; _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); ::memcpy(&_impl_.team_id_, &from._impl_.team_id_, static_cast(reinterpret_cast(&_impl_.guid_) - reinterpret_cast(&_impl_.team_id_)) + sizeof(_impl_.guid_)); @@ -4647,7 +4647,7 @@ namespace protobuf (void)arena; (void)is_message_owned; new (&_impl_) Impl_{ - decltype(_impl_.team_id_){int64_t{0}}, decltype(_impl_.player_id_){int64_t{0}}, decltype(_impl_.score_){0}, decltype(_impl_.money_){0}, decltype(_impl_.guid_){int64_t{0}}, /*decltype(_impl_._cached_size_)*/ {}}; + decltype(_impl_.team_id_){int64_t{0}}, decltype(_impl_.player_id_){int64_t{0}}, decltype(_impl_.score_){0}, decltype(_impl_.energy_){0}, decltype(_impl_.guid_){int64_t{0}}, /*decltype(_impl_._cached_size_)*/ {}}; } MessageOfTeam::~MessageOfTeam() @@ -4723,11 +4723,11 @@ namespace protobuf else goto handle_unusual; continue; - // int32 money = 4; + // int32 energy = 4; case 4: if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 32)) { - _impl_.money_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr); + _impl_.energy_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr); CHK_(ptr); } else @@ -4798,11 +4798,11 @@ namespace protobuf target = ::_pbi::WireFormatLite::WriteInt32ToArray(3, this->_internal_score(), target); } - // int32 money = 4; - if (this->_internal_money() != 0) + // int32 energy = 4; + if (this->_internal_energy() != 0) { target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteInt32ToArray(4, this->_internal_money(), target); + target = ::_pbi::WireFormatLite::WriteInt32ToArray(4, this->_internal_energy(), target); } // int64 guid = 5; @@ -4849,10 +4849,10 @@ namespace protobuf total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_score()); } - // int32 money = 4; - if (this->_internal_money() != 0) + // int32 energy = 4; + if (this->_internal_energy() != 0) { - total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_money()); + total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_energy()); } // int64 guid = 5; @@ -4893,9 +4893,9 @@ namespace protobuf { _this->_internal_set_score(from._internal_score()); } - if (from._internal_money() != 0) + if (from._internal_energy() != 0) { - _this->_internal_set_money(from._internal_money()); + _this->_internal_set_energy(from._internal_energy()); } if (from._internal_guid() != 0) { @@ -6054,7 +6054,7 @@ namespace protobuf MessageOfAll* const _this = this; (void)_this; new (&_impl_) Impl_{ - decltype(_impl_.game_time_){}, decltype(_impl_.red_team_score_){}, decltype(_impl_.blue_team_score_){}, decltype(_impl_.red_team_money_){}, decltype(_impl_.blue_team_money_){}, decltype(_impl_.red_home_hp_){}, decltype(_impl_.blue_home_hp_){}, /*decltype(_impl_._cached_size_)*/ {}}; + decltype(_impl_.game_time_){}, decltype(_impl_.red_team_score_){}, decltype(_impl_.blue_team_score_){}, decltype(_impl_.red_team_energy_){}, decltype(_impl_.blue_team_energy_){}, decltype(_impl_.red_home_hp_){}, decltype(_impl_.blue_home_hp_){}, /*decltype(_impl_._cached_size_)*/ {}}; _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); ::memcpy(&_impl_.game_time_, &from._impl_.game_time_, static_cast(reinterpret_cast(&_impl_.blue_home_hp_) - reinterpret_cast(&_impl_.game_time_)) + sizeof(_impl_.blue_home_hp_)); @@ -6068,7 +6068,7 @@ namespace protobuf (void)arena; (void)is_message_owned; new (&_impl_) Impl_{ - decltype(_impl_.game_time_){0}, decltype(_impl_.red_team_score_){0}, decltype(_impl_.blue_team_score_){0}, decltype(_impl_.red_team_money_){0}, decltype(_impl_.blue_team_money_){0}, decltype(_impl_.red_home_hp_){0}, decltype(_impl_.blue_home_hp_){0}, /*decltype(_impl_._cached_size_)*/ {}}; + decltype(_impl_.game_time_){0}, decltype(_impl_.red_team_score_){0}, decltype(_impl_.blue_team_score_){0}, decltype(_impl_.red_team_energy_){0}, decltype(_impl_.blue_team_energy_){0}, decltype(_impl_.red_home_hp_){0}, decltype(_impl_.blue_home_hp_){0}, /*decltype(_impl_._cached_size_)*/ {}}; } MessageOfAll::~MessageOfAll() @@ -6144,21 +6144,21 @@ namespace protobuf else goto handle_unusual; continue; - // int32 red_team_money = 4; + // int32 red_team_energy = 4; case 4: if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 32)) { - _impl_.red_team_money_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr); + _impl_.red_team_energy_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr); CHK_(ptr); } else goto handle_unusual; continue; - // int32 blue_team_money = 5; + // int32 blue_team_energy = 5; case 5: if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 40)) { - _impl_.blue_team_money_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr); + _impl_.blue_team_energy_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr); CHK_(ptr); } else @@ -6239,18 +6239,18 @@ namespace protobuf target = ::_pbi::WireFormatLite::WriteInt32ToArray(3, this->_internal_blue_team_score(), target); } - // int32 red_team_money = 4; - if (this->_internal_red_team_money() != 0) + // int32 red_team_energy = 4; + if (this->_internal_red_team_energy() != 0) { target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteInt32ToArray(4, this->_internal_red_team_money(), target); + target = ::_pbi::WireFormatLite::WriteInt32ToArray(4, this->_internal_red_team_energy(), target); } - // int32 blue_team_money = 5; - if (this->_internal_blue_team_money() != 0) + // int32 blue_team_energy = 5; + if (this->_internal_blue_team_energy() != 0) { target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteInt32ToArray(5, this->_internal_blue_team_money(), target); + target = ::_pbi::WireFormatLite::WriteInt32ToArray(5, this->_internal_blue_team_energy(), target); } // int32 red_home_hp = 6; @@ -6304,16 +6304,16 @@ namespace protobuf total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_blue_team_score()); } - // int32 red_team_money = 4; - if (this->_internal_red_team_money() != 0) + // int32 red_team_energy = 4; + if (this->_internal_red_team_energy() != 0) { - total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_red_team_money()); + total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_red_team_energy()); } - // int32 blue_team_money = 5; - if (this->_internal_blue_team_money() != 0) + // int32 blue_team_energy = 5; + if (this->_internal_blue_team_energy() != 0) { - total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_blue_team_money()); + total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_blue_team_energy()); } // int32 red_home_hp = 6; @@ -6360,13 +6360,13 @@ namespace protobuf { _this->_internal_set_blue_team_score(from._internal_blue_team_score()); } - if (from._internal_red_team_money() != 0) + if (from._internal_red_team_energy() != 0) { - _this->_internal_set_red_team_money(from._internal_red_team_money()); + _this->_internal_set_red_team_energy(from._internal_red_team_energy()); } - if (from._internal_blue_team_money() != 0) + if (from._internal_blue_team_energy() != 0) { - _this->_internal_set_blue_team_money(from._internal_blue_team_money()); + _this->_internal_set_blue_team_energy(from._internal_blue_team_energy()); } if (from._internal_red_home_hp() != 0) { diff --git a/CAPI/cpp/proto/Message2Clients.pb.h b/CAPI/cpp/proto/Message2Clients.pb.h index ed9b8d23..200accd3 100644 --- a/CAPI/cpp/proto/Message2Clients.pb.h +++ b/CAPI/cpp/proto/Message2Clients.pb.h @@ -3032,7 +3032,7 @@ namespace protobuf kTeamIdFieldNumber = 1, kPlayerIdFieldNumber = 2, kScoreFieldNumber = 3, - kMoneyFieldNumber = 4, + kEnergyFieldNumber = 4, kGuidFieldNumber = 5, }; // int64 team_id = 1; @@ -3065,14 +3065,14 @@ namespace protobuf void _internal_set_score(int32_t value); public: - // int32 money = 4; - void clear_money(); - int32_t money() const; - void set_money(int32_t value); + // int32 energy = 4; + void clear_energy(); + int32_t energy() const; + void set_energy(int32_t value); private: - int32_t _internal_money() const; - void _internal_set_money(int32_t value); + int32_t _internal_energy() const; + void _internal_set_energy(int32_t value); public: // int64 guid = 5; @@ -3099,7 +3099,7 @@ namespace protobuf int64_t team_id_; int64_t player_id_; int32_t score_; - int32_t money_; + int32_t energy_; int64_t guid_; mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; }; @@ -3795,8 +3795,8 @@ namespace protobuf kGameTimeFieldNumber = 1, kRedTeamScoreFieldNumber = 2, kBlueTeamScoreFieldNumber = 3, - kRedTeamMoneyFieldNumber = 4, - kBlueTeamMoneyFieldNumber = 5, + kRedTeamEnergyFieldNumber = 4, + kBlueTeamEnergyFieldNumber = 5, kRedHomeHpFieldNumber = 6, kBlueHomeHpFieldNumber = 7, }; @@ -3830,24 +3830,24 @@ namespace protobuf void _internal_set_blue_team_score(int32_t value); public: - // int32 red_team_money = 4; - void clear_red_team_money(); - int32_t red_team_money() const; - void set_red_team_money(int32_t value); + // int32 red_team_energy = 4; + void clear_red_team_energy(); + int32_t red_team_energy() const; + void set_red_team_energy(int32_t value); private: - int32_t _internal_red_team_money() const; - void _internal_set_red_team_money(int32_t value); + int32_t _internal_red_team_energy() const; + void _internal_set_red_team_energy(int32_t value); public: - // int32 blue_team_money = 5; - void clear_blue_team_money(); - int32_t blue_team_money() const; - void set_blue_team_money(int32_t value); + // int32 blue_team_energy = 5; + void clear_blue_team_energy(); + int32_t blue_team_energy() const; + void set_blue_team_energy(int32_t value); private: - int32_t _internal_blue_team_money() const; - void _internal_set_blue_team_money(int32_t value); + int32_t _internal_blue_team_energy() const; + void _internal_set_blue_team_energy(int32_t value); public: // int32 red_home_hp = 6; @@ -3884,8 +3884,8 @@ namespace protobuf int32_t game_time_; int32_t red_team_score_; int32_t blue_team_score_; - int32_t red_team_money_; - int32_t blue_team_money_; + int32_t red_team_energy_; + int32_t blue_team_energy_; int32_t red_home_hp_; int32_t blue_home_hp_; mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; @@ -6812,28 +6812,28 @@ namespace protobuf // @@protoc_insertion_point(field_set:protobuf.MessageOfTeam.score) } - // int32 money = 4; - inline void MessageOfTeam::clear_money() + // int32 energy = 4; + inline void MessageOfTeam::clear_energy() { - _impl_.money_ = 0; + _impl_.energy_ = 0; } - inline int32_t MessageOfTeam::_internal_money() const + inline int32_t MessageOfTeam::_internal_energy() const { - return _impl_.money_; + return _impl_.energy_; } - inline int32_t MessageOfTeam::money() const + inline int32_t MessageOfTeam::energy() const { - // @@protoc_insertion_point(field_get:protobuf.MessageOfTeam.money) - return _internal_money(); + // @@protoc_insertion_point(field_get:protobuf.MessageOfTeam.energy) + return _internal_energy(); } - inline void MessageOfTeam::_internal_set_money(int32_t value) + inline void MessageOfTeam::_internal_set_energy(int32_t value) { - _impl_.money_ = value; + _impl_.energy_ = value; } - inline void MessageOfTeam::set_money(int32_t value) + inline void MessageOfTeam::set_energy(int32_t value) { - _internal_set_money(value); - // @@protoc_insertion_point(field_set:protobuf.MessageOfTeam.money) + _internal_set_energy(value); + // @@protoc_insertion_point(field_set:protobuf.MessageOfTeam.energy) } // int64 guid = 5; @@ -8080,52 +8080,52 @@ namespace protobuf // @@protoc_insertion_point(field_set:protobuf.MessageOfAll.blue_team_score) } - // int32 red_team_money = 4; - inline void MessageOfAll::clear_red_team_money() + // int32 red_team_energy = 4; + inline void MessageOfAll::clear_red_team_energy() { - _impl_.red_team_money_ = 0; + _impl_.red_team_energy_ = 0; } - inline int32_t MessageOfAll::_internal_red_team_money() const + inline int32_t MessageOfAll::_internal_red_team_energy() const { - return _impl_.red_team_money_; + return _impl_.red_team_energy_; } - inline int32_t MessageOfAll::red_team_money() const + inline int32_t MessageOfAll::red_team_energy() const { - // @@protoc_insertion_point(field_get:protobuf.MessageOfAll.red_team_money) - return _internal_red_team_money(); + // @@protoc_insertion_point(field_get:protobuf.MessageOfAll.red_team_energy) + return _internal_red_team_energy(); } - inline void MessageOfAll::_internal_set_red_team_money(int32_t value) + inline void MessageOfAll::_internal_set_red_team_energy(int32_t value) { - _impl_.red_team_money_ = value; + _impl_.red_team_energy_ = value; } - inline void MessageOfAll::set_red_team_money(int32_t value) + inline void MessageOfAll::set_red_team_energy(int32_t value) { - _internal_set_red_team_money(value); - // @@protoc_insertion_point(field_set:protobuf.MessageOfAll.red_team_money) + _internal_set_red_team_energy(value); + // @@protoc_insertion_point(field_set:protobuf.MessageOfAll.red_team_energy) } - // int32 blue_team_money = 5; - inline void MessageOfAll::clear_blue_team_money() + // int32 blue_team_energy = 5; + inline void MessageOfAll::clear_blue_team_energy() { - _impl_.blue_team_money_ = 0; + _impl_.blue_team_energy_ = 0; } - inline int32_t MessageOfAll::_internal_blue_team_money() const + inline int32_t MessageOfAll::_internal_blue_team_energy() const { - return _impl_.blue_team_money_; + return _impl_.blue_team_energy_; } - inline int32_t MessageOfAll::blue_team_money() const + inline int32_t MessageOfAll::blue_team_energy() const { - // @@protoc_insertion_point(field_get:protobuf.MessageOfAll.blue_team_money) - return _internal_blue_team_money(); + // @@protoc_insertion_point(field_get:protobuf.MessageOfAll.blue_team_energy) + return _internal_blue_team_energy(); } - inline void MessageOfAll::_internal_set_blue_team_money(int32_t value) + inline void MessageOfAll::_internal_set_blue_team_energy(int32_t value) { - _impl_.blue_team_money_ = value; + _impl_.blue_team_energy_ = value; } - inline void MessageOfAll::set_blue_team_money(int32_t value) + inline void MessageOfAll::set_blue_team_energy(int32_t value) { - _internal_set_blue_team_money(value); - // @@protoc_insertion_point(field_set:protobuf.MessageOfAll.blue_team_money) + _internal_set_blue_team_energy(value); + // @@protoc_insertion_point(field_set:protobuf.MessageOfAll.blue_team_energy) } // int32 red_home_hp = 6; diff --git a/CAPI/python/PyAPI/constants.py b/CAPI/python/PyAPI/constants.py index b94afb62..c69c86bc 100644 --- a/CAPI/python/PyAPI/constants.py +++ b/CAPI/python/PyAPI/constants.py @@ -15,12 +15,12 @@ class Constants: class Home: maxHp = 24000 - moneySpeed = 1 + energySpeed = 1 class Factory: maxHp = 8000 - moneySpeed = 3 + energySpeed = 3 class Community: @@ -58,9 +58,9 @@ class FlagShip: class Producer: - moneySpeed1 = 5 - moneySpeed2 = 7 - moneySpeed3 = 10 + energySpeed1 = 5 + energySpeed2 = 7 + energySpeed3 = 10 Cost1 = 0 Cost2 = 40 Cost3 = 80 diff --git a/dependency/proto/Message2Clients.proto b/dependency/proto/Message2Clients.proto index 85235443..c5fecfbd 100755 --- a/dependency/proto/Message2Clients.proto +++ b/dependency/proto/Message2Clients.proto @@ -112,7 +112,7 @@ message MessageOfTeam int64 team_id = 1; int64 player_id = 2; int32 score = 3; - int32 money = 4; + int32 energy = 4; int64 guid=5; } @@ -140,8 +140,8 @@ message MessageOfAll int32 game_time = 1; int32 red_team_score=2; int32 blue_team_score=3; - int32 red_team_money=4; - int32 blue_team_money=5; + int32 red_team_energy=4; + int32 blue_team_energy=5; int32 red_home_hp=6; int32 blue_home_hp=7; } From 4a06927d69cf1a0b6479836e6182981e77c7b8ed Mon Sep 17 00:00:00 2001 From: sigureling <1678348940@qq.com> Date: Tue, 12 Mar 2024 00:30:40 +0800 Subject: [PATCH 10/16] refactor: :bug: remove remains from THUAI6 --- CAPI/cpp/API/include/constants.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/CAPI/cpp/API/include/constants.h b/CAPI/cpp/API/include/constants.h index 809ea1a3..4d8b268e 100755 --- a/CAPI/cpp/API/include/constants.h +++ b/CAPI/cpp/API/include/constants.h @@ -14,10 +14,10 @@ namespace Constants { SCCI int32_t frameDuration = 50; // 每帧毫秒数 // 地图相关 - SCCI int32_t numOfGridPerCell = 1000; // 单位坐标数 - SCCI int32_t rows = 50; // 地图行数 - SCCI int32_t cols = 50; // 地图列数 - SCCI int32_t maxGarbageProgress = 200; // 大门最大进度 + SCCI int32_t numOfGridPerCell = 1000; // 单位坐标数 + SCCI int32_t rows = 50; // 地图行数 + SCCI int32_t cols = 50; // 地图列数 + SCCI int32_t maxGarbageProgress = 200; SCCI int32_t maxBridgeHp = 18000; SCCI double robPercent = 0.2; // 击杀获得经济比率 SCCI int32_t DestroyBuildingBonus = 200; From 9b0a6047ba5c0b94752c3a5f92c346a280d275fc Mon Sep 17 00:00:00 2001 From: shangfengh <3495281661@qq.com> Date: Tue, 12 Mar 2024 11:02:09 +0800 Subject: [PATCH 11/16] refactor: :bug: use the LockedClassList --- logic/Client/View/MainPage.xaml.cs | 1 - logic/GameClass/GameObj/Areas/Wormhole.cs | 2 +- logic/GameClass/GameObj/Map/Map.cs | 238 ++++-------------- logic/GameEngine/CollisionChecker.cs | 144 +++++------ logic/Gaming/AttackManager.cs | 16 +- logic/Gaming/Game.cs | 86 +++---- logic/Preparation/Interface/IMap.cs | 3 +- .../Utility/SafeValue/ListLocked.cs | 22 ++ logic/Server/GameServer.cs | 17 +- 9 files changed, 166 insertions(+), 363 deletions(-) diff --git a/logic/Client/View/MainPage.xaml.cs b/logic/Client/View/MainPage.xaml.cs index c6f8c92c..2165b8aa 100644 --- a/logic/Client/View/MainPage.xaml.cs +++ b/logic/Client/View/MainPage.xaml.cs @@ -13,7 +13,6 @@ using Client.ViewModel; using Client.Model; using System.Reflection; -using Windows.Gaming.Input; namespace Client { diff --git a/logic/GameClass/GameObj/Areas/Wormhole.cs b/logic/GameClass/GameObj/Areas/Wormhole.cs index 46f99539..fdb68635 100755 --- a/logic/GameClass/GameObj/Areas/Wormhole.cs +++ b/logic/GameClass/GameObj/Areas/Wormhole.cs @@ -8,7 +8,7 @@ namespace GameClass.GameObj.Areas; public class Wormhole : Immovable, IWormhole { public LongInTheVariableRange HP = new LongInTheVariableRange(GameData.WormholeHP); - private List grids = new(); + private readonly List grids = new(); public List Grids => grids; public override bool IsRigid => HP > GameData.WormholeHP / 2; public override ShapeType Shape => ShapeType.Square; diff --git a/logic/GameClass/GameObj/Map/Map.cs b/logic/GameClass/GameObj/Map/Map.cs index 023d7af0..1ceb0ff8 100755 --- a/logic/GameClass/GameObj/Map/Map.cs +++ b/logic/GameClass/GameObj/Map/Map.cs @@ -11,8 +11,8 @@ namespace GameClass.GameObj { public partial class Map : IMap { - public Dictionary> GameObjDict { get; } - public Dictionary GameObjLockDict { get; } + private Dictionary> gameObjDict; + public Dictionary> GameObjDict => gameObjDict; private readonly uint height; public uint Height => height; private readonly uint width; @@ -62,151 +62,45 @@ public IOutOfBound GetOutOfBound(XY pos) { return new OutOfBoundBlock(pos); } + public Ship? FindShipInID(long ID) { - Ship? ship = null; - GameObjLockDict[GameObjType.Ship].EnterReadLock(); - try - { - foreach (Ship s in GameObjDict[GameObjType.Ship].Cast()) - { - if (s.ID == ID) - { - ship = s; - break; - } - } - } - finally - { - GameObjLockDict[GameObjType.Ship].ExitReadLock(); - } - return ship; + return (Ship?)GameObjDict[GameObjType.Ship].Find(gameObj => (ID == ((Ship)gameObj).ID)); } public Ship? FindShipInShipID(long shipID) { - Ship? ship = null; - GameObjLockDict[GameObjType.Ship].EnterReadLock(); - try - { - foreach (Ship s in GameObjDict[GameObjType.Ship].Cast()) - { - if (s.ShipID == shipID) - { - ship = s; - break; - } - } - } - finally + return (Ship?)GameObjDict[GameObjType.Ship].Find(gameObj => (shipID == ((Ship)gameObj).ShipID)); + } + + public bool WormholeInteract(Wormhole gameObj, XY Pos) + { + foreach (XY xy in gameObj.Grids) { - GameObjLockDict[GameObjType.Ship].ExitReadLock(); + if (GameData.ApproachToInteract(xy, Pos)) + return true; } - return ship; + return false; } public GameObj? OneForInteract(XY Pos, GameObjType gameObjType) { - GameObj? GameObjForInteract = null; - GameObjLockDict[gameObjType].EnterReadLock(); - try - { - foreach (GameObj gameObj in GameObjDict[gameObjType].Cast()) - { - if (gameObjType == GameObjType.Wormhole) - { - bool flag = false; - foreach (XY xy in ((Wormhole)gameObj).Grids) - { - if (GameData.ApproachToInteract(xy, Pos)) - { - GameObjForInteract = gameObj; - flag = true; - break; - } - } - if (flag) - { - break; - } - } - else - { - if (GameData.ApproachToInteract(gameObj.Position, Pos)) - { - GameObjForInteract = gameObj; - break; - } - } - } - } - finally - { - GameObjLockDict[gameObjType].ExitReadLock(); - } - return GameObjForInteract; + return (GameObj?)GameObjDict[gameObjType].Find(gameObj => + ((GameData.ApproachToInteract(gameObj.Position, Pos))|| + (gameObjType == GameObjType.Wormhole||WormholeInteract((Wormhole)gameObj, Pos))) + ); } + public GameObj? OneInTheSameCell(XY Pos, GameObjType gameObjType) { - GameObj? GameObjForInteract = null; - GameObjLockDict[gameObjType].EnterReadLock(); - try - { - foreach (GameObj gameObj in GameObjDict[gameObjType].Cast()) - { - if (GameData.IsInTheSameCell(gameObj.Position, Pos)) - { - GameObjForInteract = gameObj; - break; - } - } - } - finally - { - GameObjLockDict[gameObjType].ExitReadLock(); - } - return GameObjForInteract; + return (GameObj?)GameObjDict[gameObjType].Find(gameObj => (GameData.IsInTheSameCell(gameObj.Position, Pos))); } public GameObj? PartInTheSameCell(XY Pos, GameObjType gameObjType) { - GameObj? GameObjForInteract = null; - GameObjLockDict[gameObjType].EnterReadLock(); - try - { - foreach (GameObj gameObj in GameObjDict[gameObjType].Cast()) - { - if (GameData.PartInTheSameCell(gameObj.Position, Pos)) - { - GameObjForInteract = gameObj; - break; - } - } - } - finally - { - GameObjLockDict[gameObjType].ExitReadLock(); - } - return GameObjForInteract; + return (GameObj?)GameObjDict[gameObjType].Find(gameObj => (GameData.PartInTheSameCell(gameObj.Position, Pos))); } public GameObj? OneForInteractInACross(XY Pos, GameObjType gameObjType) { - GameObj? GameObjForInteract = null; - GameObjLockDict[gameObjType].EnterReadLock(); - try - { - foreach (GameObj gameObj in GameObjDict[gameObjType].Cast()) - { - if (GameData.ApproachToInteractInACross(gameObj.Position, Pos)) - { - GameObjForInteract = gameObj; - break; - } - } - } - finally - { - GameObjLockDict[gameObjType].ExitReadLock(); - } - return GameObjForInteract; + return (GameObj?)GameObjDict[gameObjType].Find(gameObj => + GameData.ApproachToInteractInACross(gameObj.Position, Pos)); } public bool CanSee(Ship ship, GameObj gameObj) { @@ -257,69 +151,34 @@ public bool CanSee(Ship ship, GameObj gameObj) } public bool Remove(GameObj gameObj) { - GameObj? ToDel = null; - GameObjLockDict[gameObj.Type].EnterWriteLock(); - try - { - foreach (GameObj obj in GameObjDict[gameObj.Type].Cast()) - { - if (gameObj.ID == obj.ID) - { - ToDel = obj; - break; - } - } - if (ToDel != null) - { - GameObjDict[gameObj.Type].Remove(ToDel); - ToDel.TryToRemove(); - } - } - finally + if (GameObjDict[gameObj.Type].RemoveOne(obj => gameObj.ID == obj.ID)) { - GameObjLockDict[gameObj.Type].ExitWriteLock(); + gameObj.TryToRemove(); + return true; } - return ToDel != null; + return false; } public bool RemoveJustFromMap(GameObj gameObj) { - GameObjLockDict[gameObj.Type].EnterWriteLock(); - try - { - if (GameObjDict[gameObj.Type].Remove(gameObj)) - { - gameObj.TryToRemove(); - return true; - } - return false; - } - finally + if (GameObjDict[gameObj.Type].Remove(gameObj)) { - GameObjLockDict[gameObj.Type].ExitWriteLock(); + gameObj.TryToRemove(); + return true; } + return false; } public void Add(IGameObj gameObj) { - GameObjLockDict[gameObj.Type].EnterWriteLock(); - try - { - GameObjDict[gameObj.Type].Add(gameObj); - } - finally - { - GameObjLockDict[gameObj.Type].ExitWriteLock(); - } + GameObjDict[gameObj.Type].Add(gameObj); } public Map(MapStruct mapResource) { - GameObjDict = []; - GameObjLockDict = []; + gameObjDict = new Dictionary>(); foreach (GameObjType idx in Enum.GetValues(typeof(GameObjType))) { if (idx != GameObjType.Null) { - GameObjDict.Add(idx, new List()); - GameObjLockDict.Add(idx, new ReaderWriterLockSlim()); + gameObjDict.TryAdd(idx, new LockedClassList()); } } height = mapResource.height; @@ -339,31 +198,22 @@ public Map(MapStruct mapResource) Add(new Construction(GameData.GetCellCenterPos(i, j))); break; case PlaceType.Wormhole: - foreach (Wormhole wormhole in GameObjDict[GameObjType.Wormhole].Cast()) + Func HasWormhole = (Wormhole wormhole) => { if (wormhole.Grids.Contains(new XY(i, j))) + return true; + foreach (XY xy in wormhole.Grids) { - hasWormhole = true; - break; - } - else - { - foreach (XY xy in wormhole.Grids) - { - if (Math.Abs(xy.x - i) <= 1 && Math.Abs(xy.y - j) <= 1) - { - wormhole.Grids.Add(new XY(i, j)); - hasWormhole = true; - break; - } - } - if (hasWormhole) + if (Math.Abs(xy.x - i) <= 1 && Math.Abs(xy.y - j) <= 1) { - break; + wormhole.Grids.Add(new XY(i, j)); + return true; } } - } - if (!hasWormhole) + return false; + }; + + if (GameObjDict[GameObjType.Wormhole].Cast().Find(wormhole=>HasWormhole(wormhole))==null) { List grids = [new XY(i, j)]; Add(new Wormhole(GameData.GetCellCenterPos(i, j), grids)); @@ -376,7 +226,7 @@ public Map(MapStruct mapResource) } } } - Homes = GameObjDict[GameObjType.Home].Cast().ToList(); + Homes = GameObjDict[GameObjType.Home].Cast().ToNewList(); } } } \ No newline at end of file diff --git a/logic/GameEngine/CollisionChecker.cs b/logic/GameEngine/CollisionChecker.cs index 360e4866..d8dddcbb 100755 --- a/logic/GameEngine/CollisionChecker.cs +++ b/logic/GameEngine/CollisionChecker.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Linq; using System.Threading; using Preparation.Interface; using Preparation.Utility; @@ -11,33 +12,16 @@ internal class CollisionChecker public IGameObj? CheckCollision(IMovable obj, XY Pos) { // 在列表中检查碰撞 - Func, ReaderWriterLockSlim, IGameObj?> CheckCollisionInList = - (IEnumerable lst, ReaderWriterLockSlim listLock) => + Func, IGameObj?> CheckCollisionInList = + (LockedClassList lst) => { - IGameObj? collisionObj = null; - listLock.EnterReadLock(); - try - { - foreach (var listObj in lst) - { - if (obj.WillCollideWith(listObj, Pos)) - { - collisionObj = listObj; - break; - } - } - } - finally - { - listLock.ExitReadLock(); - } - return collisionObj; + return lst.Find(listObj => obj.WillCollideWith(listObj, Pos)); }; IGameObj? collisionObj; foreach (var list in lists) { - if ((collisionObj = CheckCollisionInList(list.Item1, list.Item2)) != null) + if ((collisionObj = CheckCollisionInList(list)) != null) { return collisionObj; } @@ -126,102 +110,88 @@ public double FindMax(IMovable obj, XY moveVec) double tmpMax = uint.MaxValue; // 暂存最大值 double maxDistance = uint.MaxValue; - foreach (var listWithLock in lists) + foreach (var lst in lists) { - var lst = listWithLock.Item1; - var listLock = listWithLock.Item2; - listLock.EnterReadLock(); - try + lst.ForEach(listObj => { - foreach (IGameObj listObj in lst) + // 如果再走一步发生碰撞 + if (obj.WillCollideWith(listObj, nextPos)) { - // 如果再走一步发生碰撞 - if (obj.WillCollideWith(listObj, nextPos)) { + switch (listObj.Shape) // 默认obj为圆形 { - switch (listObj.Shape) // 默认obj为圆形 - { - case ShapeType.Circle: - { - // 计算两者之间的距离 - double mod = XY.DistanceFloor3(listObj.Position, obj.Position); - int orgDeltaX = listObj.Position.x - obj.Position.x; - int orgDeltaY = listObj.Position.y - obj.Position.y; + case ShapeType.Circle: + { + // 计算两者之间的距离 + double mod = XY.DistanceFloor3(listObj.Position, obj.Position); + int orgDeltaX = listObj.Position.x - obj.Position.x; + int orgDeltaY = listObj.Position.y - obj.Position.y; - if (mod < listObj.Radius + obj.Radius) // 如果两者已经重叠 + if (mod < listObj.Radius + obj.Radius) // 如果两者已经重叠 + { + tmpMax = 0; + } + else + { + double tmp = mod - obj.Radius - listObj.Radius; + // 计算能走的最长距离,好像这么算有一点误差? + tmp = ((int)(tmp * 1000 / Math.Cos(Math.Atan2(orgDeltaY, orgDeltaX) - moveVec.Angle()))); + if (tmp < 0 || tmp > uint.MaxValue || double.IsNaN(tmp)) { - tmpMax = 0; + tmpMax = uint.MaxValue; } else - { - double tmp = mod - obj.Radius - listObj.Radius; - // 计算能走的最长距离,好像这么算有一点误差? - tmp = ((int)(tmp * 1000 / Math.Cos(Math.Atan2(orgDeltaY, orgDeltaX) - moveVec.Angle()))); - if (tmp < 0 || tmp > uint.MaxValue || double.IsNaN(tmp)) - { - tmpMax = uint.MaxValue; - } - else - tmpMax = tmp / 1000.0; - } - break; + tmpMax = tmp / 1000.0; } - case ShapeType.Square: + break; + } + case ShapeType.Square: + { + // if (obj.WillCollideWith(listObj, obj.Position)) + // tmpMax = 0; + // else tmpMax = MaxMoveToSquare(obj, listObj); + // break; + if (obj.WillCollideWith(listObj, obj.Position)) + tmpMax = 0; + else { - // if (obj.WillCollideWith(listObj, obj.Position)) - // tmpMax = 0; - // else tmpMax = MaxMoveToSquare(obj, listObj); - // break; - if (obj.WillCollideWith(listObj, obj.Position)) - tmpMax = 0; - else + // 二分查找最大可能移动距离 + int left = 0, right = (int)moveVec.Length(); + while (left < right - 1) { - // 二分查找最大可能移动距离 - int left = 0, right = (int)moveVec.Length(); - while (left < right - 1) + int mid = (right - left) / 2 + left; + if (obj.WillCollideWith(listObj, obj.Position + new XY(moveVec, mid))) { - int mid = (right - left) / 2 + left; - if (obj.WillCollideWith(listObj, obj.Position + new XY(moveVec, mid))) - { - right = mid; - } - else - left = mid; + right = mid; } - tmpMax = (uint)left; + else + left = mid; } - break; + tmpMax = (uint)left; } - default: - tmpMax = uint.MaxValue; break; - } - if (tmpMax < maxDistance) - maxDistance = tmpMax; + } + default: + tmpMax = uint.MaxValue; + break; } + if (tmpMax < maxDistance) + maxDistance = tmpMax; } } } - finally - { - listLock.ExitReadLock(); - } + ); } return maxDistance; } readonly IMap gameMap; - private readonly Tuple, ReaderWriterLockSlim>[] lists; + private readonly LockedClassList[] lists; public CollisionChecker(IMap gameMap) { this.gameMap = gameMap; - lists = new Tuple, ReaderWriterLockSlim>[gameMap.GameObjDict.Count]; - int i = 0; - foreach (var keyValuePair in gameMap.GameObjDict) - { - lists[i++] = new Tuple, ReaderWriterLockSlim>(keyValuePair.Value as IList, gameMap.GameObjLockDict[keyValuePair.Key]); - } + lists = gameMap.GameObjDict.Values.ToArray(); } } } diff --git a/logic/Gaming/AttackManager.cs b/logic/Gaming/AttackManager.cs index 5182c76b..6d9898e1 100755 --- a/logic/Gaming/AttackManager.cs +++ b/logic/Gaming/AttackManager.cs @@ -98,21 +98,7 @@ private void BulletBomb(Bullet bullet, GameObj? objBeingShot) { if (bullet.CanBeBombed(kvp.Key)) { - gameMap.GameObjLockDict[kvp.Key].EnterReadLock(); - try - { - foreach (var item in gameMap.GameObjDict[kvp.Key]) - { - if (bullet.CanAttack((GameObj)item)) - { - beAttackedList.Add(item); - } - } - } - finally - { - gameMap.GameObjLockDict[kvp.Key].ExitReadLock(); - } + beAttackedList.AddRange(gameMap.GameObjDict[kvp.Key].FindAll(gameObj => bullet.CanAttack((GameObj)gameObj))); } } foreach (GameObj beAttackedObj in beAttackedList) diff --git a/logic/Gaming/Game.cs b/logic/Gaming/Game.cs index 3a6d8fa0..46ba038f 100755 --- a/logic/Gaming/Game.cs +++ b/logic/Gaming/Game.cs @@ -201,22 +201,11 @@ public void ClearAllLists() { if (!GameData.NeedCopy(keyValuePair.Key)) { - gameMap.GameObjLockDict[keyValuePair.Key].EnterWriteLock(); - try + gameMap.GameObjDict[GameObjType.Ship].ForEach(delegate (IGameObj ship) { - if (keyValuePair.Key == GameObjType.Ship) - { - foreach (Ship ship in gameMap.GameObjDict[GameObjType.Ship].Cast()) - { - ship.CanMove.SetReturnOri(false); - } - } - gameMap.GameObjDict[keyValuePair.Key].Clear(); - } - finally - { - gameMap.GameObjLockDict[keyValuePair.Key].ExitWriteLock(); - } + ((Ship)ship).CanMove.SetReturnOri(false); + }); + gameMap.GameObjDict[keyValuePair.Key].Clear(); } } } @@ -239,45 +228,40 @@ public List GetGameObj() { if (GameData.NeedCopy(keyValuePair.Key)) { - gameMap.GameObjLockDict[keyValuePair.Key].EnterReadLock(); - try - { - gameObjList.AddRange(gameMap.GameObjDict[keyValuePair.Key]); - } - finally - { - gameMap.GameObjLockDict[keyValuePair.Key].ExitReadLock(); - } + gameObjList.AddRange(gameMap.GameObjDict[keyValuePair.Key].ToNewList()); } } return gameObjList; } public void UpdateBirthPoint() { - foreach (Construction construction in gameMap.GameObjDict[GameObjType.Construction].Cast()) - { - if (construction.ConstructionType == ConstructionType.Community) + gameMap.GameObjDict[GameObjType.Construction].Cast().ForEach( + delegate(Construction construction) { - bool exist = false; - foreach (XY birthPoint in teamList[(int)construction.TeamID].BirthPointList) + if (construction.ConstructionType == ConstructionType.Community) { - if (construction.Position == birthPoint) + bool exist = false; + foreach (XY birthPoint in teamList[(int)construction.TeamID].BirthPointList) + { + if (construction.Position == birthPoint) + { + exist = true; + break; + } + } + if (!exist) { - exist = true; - break; + teamList[(int)construction.TeamID].BirthPointList.Add(construction.Position); } } - if (!exist) - { - teamList[(int)construction.TeamID].BirthPointList.Add(construction.Position); - } } - } + ); foreach (Team team in teamList) { foreach (XY birthPoint in team.BirthPointList) { - foreach (Construction construction in gameMap.GameObjDict[GameObjType.Construction].Cast()) + gameMap.GameObjDict[GameObjType.Construction].Cast().ForEach( + delegate(Construction construction) { if (construction.Position == birthPoint) { @@ -287,6 +271,7 @@ public void UpdateBirthPoint() } } } + ); } } } @@ -298,19 +283,22 @@ public Game(MapStruct mapResource, int numOfTeam) actionManager = new(gameMap, shipManager); attackManager = new(gameMap, shipManager); teamList = []; - foreach (GameObj gameObj in gameMap.GameObjDict[GameObjType.Home].Cast()) - { - if (gameObj.Type == GameObjType.Home) - { - teamList.Add(new Team((Home)gameObj)); - teamList.Last().BirthPointList.Add(gameObj.Position); - teamList.Last().AddMoney(GameData.InitialMoney); - } - if (teamList.Count == numOfTeam) + gameMap.GameObjDict[GameObjType.Home].Cast().ForEach( + delegate (GameObj gameObj) { - break; + if (gameObj.Type == GameObjType.Home) + { + teamList.Add(new Team((Home)gameObj)); + teamList.Last().BirthPointList.Add(gameObj.Position); + teamList.Last().AddMoney(GameData.InitialMoney); + } + /* if (teamList.Count == numOfTeam) + { + break; + }*/ } - } + ); + } } } diff --git a/logic/Preparation/Interface/IMap.cs b/logic/Preparation/Interface/IMap.cs index 5fa87d19..1a6c6329 100755 --- a/logic/Preparation/Interface/IMap.cs +++ b/logic/Preparation/Interface/IMap.cs @@ -9,8 +9,7 @@ public interface IMap ITimer Timer { get; } // the two dicts must have same keys - Dictionary> GameObjDict { get; } - Dictionary GameObjLockDict { get; } + Dictionary> GameObjDict { get; } public PlaceType[,] ProtoGameMap { get; } public PlaceType GetPlaceType(IGameObj obj); diff --git a/logic/Preparation/Utility/SafeValue/ListLocked.cs b/logic/Preparation/Utility/SafeValue/ListLocked.cs index 7a1c9dd4..2366ea90 100755 --- a/logic/Preparation/Utility/SafeValue/ListLocked.cs +++ b/logic/Preparation/Utility/SafeValue/ListLocked.cs @@ -1,5 +1,7 @@ using System; +using System.Collections; using System.Collections.Generic; +using System.Linq; using System.Threading; namespace Preparation.Utility @@ -56,6 +58,10 @@ public void Add(T item) { WriteLock(() => { list.Add(item); }); } + public void AddRange(IEnumerable lt) + { + WriteLock(() => { list.AddRange(lt); }); + } public void Insert(int index, T item) { @@ -159,6 +165,22 @@ public List FindAll(Predicate match) public int FindIndex(Predicate match) => ReadLock(() => { return list.FindIndex(match); }); public void ForEach(Action action) => ReadLock(() => { list.ForEach(action); }); + + public Array ToArray() + { + return ReadLock(() => { return list.ToArray(); }); + } + public List ToNewList() + { + List lt = new(); + return ReadLock(() => { lt.AddRange(list); return lt; }); + } + + public LockedClassList Cast() where TResult : class + { + LockedClassList lt = new(); + return ReadLock(() => { lt.AddRange(list.Cast()); return lt; }); + } #endregion } } \ No newline at end of file diff --git a/logic/Server/GameServer.cs b/logic/Server/GameServer.cs index c7129052..2cce8421 100755 --- a/logic/Server/GameServer.cs +++ b/logic/Server/GameServer.cs @@ -177,20 +177,9 @@ public void ReportGame(GameState gameState, bool requiredGaming = true) private bool PlayerDeceased(int playerID) //# 这里需要判断大本营deceased吗? { - game.GameMap.GameObjLockDict[GameObjType.Ship].EnterReadLock(); - try - { - foreach (Ship ship in game.GameMap.GameObjDict[GameObjType.Ship].Cast()) - { - if (ship.ShipID == playerID && ship.ShipState == ShipStateType.Deceased) return true; - } - } - finally - { - game.GameMap.GameObjLockDict[GameObjType.Ship].ExitReadLock(); - } - - return false; + return game.GameMap.GameObjDict[GameObjType.Ship].Cast().Find( + ship => ship.ShipID == playerID && ship.ShipState == ShipStateType.Deceased + )!=null; } public override int[] GetMoney() From 8d69451493e4fdb0b08716d95c0957756991bc80 Mon Sep 17 00:00:00 2001 From: shangfengh <3495281661@qq.com> Date: Tue, 12 Mar 2024 12:15:08 +0800 Subject: [PATCH 12/16] style: :art: style --- logic/GameClass/GameObj/Map/Map.cs | 19 +++++++++---------- logic/Gaming/Game.cs | 12 ++++++------ .../Utility/SafeValue/ListLocked.cs | 7 ++++--- logic/Server/GameServer.cs | 2 +- 4 files changed, 20 insertions(+), 20 deletions(-) diff --git a/logic/GameClass/GameObj/Map/Map.cs b/logic/GameClass/GameObj/Map/Map.cs index 1ceb0ff8..cf64fd2c 100755 --- a/logic/GameClass/GameObj/Map/Map.cs +++ b/logic/GameClass/GameObj/Map/Map.cs @@ -72,20 +72,20 @@ public IOutOfBound GetOutOfBound(XY pos) return (Ship?)GameObjDict[GameObjType.Ship].Find(gameObj => (shipID == ((Ship)gameObj).ShipID)); } - public bool WormholeInteract(Wormhole gameObj, XY Pos) + public bool WormholeInteract(Wormhole gameObj, XY Pos) { foreach (XY xy in gameObj.Grids) { if (GameData.ApproachToInteract(xy, Pos)) - return true; + return true; } return false; } public GameObj? OneForInteract(XY Pos, GameObjType gameObjType) { - return (GameObj?)GameObjDict[gameObjType].Find(gameObj => - ((GameData.ApproachToInteract(gameObj.Position, Pos))|| - (gameObjType == GameObjType.Wormhole||WormholeInteract((Wormhole)gameObj, Pos))) + return (GameObj?)GameObjDict[gameObjType].Find(gameObj => + ((GameData.ApproachToInteract(gameObj.Position, Pos)) || + (gameObjType == GameObjType.Wormhole && WormholeInteract((Wormhole)gameObj, Pos))) ); } @@ -151,9 +151,10 @@ public bool CanSee(Ship ship, GameObj gameObj) } public bool Remove(GameObj gameObj) { - if (GameObjDict[gameObj.Type].RemoveOne(obj => gameObj.ID == obj.ID)) + GameObj? ans = (GameObj?)GameObjDict[gameObj.Type].RemoveOne(obj => gameObj.ID == obj.ID); + if (ans != null) { - gameObj.TryToRemove(); + ans.TryToRemove(); return true; } return false; @@ -177,9 +178,7 @@ public Map(MapStruct mapResource) foreach (GameObjType idx in Enum.GetValues(typeof(GameObjType))) { if (idx != GameObjType.Null) - { gameObjDict.TryAdd(idx, new LockedClassList()); - } } height = mapResource.height; width = mapResource.width; @@ -213,7 +212,7 @@ public Map(MapStruct mapResource) return false; }; - if (GameObjDict[GameObjType.Wormhole].Cast().Find(wormhole=>HasWormhole(wormhole))==null) + if (GameObjDict[GameObjType.Wormhole].Cast().Find(wormhole => HasWormhole(wormhole)) == null) { List grids = [new XY(i, j)]; Add(new Wormhole(GameData.GetCellCenterPos(i, j), grids)); diff --git a/logic/Gaming/Game.cs b/logic/Gaming/Game.cs index 667a9242..5eafb115 100755 --- a/logic/Gaming/Game.cs +++ b/logic/Gaming/Game.cs @@ -236,7 +236,7 @@ public List GetGameObj() public void UpdateBirthPoint() { gameMap.GameObjDict[GameObjType.Construction].Cast().ForEach( - delegate(Construction construction) + delegate (Construction construction) { if (construction.ConstructionType == ConstructionType.Community) { @@ -261,7 +261,7 @@ public void UpdateBirthPoint() foreach (XY birthPoint in team.BirthPointList) { gameMap.GameObjDict[GameObjType.Construction].Cast().ForEach( - delegate(Construction construction) + delegate (Construction construction) { if (construction.Position == birthPoint) { @@ -292,10 +292,10 @@ public Game(MapStruct mapResource, int numOfTeam) teamList.Last().BirthPointList.Add(gameObj.Position); teamList.Last().AddMoney(GameData.InitialMoney); } - /* if (teamList.Count == numOfTeam) - { - break; - }*/ + /* if (teamList.Count == numOfTeam) + { + break; + }*/ } ); diff --git a/logic/Preparation/Utility/SafeValue/ListLocked.cs b/logic/Preparation/Utility/SafeValue/ListLocked.cs index 2366ea90..d95e261b 100755 --- a/logic/Preparation/Utility/SafeValue/ListLocked.cs +++ b/logic/Preparation/Utility/SafeValue/ListLocked.cs @@ -80,13 +80,14 @@ public bool Remove(T item) public int RemoveAll(T item) => WriteLock(() => { return list.RemoveAll((t) => { return t == item; }); }); - public bool RemoveOne(Predicate match) => + public T? RemoveOne(Predicate match) => WriteLock(() => { int index = list.FindIndex(match); - if (index == -1) return false; + if (index == -1) return null; + T ans = list[index]; list.RemoveAt(index); - return true; + return ans; }); public int RemoveAll(Predicate match) => WriteLock(() => { return list.RemoveAll(match); }); diff --git a/logic/Server/GameServer.cs b/logic/Server/GameServer.cs index 4fa3a707..9c41e555 100755 --- a/logic/Server/GameServer.cs +++ b/logic/Server/GameServer.cs @@ -179,7 +179,7 @@ private bool PlayerDeceased(int playerID) //# 这里需要判断大本营dece { return game.GameMap.GameObjDict[GameObjType.Ship].Cast().Find( ship => ship.ShipID == playerID && ship.ShipState == ShipStateType.Deceased - )!=null; + ) != null; } public override int[] GetMoney() From f908b16c40cd495552d8764092001c4fb3d16349 Mon Sep 17 00:00:00 2001 From: Xuc Pan Date: Tue, 12 Mar 2024 19:35:31 +0800 Subject: [PATCH 13/16] fix: :bug: fix name issues except Client --- logic/ClientTest/Program.cs | 4 +--- logic/Server/CopyInfo.cs | 16 ++++++++-------- logic/Server/RpcServices.cs | 4 ++-- 3 files changed, 11 insertions(+), 13 deletions(-) diff --git a/logic/ClientTest/Program.cs b/logic/ClientTest/Program.cs index 744ff3ad..5d6f81ab 100755 --- a/logic/ClientTest/Program.cs +++ b/logic/ClientTest/Program.cs @@ -14,9 +14,7 @@ public static Task Main(string[] args) { PlayerId = 0, TeamId = 0, - SweeperType = SweeperType.CivilianSweeper, - X = 30000, - Y = 46000 + SweeperType = SweeperType.CivilianSweeper }; var call = client.AddPlayer(playerInfo); MoveMsg moveMsg = new() diff --git a/logic/Server/CopyInfo.cs b/logic/Server/CopyInfo.cs index 05e22102..25c0dc0e 100755 --- a/logic/Server/CopyInfo.cs +++ b/logic/Server/CopyInfo.cs @@ -48,7 +48,7 @@ public static class CopyInfo { MessageOfObj msg = new() { - ShipMessage = new() + SweeperMessage = new() { X = player.Position.x, Y = player.Position.y, @@ -59,8 +59,8 @@ public static class CopyInfo TeamId = player.TeamID, PlayerId = player.ShipID, Guid = player.ID, - ShipState = Transformation.ShipStateToProto(player.ShipState), - ShipType = Transformation.ShipTypeToProto(player.ShipType), + SweeperState = Transformation.ShipStateToProto(player.ShipState), + SweeperType = Transformation.ShipTypeToProto(player.ShipType), ViewRange = player.ViewRange, ConstructorType = Transformation.ConstructorToProto(player.ConstructorModuleType), ArmorType = Transformation.ArmorToProto(player.ArmorModuleType), @@ -129,7 +129,7 @@ private static MessageOfObj Resource(GameClass.GameObj.Areas.Resource resource) { MessageOfObj msg = new() { - ResourceMessage = new() + GarbageMessage = new() { X = resource.Position.x, Y = resource.Position.y, @@ -142,7 +142,7 @@ private static MessageOfObj Factory(GameClass.GameObj.Areas.Construction constru { MessageOfObj msg = new() { - FactoryMessage = new() + RecyclebankMessage = new() { X = construction.Position.x, Y = construction.Position.y, @@ -157,7 +157,7 @@ private static MessageOfObj Community(GameClass.GameObj.Areas.Construction const { MessageOfObj msg = new() { - CommunityMessage = new() + ChargestationMessage = new() { X = construction.Position.x, Y = construction.Position.y, @@ -172,7 +172,7 @@ private static MessageOfObj Fort(GameClass.GameObj.Areas.Construction constructi { MessageOfObj msg = new() { - FortMessage = new() + SignaltowerMessage = new() { X = construction.Position.x, Y = construction.Position.y, @@ -186,7 +186,7 @@ private static MessageOfObj Wormhole(GameClass.GameObj.Areas.Wormhole wormhole) { MessageOfObj msg = new() { - WormholeMessage = new() + BridgeMessage = new() { X = wormhole.Position.x, Y = wormhole.Position.y, diff --git a/logic/Server/RpcServices.cs b/logic/Server/RpcServices.cs index c5b9fa67..73267b67 100755 --- a/logic/Server/RpcServices.cs +++ b/logic/Server/RpcServices.cs @@ -133,8 +133,8 @@ public override async Task AddPlayer(PlayerMsg request, IServerStreamWriter Date: Tue, 12 Mar 2024 19:47:12 +0800 Subject: [PATCH 14/16] fix: :bug: fix Client issues --- logic/Client/Old/PlayerStatusBar.xaml.cs | 6 +- logic/Client/View/MainPage.xaml.cs | 64 ++++++------ logic/Client/ViewModel/GeneralViewModel.cs | 22 ++--- logic/Client/ViewModel/MapViewModel.cs | 110 ++++++++++----------- 4 files changed, 101 insertions(+), 101 deletions(-) diff --git a/logic/Client/Old/PlayerStatusBar.xaml.cs b/logic/Client/Old/PlayerStatusBar.xaml.cs index aa5ffde2..b9ec0966 100644 --- a/logic/Client/Old/PlayerStatusBar.xaml.cs +++ b/logic/Client/Old/PlayerStatusBar.xaml.cs @@ -111,18 +111,18 @@ public void SetPlayerValue(MessageOfHome player) } } - public void SetShipValue(MessageOfShip ship) + public void SetShipValue(MessageOfSweeper ship) { if (ship.TeamId == (long)PlayerTeam.Red && myRole == PlayerRole.Red || ship.TeamId == (long)PlayerTeam.Blue && myRole == PlayerRole.Blue) { ShipLabel shipLabel = new ShipLabel(); - shipLabel.name.Text = ship.ShipType.ToString() + ship.PlayerId.ToString(); + shipLabel.name.Text = ship.SweeperType.ToString() + ship.PlayerId.ToString(); shipLabel.producer.Text = ship.ProducerType.ToString(); shipLabel.armor.Text = ship.ArmorType.ToString(); shipLabel.shield.Text = ship.ShieldType.ToString(); shipLabel.weapon.Text = ship.WeaponType.ToString(); shipLabel.constructor.Text = ship.ConstructorType.ToString(); - shipLabel.status.Text = ship.ShipState.ToString(); + shipLabel.status.Text = ship.SweeperState.ToString(); } //TODO: Dynamic change the ships } diff --git a/logic/Client/View/MainPage.xaml.cs b/logic/Client/View/MainPage.xaml.cs index 95572da5..855fec5e 100644 --- a/logic/Client/View/MainPage.xaml.cs +++ b/logic/Client/View/MainPage.xaml.cs @@ -272,20 +272,20 @@ private void TestRefresh(object sender, EventArgs e) // listOfBombedBullet.Add(obj.BombedBulletMessage); // break; - // case MessageOfObj.MessageOfObjOneofCase.FactoryMessage: - // listOfFactory.Add(obj.FactoryMessage); + // case MessageOfObj.MessageOfObjOneofCase.RecyclebankMessage: + // listOfFactory.Add(obj.RecyclebankMessage); // break; - // case MessageOfObj.MessageOfObjOneofCase.CommunityMessage: - // listOfCommunity.Add(obj.CommunityMessage); + // case MessageOfObj.MessageOfObjOneofCase.ChargestationMessage: + // listOfCommunity.Add(obj.ChargestationMessage); // break; - // case MessageOfObj.MessageOfObjOneofCase.FortMessage: - // listOfFort.Add(obj.FortMessage); + // case MessageOfObj.MessageOfObjOneofCase.SignaltowerMessage: + // listOfFort.Add(obj.SignaltowerMessage); // break; - // case MessageOfObj.MessageOfObjOneofCase.ResourceMessage: - // listOfResource.Add(obj.ResourceMessage); + // case MessageOfObj.MessageOfObjOneofCase.GarbageMessage: + // listOfResource.Add(obj.GarbageMessage); // break; // case MessageOfObj.MessageOfObjOneofCase.HomeMessage: @@ -315,16 +315,16 @@ private void TestRefresh(object sender, EventArgs e) // listOfShip.Add(obj.ShipMessage); // break; - // case MessageOfObj.MessageOfObjOneofCase.FactoryMessage: - // listOfFactory.Add(obj.FactoryMessage); + // case MessageOfObj.MessageOfObjOneofCase.RecyclebankMessage: + // listOfFactory.Add(obj.RecyclebankMessage); // break; - // case MessageOfObj.MessageOfObjOneofCase.CommunityMessage: - // listOfCommunity.Add(obj.CommunityMessage); + // case MessageOfObj.MessageOfObjOneofCase.ChargestationMessage: + // listOfCommunity.Add(obj.ChargestationMessage); // break; - // case MessageOfObj.MessageOfObjOneofCase.FortMessage: - // listOfFort.Add(obj.FortMessage); + // case MessageOfObj.MessageOfObjOneofCase.SignaltowerMessage: + // listOfFort.Add(obj.SignaltowerMessage); // break; // //case MessageOfObj.MessageOfObjOneofCase.BuildingMessage: @@ -339,8 +339,8 @@ private void TestRefresh(object sender, EventArgs e) // listOfBombedBullet.Add(obj.BombedBulletMessage); // break; - // case MessageOfObj.MessageOfObjOneofCase.ResourceMessage: - // listOfResource.Add(obj.ResourceMessage); + // case MessageOfObj.MessageOfObjOneofCase.GarbageMessage: + // listOfResource.Add(obj.GarbageMessage); // break; // case MessageOfObj.MessageOfObjOneofCase.HomeMessage: @@ -380,16 +380,16 @@ private void TestRefresh(object sender, EventArgs e) // // listOfBuilding.Add(obj.BuildingMessage); // // break; - // case MessageOfObj.MessageOfObjOneofCase.FactoryMessage: - // listOfFactory.Add(obj.FactoryMessage); + // case MessageOfObj.MessageOfObjOneofCase.RecyclebankMessage: + // listOfFactory.Add(obj.RecyclebankMessage); // break; - // case MessageOfObj.MessageOfObjOneofCase.CommunityMessage: - // listOfCommunity.Add(obj.CommunityMessage); + // case MessageOfObj.MessageOfObjOneofCase.ChargestationMessage: + // listOfCommunity.Add(obj.ChargestationMessage); // break; - // case MessageOfObj.MessageOfObjOneofCase.FortMessage: - // listOfFort.Add(obj.FortMessage); + // case MessageOfObj.MessageOfObjOneofCase.SignaltowerMessage: + // listOfFort.Add(obj.SignaltowerMessage); // break; // case MessageOfObj.MessageOfObjOneofCase.BulletMessage: @@ -400,8 +400,8 @@ private void TestRefresh(object sender, EventArgs e) // listOfBombedBullet.Add(obj.BombedBulletMessage); // break; - // case MessageOfObj.MessageOfObjOneofCase.ResourceMessage: - // listOfResource.Add(obj.ResourceMessage); + // case MessageOfObj.MessageOfObjOneofCase.GarbageMessage: + // listOfResource.Add(obj.GarbageMessage); // break; // case MessageOfObj.MessageOfObjOneofCase.HomeMessage: @@ -432,7 +432,7 @@ private void TestRefresh(object sender, EventArgs e) // } //} - //private int FindIndexOfResource(MessageOfResource obj) + //private int FindIndexOfResource(MessageOfGarbage obj) //{ // for (int i = 0; i < listOfResource.Count; i++) // { @@ -444,7 +444,7 @@ private void TestRefresh(object sender, EventArgs e) // return -1; //} - //private int FindIndexOfFactory(MessageOfFactory obj) + //private int FindIndexOfFactory(MessageOfRecycleBank obj) //{ // for (int i = 0; i < listOfFactory.Count; i++) // { @@ -456,7 +456,7 @@ private void TestRefresh(object sender, EventArgs e) // return -1; //} - //private int FindIndexOfCommunity(MessageOfCommunity obj) + //private int FindIndexOfCommunity(MessageOfChargeStation obj) //{ // for (int i = 0; i < listOfCommunity.Count; i++) // { @@ -468,7 +468,7 @@ private void TestRefresh(object sender, EventArgs e) // return -1; //} - //private int FindIndexOfFort(MessageOfFort obj) + //private int FindIndexOfFort(MessageOfSignalTower obj) //{ // for (int i = 0; i < listOfFort.Count; i++) // { @@ -579,7 +579,7 @@ private void Refresh(object sender, EventArgs e) // //MapGrid.Children.Add(iconOfHome); //} - //private void DrawFactory(MessageOfFactory data) + //private void DrawFactory(MessageOfRecycleBank data) //{ // int hp = data.Hp; // //TODO: calculate the percentage of Hp @@ -593,7 +593,7 @@ private void Refresh(object sender, EventArgs e) // //MapGrid.Children.Add(factoryArray[idx]); //} - //private void DrawCommunity(MessageOfCommunity data) + //private void DrawCommunity(MessageOfChargeStation data) //{ // int hp = data.Hp; // //TODO: calculate the percentage of Hp @@ -607,7 +607,7 @@ private void Refresh(object sender, EventArgs e) // //MapGrid.Children.Add(communityArray[idx]); //} - //private void DrawFort(MessageOfFort data) + //private void DrawFort(MessageOfSignalTower data) //{ // int hp = data.Hp; // //TODO: calculate the percentage of Hp @@ -678,7 +678,7 @@ private void Refresh(object sender, EventArgs e) // //MapGrid.Children.Add(iconOfBombedBullet); //} - //private void DrawResource(MessageOfResource data) + //private void DrawResource(MessageOfGarbage data) //{ // int idx = FindIndexOfResource(data); // resourceArray[idx].FontSize = unitFontSize; diff --git a/logic/Client/ViewModel/GeneralViewModel.cs b/logic/Client/ViewModel/GeneralViewModel.cs index f7372f24..8548ee56 100644 --- a/logic/Client/ViewModel/GeneralViewModel.cs +++ b/logic/Client/ViewModel/GeneralViewModel.cs @@ -60,7 +60,7 @@ public List Links } private long playerID; - private ShipType shipType; + private SweeperType shipType; private long teamID; AvailableService.AvailableServiceClient? client; AsyncServerStreamingCall? responseStream; @@ -82,19 +82,19 @@ public void ConnectToServer(string[] comInfo) PlayerMsg playerMsg = new PlayerMsg(); playerMsg.PlayerId = playerID; playerMsg.TeamId = teamID; - playerMsg.X = 0; - playerMsg.Y = 0; + //playerMsg.X = 0; + //playerMsg.Y = 0; if (!isSpectatorMode) { shipType = Convert.ToInt64(comInfo[4]) switch { - 0 => ShipType.NullShipType, - 1 => ShipType.CivilianShip, - 2 => ShipType.MilitaryShip, - 3 => ShipType.FlagShip, - _ => ShipType.NullShipType + 0 => SweeperType.NullSweeperType, + 1 => SweeperType.CivilianSweeper, + 2 => SweeperType.MilitarySweeper, + 3 => SweeperType.FlagSweeper, + _ => SweeperType.NullSweeperType }; - playerMsg.ShipType = shipType; + playerMsg.SweeperType = shipType; } responseStream = client.AddPlayer(playerMsg); isClientStocked = false; @@ -132,7 +132,7 @@ private void UpdateTest(object sender, EventArgs e) TeamId = 1 }); - //DrawFactory(new MessageOfFactory + //DrawFactory(new MessageOfRecycleBank //{ // X = 11, // Y = 11, @@ -140,7 +140,7 @@ private void UpdateTest(object sender, EventArgs e) // TeamId = 2 //}); - DrawWormHole(new MessageOfWormhole + DrawWormHole(new MessageOfBridge { X = 12, Y = 12, diff --git a/logic/Client/ViewModel/MapViewModel.cs b/logic/Client/ViewModel/MapViewModel.cs index 3c3beb50..b264a160 100644 --- a/logic/Client/ViewModel/MapViewModel.cs +++ b/logic/Client/ViewModel/MapViewModel.cs @@ -28,29 +28,29 @@ public partial class GeneralViewModel : BindableObject, IDrawable { private List listOfAll; - private List listOfShip; + private List listOfShip; private List listOfBullet; private List listOfBombedBullet; - private List listOfFactory; - private List listOfCommunity; - private List listOfFort; - private List listOfWormhole; - private List listOfResource; + private List listOfFactory; + private List listOfCommunity; + private List listOfFort; + private List listOfWormhole; + private List listOfResource; private List listOfHome; /* initiate the Lists of Objects and CountList */ private void InitiateObjects() { listOfAll = new List(); - listOfShip = new List(); ; + listOfShip = new List(); ; listOfBullet = new List(); listOfBombedBullet = new List(); - listOfFactory = new List(); - listOfCommunity = new List(); - listOfFort = new List(); - listOfResource = new List(); + listOfFactory = new List(); + listOfCommunity = new List(); + listOfFort = new List(); + listOfResource = new List(); listOfHome = new List(); - listOfWormhole = new List(); + listOfWormhole = new List(); countMap = new Dictionary(); } private (int x, int y)[] resourcePositionIndex; @@ -103,7 +103,7 @@ public void Draw(ICanvas canvas, RectF dirtyRect) BombRange = 5 }, canvas); - DrawShip(new MessageOfShip + DrawShip(new MessageOfSweeper { X = 10, Y = 11, @@ -119,7 +119,7 @@ public void Draw(ICanvas canvas, RectF dirtyRect) BombRange = 5 }, canvas); - DrawShip(new MessageOfShip + DrawShip(new MessageOfSweeper { X = 10, Y = 12, @@ -326,8 +326,8 @@ private async void OnReceive() { switch (obj.MessageOfObjCase) { - case MessageOfObj.MessageOfObjOneofCase.ShipMessage: - listOfShip.Add(obj.ShipMessage); + case MessageOfObj.MessageOfObjOneofCase.SweeperMessage: + listOfShip.Add(obj.SweeperMessage); break; case MessageOfObj.MessageOfObjOneofCase.BulletMessage: @@ -338,20 +338,20 @@ private async void OnReceive() listOfBombedBullet.Add(obj.BombedBulletMessage); break; - case MessageOfObj.MessageOfObjOneofCase.FactoryMessage: - listOfFactory.Add(obj.FactoryMessage); + case MessageOfObj.MessageOfObjOneofCase.RecyclebankMessage: + listOfFactory.Add(obj.RecyclebankMessage); break; - case MessageOfObj.MessageOfObjOneofCase.CommunityMessage: - listOfCommunity.Add(obj.CommunityMessage); + case MessageOfObj.MessageOfObjOneofCase.ChargestationMessage: + listOfCommunity.Add(obj.ChargestationMessage); break; - case MessageOfObj.MessageOfObjOneofCase.FortMessage: - listOfFort.Add(obj.FortMessage); + case MessageOfObj.MessageOfObjOneofCase.SignaltowerMessage: + listOfFort.Add(obj.SignaltowerMessage); break; - case MessageOfObj.MessageOfObjOneofCase.ResourceMessage: - listOfResource.Add(obj.ResourceMessage); + case MessageOfObj.MessageOfObjOneofCase.GarbageMessage: + listOfResource.Add(obj.GarbageMessage); break; case MessageOfObj.MessageOfObjOneofCase.HomeMessage: @@ -376,20 +376,20 @@ private async void OnReceive() { switch (obj.MessageOfObjCase) { - case MessageOfObj.MessageOfObjOneofCase.ShipMessage: - listOfShip.Add(obj.ShipMessage); + case MessageOfObj.MessageOfObjOneofCase.SweeperMessage: + listOfShip.Add(obj.SweeperMessage); break; - case MessageOfObj.MessageOfObjOneofCase.FactoryMessage: - listOfFactory.Add(obj.FactoryMessage); + case MessageOfObj.MessageOfObjOneofCase.RecyclebankMessage: + listOfFactory.Add(obj.RecyclebankMessage); break; - case MessageOfObj.MessageOfObjOneofCase.CommunityMessage: - listOfCommunity.Add(obj.CommunityMessage); + case MessageOfObj.MessageOfObjOneofCase.ChargestationMessage: + listOfCommunity.Add(obj.ChargestationMessage); break; - case MessageOfObj.MessageOfObjOneofCase.FortMessage: - listOfFort.Add(obj.FortMessage); + case MessageOfObj.MessageOfObjOneofCase.SignaltowerMessage: + listOfFort.Add(obj.SignaltowerMessage); break; case MessageOfObj.MessageOfObjOneofCase.BulletMessage: @@ -400,8 +400,8 @@ private async void OnReceive() listOfBombedBullet.Add(obj.BombedBulletMessage); break; - case MessageOfObj.MessageOfObjOneofCase.ResourceMessage: - listOfResource.Add(obj.ResourceMessage); + case MessageOfObj.MessageOfObjOneofCase.GarbageMessage: + listOfResource.Add(obj.GarbageMessage); break; case MessageOfObj.MessageOfObjOneofCase.HomeMessage: @@ -433,24 +433,24 @@ private async void OnReceive() { switch (obj.MessageOfObjCase) { - case MessageOfObj.MessageOfObjOneofCase.ShipMessage: - listOfShip.Add(obj.ShipMessage); + case MessageOfObj.MessageOfObjOneofCase.SweeperMessage: + listOfShip.Add(obj.SweeperMessage); break; //case MessageOfObj.MessageOfObjOneofCase.BuildingMessage: // listOfBuilding.Add(obj.BuildingMessage); // break; - case MessageOfObj.MessageOfObjOneofCase.FactoryMessage: - listOfFactory.Add(obj.FactoryMessage); + case MessageOfObj.MessageOfObjOneofCase.RecyclebankMessage: + listOfFactory.Add(obj.RecyclebankMessage); break; - case MessageOfObj.MessageOfObjOneofCase.CommunityMessage: - listOfCommunity.Add(obj.CommunityMessage); + case MessageOfObj.MessageOfObjOneofCase.ChargestationMessage: + listOfCommunity.Add(obj.ChargestationMessage); break; - case MessageOfObj.MessageOfObjOneofCase.FortMessage: - listOfFort.Add(obj.FortMessage); + case MessageOfObj.MessageOfObjOneofCase.SignaltowerMessage: + listOfFort.Add(obj.SignaltowerMessage); break; case MessageOfObj.MessageOfObjOneofCase.BulletMessage: @@ -461,8 +461,8 @@ private async void OnReceive() listOfBombedBullet.Add(obj.BombedBulletMessage); break; - case MessageOfObj.MessageOfObjOneofCase.ResourceMessage: - listOfResource.Add(obj.ResourceMessage); + case MessageOfObj.MessageOfObjOneofCase.GarbageMessage: + listOfResource.Add(obj.GarbageMessage); break; case MessageOfObj.MessageOfObjOneofCase.HomeMessage: @@ -493,7 +493,7 @@ Show the error message } } - //private int FindIndexOfResource(MessageOfResource obj) + //private int FindIndexOfResource(MessageOfGarbage obj) //{ // for (int i = 0; i < listOfResource.Count; i++) // { @@ -505,7 +505,7 @@ Show the error message // return -1; //} - //private int FindIndexOfFactory(MessageOfFactory obj) + //private int FindIndexOfFactory(MessageOfRecycleBank obj) //{ // for (int i = 0; i < listOfFactory.Count; i++) // { @@ -517,7 +517,7 @@ Show the error message // return -1; //} - //private int FindIndexOfCommunity(MessageOfCommunity obj) + //private int FindIndexOfCommunity(MessageOfChargeStation obj) //{ // for (int i = 0; i < listOfCommunity.Count; i++) // { @@ -529,7 +529,7 @@ Show the error message // return -1; //} - //private int FindIndexOfFort(MessageOfFort obj) + //private int FindIndexOfFort(MessageOfSignalTower obj) //{ // for (int i = 0; i < listOfFort.Count; i++) // { @@ -647,7 +647,7 @@ private void DrawHome(MessageOfHome data) } } - private void DrawFactory(MessageOfFactory data) + private void DrawFactory(MessageOfRecycleBank data) { int x = data.X; int y = data.Y; @@ -674,7 +674,7 @@ private void DrawFactory(MessageOfFactory data) } } - private void DrawCommunity(MessageOfCommunity data) + private void DrawCommunity(MessageOfChargeStation data) { int x = data.X; int y = data.Y; @@ -701,7 +701,7 @@ private void DrawCommunity(MessageOfCommunity data) } } - private void DrawFort(MessageOfFort data) + private void DrawFort(MessageOfSignalTower data) { int x = data.X; int y = data.Y; @@ -728,7 +728,7 @@ private void DrawFort(MessageOfFort data) } } - private void DrawWormHole(MessageOfWormhole data) + private void DrawWormHole(MessageOfBridge data) { int x = data.X; int y = data.Y; @@ -739,7 +739,7 @@ private void DrawWormHole(MessageOfWormhole data) MapPatchesList[index].TextColor = Colors.White; } - private void DrawResource(MessageOfResource data) + private void DrawResource(MessageOfGarbage data) { int x = data.X; int y = data.Y; @@ -779,7 +779,7 @@ private void DrawBullet(MessageOfBullet data, ICanvas canvas) canvas.FillCircle(x, y, 2); } - private void DrawShip(MessageOfShip data, ICanvas canvas) + private void DrawShip(MessageOfSweeper data, ICanvas canvas) { PointF point = UtilFunctions.getMapCenter(data.X, data.Y); float x = point.X; @@ -864,7 +864,7 @@ private void DrawShip(MessageOfShip data, ICanvas canvas) // //MapGrid.Children.Add(iconOfBombedBullet); //} - //private void DrawResource(MessageOfResource data) + //private void DrawResource(MessageOfGarbage data) //{ // int idx = FindIndexOfResource(data); // //resourceArray[idx].FontSize = unitFontSize; From fb1ead073925c3f969feef3833ef82e832f59ae8 Mon Sep 17 00:00:00 2001 From: sigureling <1678348940@qq.com> Date: Tue, 12 Mar 2024 20:05:16 +0800 Subject: [PATCH 15/16] style: :art: fix some wrong name --- CAPI/cpp/API/include/state.h | 7 ++----- CAPI/cpp/API/include/structures.h | 2 +- CAPI/cpp/API/include/utils.hpp | 16 ++++++++-------- CAPI/cpp/API/src/DebugAPI.cpp | 4 ++-- CAPI/cpp/API/src/logic.cpp | 14 +++++++------- CAPI/cpp/API/src/main.cpp | 4 ++-- 6 files changed, 22 insertions(+), 25 deletions(-) diff --git a/CAPI/cpp/API/include/state.h b/CAPI/cpp/API/include/state.h index c31ef82d..20c8b70f 100755 --- a/CAPI/cpp/API/include/state.h +++ b/CAPI/cpp/API/include/state.h @@ -16,15 +16,12 @@ // 存储场上的状态 struct State { - // 自身信息,根据playerType的不同,可以调用的值也不同。 - std::shared_ptr SweeperSelf; + std::shared_ptr sweeperSelf; std::shared_ptr teamSelf; - std::vector> Sweepers; + std::vector> sweepers; std::vector> enemySweepers; std::shared_ptr enemyTeam; - std::vector> bullets; - std::vector> gameMap; std::shared_ptr mapInfo; std::shared_ptr gameInfo; diff --git a/CAPI/cpp/API/include/structures.h b/CAPI/cpp/API/include/structures.h index 5d80742e..ee1982b3 100755 --- a/CAPI/cpp/API/include/structures.h +++ b/CAPI/cpp/API/include/structures.h @@ -285,7 +285,7 @@ namespace THUAI7 {GameState::GameEnd, "GameEnd"}, }; - inline std::map SweeperTypeDict{ + inline std::map sweeperTypeDict{ {SweeperType::NullSweeperType, "NullSweeperType"}, {SweeperType::CivilianSweeper, "CivilianSweeper"}, {SweeperType::MilitarySweeper, "MilitarySweeper"}, diff --git a/CAPI/cpp/API/include/utils.hpp b/CAPI/cpp/API/include/utils.hpp index 7f57bc97..9fae134d 100755 --- a/CAPI/cpp/API/include/utils.hpp +++ b/CAPI/cpp/API/include/utils.hpp @@ -103,14 +103,14 @@ namespace Proto2THUAI7 {protobuf::PlayerType::TEAM, THUAI7::PlayerType::Team}, }; - inline std::map SweeperTypeDict{ + inline std::map sweeperTypeDict{ {protobuf::SweeperType::NULL_SWEEPER_TYPE, THUAI7::SweeperType::NullSweeperType}, {protobuf::SweeperType::CIVILIAN_SWEEPER, THUAI7::SweeperType::CivilianSweeper}, {protobuf::SweeperType::MILITARY_SWEEPER, THUAI7::SweeperType::MilitarySweeper}, {protobuf::SweeperType::FLAG_SWEEPER, THUAI7::SweeperType::FlagSweeper}, }; - inline std::map SweeperStateDict{ + inline std::map sweeperStateDict{ {protobuf::SweeperState::NULL_STATUS, THUAI7::SweeperState::NullStatus}, {protobuf::SweeperState::IDLE, THUAI7::SweeperState::Idle}, {protobuf::SweeperState::PRODUCING, THUAI7::SweeperState::Producing}, @@ -237,8 +237,8 @@ namespace Proto2THUAI7 Sweeper->teamID = SweeperMsg.team_id(); Sweeper->playerID = SweeperMsg.player_id(); Sweeper->guid = SweeperMsg.guid(); - Sweeper->sweeperState = SweeperStateDict[SweeperMsg.sweeper_state()]; - Sweeper->sweeperType = SweeperTypeDict[SweeperMsg.sweeper_type()]; + Sweeper->sweeperState = sweeperStateDict[SweeperMsg.sweeper_state()]; + Sweeper->sweeperType = sweeperTypeDict[SweeperMsg.sweeper_type()]; Sweeper->viewRange = SweeperMsg.view_range(); Sweeper->producerType = producerTypeDict[SweeperMsg.producer_type()]; Sweeper->constructorType = constructorTypeDict[SweeperMsg.constructor_type()]; @@ -332,14 +332,14 @@ namespace THUAI72Proto {THUAI7::PlayerType::Team, protobuf::PlayerType::TEAM}, }; - inline std::map SweeperTypeDict{ + inline std::map sweeperTypeDict{ {THUAI7::SweeperType::NullSweeperType, protobuf::SweeperType::NULL_SWEEPER_TYPE}, {THUAI7::SweeperType::CivilianSweeper, protobuf::SweeperType::CIVILIAN_SWEEPER}, {THUAI7::SweeperType::MilitarySweeper, protobuf::SweeperType::MILITARY_SWEEPER}, {THUAI7::SweeperType::FlagSweeper, protobuf::SweeperType::FLAG_SWEEPER}, }; - inline std::map SweeperStateDict{ + inline std::map sweeperStateDict{ {THUAI7::SweeperState::NullStatus, protobuf::SweeperState::NULL_STATUS}, {THUAI7::SweeperState::Idle, protobuf::SweeperState::IDLE}, {THUAI7::SweeperState::Producing, protobuf::SweeperState::PRODUCING}, @@ -526,7 +526,7 @@ namespace THUAI72Proto buildSweeperMsg.set_team_id(teamID); buildSweeperMsg.set_x(x); buildSweeperMsg.set_y(y); - buildSweeperMsg.set_sweeper_type(THUAI72Proto::SweeperTypeDict[SweeperType]); + buildSweeperMsg.set_sweeper_type(THUAI72Proto::sweeperTypeDict[SweeperType]); return buildSweeperMsg; } @@ -535,7 +535,7 @@ namespace THUAI72Proto protobuf::PlayerMsg playerMsg; playerMsg.set_player_id(playerID); playerMsg.set_team_id(teamID); - playerMsg.set_sweeper_type(THUAI72Proto::SweeperTypeDict[SweeperType]); + playerMsg.set_sweeper_type(THUAI72Proto::sweeperTypeDict[SweeperType]); return playerMsg; } diff --git a/CAPI/cpp/API/src/DebugAPI.cpp b/CAPI/cpp/API/src/DebugAPI.cpp index a6e1337e..64412d33 100755 --- a/CAPI/cpp/API/src/DebugAPI.cpp +++ b/CAPI/cpp/API/src/DebugAPI.cpp @@ -246,7 +246,7 @@ void SweeperDebugAPI::PrintSweeper() const for (const auto& Sweeper : logic.GetSweepers()) { logger->info("******Sweeper Info******"); - logger->info("type={}, playerID={}, GUID={}, x={}, y={}", THUAI7::SweeperTypeDict[Sweeper->sweeperType], Sweeper->playerID, Sweeper->guid, Sweeper->x, Sweeper->y); + logger->info("type={}, playerID={}, GUID={}, x={}, y={}", THUAI7::sweeperTypeDict[Sweeper->sweeperType], Sweeper->playerID, Sweeper->guid, Sweeper->x, Sweeper->y); logger->info("state={},speed={}, view range={},facing direction={}", THUAI7::sweeperStateDict[Sweeper->sweeperState], Sweeper->speed, Sweeper->viewRange, Sweeper->facingDirection); logger->info("************************\n"); } @@ -256,7 +256,7 @@ void SweeperDebugAPI::PrintSelfInfo() const { auto Sweeper = logic.SweeperGetSelfInfo(); logger->info("******Self Info******"); - logger->info("type={}, playerID={}, GUID={}, x={}, y={}", THUAI7::SweeperTypeDict[Sweeper->sweeperType], Sweeper->playerID, Sweeper->guid, Sweeper->x, Sweeper->y); + logger->info("type={}, playerID={}, GUID={}, x={}, y={}", THUAI7::sweeperTypeDict[Sweeper->sweeperType], Sweeper->playerID, Sweeper->guid, Sweeper->x, Sweeper->y); logger->info("state={},speed={}, view range={},facing direction={}", THUAI7::sweeperStateDict[Sweeper->sweeperState], Sweeper->speed, Sweeper->viewRange, Sweeper->facingDirection); logger->info("*********************\n"); } diff --git a/CAPI/cpp/API/src/logic.cpp b/CAPI/cpp/API/src/logic.cpp index 6dba7ad8..85e9f6af 100755 --- a/CAPI/cpp/API/src/logic.cpp +++ b/CAPI/cpp/API/src/logic.cpp @@ -35,7 +35,7 @@ Logic::Logic(int64_t pID, int64_t tID, THUAI7::PlayerType pType, THUAI7::Sweeper std::vector> Logic::GetSweepers() const { std::unique_lock lock(mtxState); - std::vector> temp(currentState->Sweepers.begin(), currentState->Sweepers.end()); + std::vector> temp(currentState->sweepers.begin(), currentState->sweepers.end()); logger->debug("Called GetSweepers"); return temp; } @@ -60,7 +60,7 @@ std::shared_ptr Logic::SweeperGetSelfInfo() const { std::unique_lock lock(mtxState); logger->debug("Called SweeperGetSelfInfo"); - return currentState->SweeperSelf; + return currentState->sweeperSelf; } std::shared_ptr Logic::TeamGetSelfInfo() const @@ -381,14 +381,14 @@ void Logic::LoadBufferSelf(const protobuf::MessageToClient& message) { if (item.sweeper_message().player_id() == playerID) { - bufferState->SweeperSelf = Proto2THUAI7::Protobuf2THUAI7Sweeper(item.sweeper_message()); - bufferState->Sweepers.push_back(bufferState->SweeperSelf); + bufferState->sweeperSelf = Proto2THUAI7::Protobuf2THUAI7Sweeper(item.sweeper_message()); + bufferState->sweepers.push_back(bufferState->sweeperSelf); logger->debug("Add Self Sweeper!"); } else { std::shared_ptr Sweeper = Proto2THUAI7::Protobuf2THUAI7Sweeper(item.sweeper_message()); - bufferState->Sweepers.push_back(Sweeper); + bufferState->sweepers.push_back(Sweeper); logger->debug("Add Sweeper!"); } } @@ -420,7 +420,7 @@ void Logic::LoadBufferCase(const protobuf::MessageOfObj& item) if (playerType == THUAI7::PlayerType::Sweeper) { int32_t x, y, viewRange; - x = bufferState->SweeperSelf->x, y = bufferState->SweeperSelf->y, viewRange = bufferState->SweeperSelf->viewRange; + x = bufferState->sweeperSelf->x, y = bufferState->sweeperSelf->y, viewRange = bufferState->sweeperSelf->viewRange; switch (Proto2THUAI7::messageOfObjDict[item.message_of_obj_case()]) { case THUAI7::MessageOfObj::SweeperMessage: @@ -597,7 +597,7 @@ void Logic::LoadBuffer(const protobuf::MessageToClient& message) std::lock_guard lock(mtxBuffer); // 清空原有信息 - bufferState->Sweepers.clear(); + bufferState->sweepers.clear(); bufferState->enemySweepers.clear(); bufferState->bullets.clear(); bufferState->guids.clear(); diff --git a/CAPI/cpp/API/src/main.cpp b/CAPI/cpp/API/src/main.cpp index 12ecb3f2..4affbc33 100755 --- a/CAPI/cpp/API/src/main.cpp +++ b/CAPI/cpp/API/src/main.cpp @@ -27,8 +27,8 @@ static constexpr std::string_view welcomeString = R"welcome( / _____// |______ _______ / \ / \_____ _______ \_____ \\ __\__ \\_ __ \ \ \/\/ /\__ \\_ __ \ / \| | / __ \| | \/ \ / / __ \| | \/ - /_______ /|__| (____ /__| \__/\ / (____ /__| - \/ \/ \/ \/ + /_______ /|__| (____ /__| \__/\ / (____ /__| + \/ \/ \/ \/ )welcome"sv; int THUAI7Main(int argc, char** argv, CreateAIFunc AIBuilder) From 0e65714dde8f046e02d735d3e7fb3b65b705f456 Mon Sep 17 00:00:00 2001 From: shangfengh <3495281661@qq.com> Date: Tue, 12 Mar 2024 20:46:23 +0800 Subject: [PATCH 16/16] refactor: :art: use the AtomicLongOnlyAddScore --- logic/GameClass/GameObj/Map/Map.cs | 1 - logic/GameClass/GameObj/Map/MapGameTimer.cs | 27 ++---- logic/GameClass/GameObj/MoneyPool.cs | 7 +- logic/Preparation/Interface/IMoneyPool.cs | 2 +- logic/Preparation/Interface/ITimer.cs | 6 +- logic/Preparation/Preparation.csproj | 2 +- logic/Preparation/Utility/SafeValue/Atomic.cs | 88 ++++++------------- logic/Preparation/Utility/{ => Tools}/XY.cs | 0 8 files changed, 46 insertions(+), 87 deletions(-) rename logic/Preparation/Utility/{ => Tools}/XY.cs (100%) mode change 100755 => 100644 diff --git a/logic/GameClass/GameObj/Map/Map.cs b/logic/GameClass/GameObj/Map/Map.cs index cf64fd2c..9460b26f 100755 --- a/logic/GameClass/GameObj/Map/Map.cs +++ b/logic/GameClass/GameObj/Map/Map.cs @@ -187,7 +187,6 @@ public Map(MapStruct mapResource) { for (int j = 0; j < width; ++j) { - bool hasWormhole = false; switch (mapResource.map[i, j]) { case PlaceType.Resource: diff --git a/logic/GameClass/GameObj/Map/MapGameTimer.cs b/logic/GameClass/GameObj/Map/MapGameTimer.cs index b8ed39b7..1adc30f6 100755 --- a/logic/GameClass/GameObj/Map/MapGameTimer.cs +++ b/logic/GameClass/GameObj/Map/MapGameTimer.cs @@ -1,6 +1,7 @@ using System; using System.Threading; using Preparation.Interface; +using Preparation.Utility; using ITimer = Preparation.Interface.ITimer; namespace GameClass.GameObj @@ -16,30 +17,16 @@ public class GameTimer : ITimer private long startTime; public int nowTime() => (int)(Environment.TickCount64 - startTime); - private bool isGaming = false; - public bool IsGaming - { - get => isGaming; - set - { - lock (isGamingLock) - isGaming = value; - } - } - - readonly object isGamingLock = new(); + private AtomicBool isGaming = new(false); + public AtomicBool IsGaming => isGaming; public bool StartGame(int timeInMilliseconds) { - lock (isGamingLock) - { - if (isGaming) - return false; - isGaming = true; - startTime = Environment.TickCount64; - } + if (!IsGaming.TrySet(true)) + return false; + startTime = Environment.TickCount64; Thread.Sleep(timeInMilliseconds); - isGaming = false; + IsGaming.SetReturnOri(false); return true; } } diff --git a/logic/GameClass/GameObj/MoneyPool.cs b/logic/GameClass/GameObj/MoneyPool.cs index 22c1e36c..b1b9e021 100644 --- a/logic/GameClass/GameObj/MoneyPool.cs +++ b/logic/GameClass/GameObj/MoneyPool.cs @@ -5,12 +5,15 @@ namespace GameClass.GameObj; public class MoneyPool : IMoneyPool { - public AtomicLong Money { get; } = new AtomicLong(0); + public AtomicLongOnlyAddScore Money { get; } = new(0); public AtomicLong Score { get; } = new AtomicLong(0); + public MoneyPool() + { + Money.SetScore(Score); + } public long AddMoney(long add) { Money.Add(add); - Score.Add(add); return add; } public void SubMoney(long sub) diff --git a/logic/Preparation/Interface/IMoneyPool.cs b/logic/Preparation/Interface/IMoneyPool.cs index 9422587f..3e9ae255 100644 --- a/logic/Preparation/Interface/IMoneyPool.cs +++ b/logic/Preparation/Interface/IMoneyPool.cs @@ -4,7 +4,7 @@ namespace Preparation.Interface { public interface IMoneyPool { - public AtomicLong Money { get; } + public AtomicLongOnlyAddScore Money { get; } public AtomicLong Score { get; } public long AddMoney(long add); public void SubMoney(long sub); diff --git a/logic/Preparation/Interface/ITimer.cs b/logic/Preparation/Interface/ITimer.cs index af9c5cd2..bbcaee20 100755 --- a/logic/Preparation/Interface/ITimer.cs +++ b/logic/Preparation/Interface/ITimer.cs @@ -1,8 +1,10 @@ -namespace Preparation.Interface +using Preparation.Utility; + +namespace Preparation.Interface { public interface ITimer { - bool IsGaming { get; set; } + AtomicBool IsGaming { get; } public int nowTime(); public bool StartGame(int timeInMilliseconds); } diff --git a/logic/Preparation/Preparation.csproj b/logic/Preparation/Preparation.csproj index 2d7a27f2..2c3ec574 100755 --- a/logic/Preparation/Preparation.csproj +++ b/logic/Preparation/Preparation.csproj @@ -13,7 +13,7 @@ - + diff --git a/logic/Preparation/Utility/SafeValue/Atomic.cs b/logic/Preparation/Utility/SafeValue/Atomic.cs index a952d962..f0b2a680 100755 --- a/logic/Preparation/Utility/SafeValue/Atomic.cs +++ b/logic/Preparation/Utility/SafeValue/Atomic.cs @@ -39,33 +39,25 @@ public AtomicInt(int x) /// /// 参数要求倍率speed(默认1) /// 可(在构造时)使用SetScore以设定AtomicInt类的Score - /// 在发生正向的变化时,自动给Score加上正向变化的差乘以speed。 + /// 在发生正向的变化时,自动给Score加上正向变化的差乘以speed(取整)。 /// 注意:AtomicIntOnlyAddScore本身为AtomicInt,提供的Score可能构成环而死锁。 /// public class AtomicIntOnlyAddScore : AtomicInt { public AtomicInt Score { get; set; } public AtomicDouble speed; - public AtomicDouble remainder = new(0); public AtomicIntOnlyAddScore(int x, double speed = 1.0) : base(x) { this.speed = new(speed); this.Score = new(0); } public void SetScore(AtomicInt score) => Score = score; - private int DealWithRemainder(int v) - { - double q = speed * v + remainder; - int ans = (int)(q); - remainder.SetReturnOri(q - ans); - return ans; - } /// 返回操作前的值 public override int SetReturnOri(int value) { int previousV = Interlocked.Exchange(ref v, value); if (value - previousV > 0) - Score.AddPositive((DealWithRemainder(value - previousV))); + Score.AddPositive(Convert.ToInt32((value - previousV) * speed)); return previousV; } /// 返回操作前的值 @@ -75,7 +67,7 @@ public int SetReturnOriNotAddScore(int value) } public override int Add(int x) { - if (x > 0) Score.AddPositive(DealWithRemainder(x)); + if (x > 0) Score.AddPositive(Convert.ToInt32(x * speed)); return Interlocked.Add(ref v, x); } public int AddNotAddScore(int x) @@ -87,12 +79,12 @@ public int AddNotAddScore(int x) /// public override int AddPositive(int x) { - Score.AddPositive(DealWithRemainder(x)); + Score.AddPositive(Convert.ToInt32(x * speed)); return Interlocked.Add(ref v, x); } public override int Sub(int x) { - if (x < 0) Score.AddPositive(DealWithRemainder(-x)); + if (x < 0) Score.AddPositive(Convert.ToInt32((-x) * speed)); return Interlocked.Add(ref v, -x); } public int SubNotAddScore(int x) @@ -108,7 +100,7 @@ public override int SubPositive(int x) } public override int Inc() { - Score.AddPositive(DealWithRemainder(1)); + Score.AddPositive(Convert.ToInt32(speed)); return Interlocked.Increment(ref v); } public int IncNotAddScore() @@ -120,7 +112,7 @@ public override int CompareExReturnOri(int newV, int compareTo) { int previousV = Interlocked.CompareExchange(ref v, newV, compareTo); if (newV - previousV > 0) - Score.AddPositive(DealWithRemainder(newV - previousV)); + Score.AddPositive(Convert.ToInt32((newV - previousV) * speed)); return previousV; } /// 返回操作前的值 @@ -132,33 +124,25 @@ public int CompareExReturnOriNotAddScore(int newV, int compareTo) /// /// 参数要求倍率speed(默认1) - /// 可(在构造时)使用SetScore以设定AtomicLong类的Score + /// 可(在构造时)使用SetScore以设定AtomicLong类的Score(取整) /// 在发生正向的变化时,自动给Score加上正向变化的差乘以speed。 /// public class AtomicIntOnlyAddLongScore : AtomicInt { public AtomicLong Score { get; set; } public AtomicDouble speed; - public AtomicDouble remainder = new(0); public AtomicIntOnlyAddLongScore(int x, double speed = 1.0) : base(x) { this.Score = new(0); this.speed = new(speed); } public void SetScore(AtomicLong score) => Score = score; - private long DealWithRemainder(int v) - { - double q = speed * v + remainder; - long ans = (long)(q); - remainder.SetReturnOri(q - ans); - return ans; - } /// 返回操作前的值 public override int SetReturnOri(int value) { int previousV = Interlocked.Exchange(ref v, value); if (value - previousV > 0) - Score.AddPositive((DealWithRemainder(value - previousV))); + Score.AddPositive((Convert.ToInt32((value - previousV) * speed))); return previousV; } /// 返回操作前的值 @@ -168,7 +152,7 @@ public int SetReturnOriNotAddScore(int value) } public override int Add(int x) { - if (x > 0) Score.AddPositive(DealWithRemainder(x)); + if (x > 0) Score.AddPositive(Convert.ToInt32(x * speed)); return Interlocked.Add(ref v, x); } public int AddNotAddScore(int x) @@ -180,12 +164,12 @@ public int AddNotAddScore(int x) /// public override int AddPositive(int x) { - Score.AddPositive(DealWithRemainder(x)); + Score.AddPositive(Convert.ToInt32((x) * speed)); return Interlocked.Add(ref v, x); } public override int Sub(int x) { - if (x < 0) Score.AddPositive(DealWithRemainder(-x)); + if (x < 0) Score.AddPositive(Convert.ToInt32((-x) * speed)); return Interlocked.Add(ref v, -x); } public int SubNotAddScore(int x) @@ -194,7 +178,7 @@ public int SubNotAddScore(int x) } public override int Inc() { - Score.AddPositive(DealWithRemainder(1)); + Score.AddPositive(Convert.ToInt32(speed)); return Interlocked.Increment(ref v); } public int IncNotAddScore() @@ -206,7 +190,7 @@ public override int CompareExReturnOri(int newV, int compareTo) { int previousV = Interlocked.CompareExchange(ref v, newV, compareTo); if (newV - previousV > 0) - Score.AddPositive(DealWithRemainder(newV - previousV)); + Score.AddPositive(Convert.ToInt32((newV - previousV) * speed)); return previousV; } /// 返回操作前的值 @@ -226,25 +210,17 @@ public class AtomicIntChangeAffectScore : AtomicInt { public AtomicInt Score { get; set; } public AtomicDouble speed; - public AtomicDouble remainder = new(0); public AtomicIntChangeAffectScore(int x, double speed = 1.0) : base(x) { this.Score = new(0); this.speed = new(speed); } public void SetScore(AtomicInt score) => Score = score; - private int DealWithRemainder(int v) - { - double q = speed * v + remainder; - int ans = (int)(q); - remainder.SetReturnOri(q - ans); - return ans; - } /// 返回操作前的值 public override int SetReturnOri(int value) { int previousV = Interlocked.Exchange(ref v, value); - Score.Add(DealWithRemainder(value - previousV)); + Score.Add(Convert.ToInt32((value - previousV) * speed)); return previousV; } /// 返回操作前的值 @@ -254,7 +230,7 @@ public int SetReturnOriNotAddScore(int value) } public override int Add(int x) { - Score.Add(DealWithRemainder(x)); + Score.Add(Convert.ToInt32((x) * speed)); return Interlocked.Add(ref v, x); } public int AddNotAddScore(int x) @@ -266,12 +242,12 @@ public int AddNotAddScore(int x) /// public override int AddPositive(int x) { - Score.AddPositive(DealWithRemainder(x)); + Score.AddPositive(Convert.ToInt32((x) * speed)); return Interlocked.Add(ref v, x); } public override int Sub(int x) { - Score.Sub(DealWithRemainder(x)); + Score.Sub(Convert.ToInt32((x) * speed)); return Interlocked.Add(ref v, -x); } public int SubNotAddScore(int x) @@ -283,12 +259,12 @@ public int SubNotAddScore(int x) /// public override int SubPositive(int x) { - Score.SubPositive(DealWithRemainder(x)); + Score.SubPositive(Convert.ToInt32((x) * speed)); return Interlocked.Add(ref v, -x); } public override int Inc() { - Score.AddPositive(DealWithRemainder(1)); + Score.AddPositive(Convert.ToInt32(speed)); return Interlocked.Increment(ref v); } public int IncNotAddScore() @@ -297,7 +273,7 @@ public int IncNotAddScore() } public override int Dec() { - Score.SubPositive(DealWithRemainder(1)); + Score.SubPositive(Convert.ToInt32(speed)); return Interlocked.Decrement(ref v); } public int DecNotAddScore() @@ -308,7 +284,7 @@ public int DecNotAddScore() public override int CompareExReturnOri(int newV, int compareTo) { int previousV = Interlocked.CompareExchange(ref v, newV, compareTo); - Score.Add(DealWithRemainder(newV - previousV)); + Score.Add(Convert.ToInt32((newV - previousV) * speed)); return previousV; } /// 返回操作前的值 @@ -356,27 +332,19 @@ public class AtomicLongOnlyAddScore : AtomicLong { public AtomicLong Score { get; set; } public AtomicDouble speed; - public AtomicDouble remainder = new(0); public AtomicLongOnlyAddScore(long x, double speed = 1.0) : base(x) { this.Score = new(0); this.speed = new(speed); } public void SetScore(AtomicLong score) => Score = score; - private long DealWithRemainder(long v) - { - double q = speed * v + remainder; - long ans = (long)(q); - remainder.SetReturnOri(q - ans); - return ans; - } /// 返回操作前的值 public override long SetReturnOri(long value) { long previousV = Interlocked.Exchange(ref v, value); if (value - previousV > 0) - Score.AddPositive(DealWithRemainder(value - previousV)); + Score.AddPositive(Convert.ToInt32((value - previousV) * speed)); return previousV; } /// 返回操作前的值 @@ -386,7 +354,7 @@ public long SetReturnOriNotAddScore(long value) } public override long Add(long x) { - if (x > 0) Score.AddPositive(DealWithRemainder(x)); + if (x > 0) Score.AddPositive(Convert.ToInt32((x) * speed)); return Interlocked.Add(ref v, x); } public long AddNotAddScore(long x) @@ -398,12 +366,12 @@ public long AddNotAddScore(long x) /// public override long AddPositive(long x) { - Score.AddPositive(DealWithRemainder(x)); + Score.AddPositive(Convert.ToInt32((x) * speed)); return Interlocked.Add(ref v, x); } public override long Sub(long x) { - if (x < 0) Score.AddPositive(DealWithRemainder(-x)); + if (x < 0) Score.AddPositive(Convert.ToInt32((-x) * speed)); return Interlocked.Add(ref v, -x); } public long SubNotAddScore(long x) @@ -412,7 +380,7 @@ public long SubNotAddScore(long x) } public override long Inc() { - Score.AddPositive(DealWithRemainder(1)); + Score.AddPositive(Convert.ToInt32(speed)); return Interlocked.Increment(ref v); } public long IncNotAddScore() @@ -424,7 +392,7 @@ public override long CompareExReturnOri(long newV, long compareTo) { long previousV = Interlocked.CompareExchange(ref v, newV, compareTo); if (newV - previousV > 0) - Score.AddPositive(DealWithRemainder(newV - previousV)); + Score.AddPositive(Convert.ToInt32((newV - previousV) * speed)); return previousV; } /// 返回操作前的值 diff --git a/logic/Preparation/Utility/XY.cs b/logic/Preparation/Utility/Tools/XY.cs old mode 100755 new mode 100644 similarity index 100% rename from logic/Preparation/Utility/XY.cs rename to logic/Preparation/Utility/Tools/XY.cs