# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
"""Client and server classes corresponding to protobuf-defined services."""
import grpc

from . import server_pb2 as server__pb2


class GameStub(object):
    """Service provided by the game service to the players (clients).
    """

    def __init__(self, channel):
        """Constructor.

        Args:
            channel: A grpc.Channel.
        """
        self.JoinATeam = channel.unary_stream(
                '/lugo.Game/JoinATeam',
                request_serializer=server__pb2.JoinRequest.SerializeToString,
                response_deserializer=server__pb2.GameSnapshot.FromString,
                )
        self.SendOrders = channel.unary_unary(
                '/lugo.Game/SendOrders',
                request_serializer=server__pb2.OrderSet.SerializeToString,
                response_deserializer=server__pb2.OrderResponse.FromString,
                )


class GameServicer(object):
    """Service provided by the game service to the players (clients).
    """

    def JoinATeam(self, request, context):
        """JoinATeam allows the player to listen the server during the match.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def SendOrders(self, request, context):
        """SendOrders allows the player to send others to the server when the game is on listening state.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_GameServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'JoinATeam': grpc.unary_stream_rpc_method_handler(
                    servicer.JoinATeam,
                    request_deserializer=server__pb2.JoinRequest.FromString,
                    response_serializer=server__pb2.GameSnapshot.SerializeToString,
            ),
            'SendOrders': grpc.unary_unary_rpc_method_handler(
                    servicer.SendOrders,
                    request_deserializer=server__pb2.OrderSet.FromString,
                    response_serializer=server__pb2.OrderResponse.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'lugo.Game', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))


 # This class is part of an EXPERIMENTAL API.
class Game(object):
    """Service provided by the game service to the players (clients).
    """

    @staticmethod
    def JoinATeam(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_stream(request, target, '/lugo.Game/JoinATeam',
            server__pb2.JoinRequest.SerializeToString,
            server__pb2.GameSnapshot.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def SendOrders(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_unary(request, target, '/lugo.Game/SendOrders',
            server__pb2.OrderSet.SerializeToString,
            server__pb2.OrderResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
