You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
203 lines
12 KiB
203 lines
12 KiB
// <auto-generated>
|
|
// Generated by the protocol buffer compiler. DO NOT EDIT!
|
|
// source: game.proto
|
|
// </auto-generated>
|
|
#pragma warning disable 0414, 1591
|
|
#region Designer generated code
|
|
|
|
using grpc = global::Grpc.Core;
|
|
|
|
namespace Game {
|
|
/// <summary>
|
|
/// Service to use when user's in a running game
|
|
/// </summary>
|
|
public static partial class Game
|
|
{
|
|
static readonly string __ServiceName = "game.Game";
|
|
|
|
static void __Helper_SerializeMessage(global::Google.Protobuf.IMessage message, grpc::SerializationContext context)
|
|
{
|
|
#if !GRPC_DISABLE_PROTOBUF_BUFFER_SERIALIZATION
|
|
if (message is global::Google.Protobuf.IBufferMessage)
|
|
{
|
|
context.SetPayloadLength(message.CalculateSize());
|
|
global::Google.Protobuf.MessageExtensions.WriteTo(message, context.GetBufferWriter());
|
|
context.Complete();
|
|
return;
|
|
}
|
|
#endif
|
|
context.Complete(global::Google.Protobuf.MessageExtensions.ToByteArray(message));
|
|
}
|
|
|
|
static class __Helper_MessageCache<T>
|
|
{
|
|
public static readonly bool IsBufferMessage = global::System.Reflection.IntrospectionExtensions.GetTypeInfo(typeof(global::Google.Protobuf.IBufferMessage)).IsAssignableFrom(typeof(T));
|
|
}
|
|
|
|
static T __Helper_DeserializeMessage<T>(grpc::DeserializationContext context, global::Google.Protobuf.MessageParser<T> parser) where T : global::Google.Protobuf.IMessage<T>
|
|
{
|
|
#if !GRPC_DISABLE_PROTOBUF_BUFFER_SERIALIZATION
|
|
if (__Helper_MessageCache<T>.IsBufferMessage)
|
|
{
|
|
return parser.ParseFrom(context.PayloadAsReadOnlySequence());
|
|
}
|
|
#endif
|
|
return parser.ParseFrom(context.PayloadAsNewBuffer());
|
|
}
|
|
|
|
static readonly grpc::Marshaller<global::Game.CardKind> __Marshaller_game_CardKind = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Game.CardKind.Parser));
|
|
static readonly grpc::Marshaller<global::Game.Image> __Marshaller_game_Image = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Game.Image.Parser));
|
|
static readonly grpc::Marshaller<global::Game.CardId> __Marshaller_game_CardId = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Game.CardId.Parser));
|
|
static readonly grpc::Marshaller<global::Google.Protobuf.WellKnownTypes.Empty> __Marshaller_google_protobuf_Empty = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Google.Protobuf.WellKnownTypes.Empty.Parser));
|
|
static readonly grpc::Marshaller<global::Game.MessageStatus> __Marshaller_game_MessageStatus = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Game.MessageStatus.Parser));
|
|
|
|
static readonly grpc::Method<global::Game.CardKind, global::Game.Image> __Method_getCardImage = new grpc::Method<global::Game.CardKind, global::Game.Image>(
|
|
grpc::MethodType.Unary,
|
|
__ServiceName,
|
|
"getCardImage",
|
|
__Marshaller_game_CardKind,
|
|
__Marshaller_game_Image);
|
|
|
|
static readonly grpc::Method<global::Game.CardId, global::Google.Protobuf.WellKnownTypes.Empty> __Method_onClick = new grpc::Method<global::Game.CardId, global::Google.Protobuf.WellKnownTypes.Empty>(
|
|
grpc::MethodType.Unary,
|
|
__ServiceName,
|
|
"onClick",
|
|
__Marshaller_game_CardId,
|
|
__Marshaller_google_protobuf_Empty);
|
|
|
|
static readonly grpc::Method<global::Google.Protobuf.WellKnownTypes.Empty, global::Game.MessageStatus> __Method_status = new grpc::Method<global::Google.Protobuf.WellKnownTypes.Empty, global::Game.MessageStatus>(
|
|
grpc::MethodType.Unary,
|
|
__ServiceName,
|
|
"status",
|
|
__Marshaller_google_protobuf_Empty,
|
|
__Marshaller_game_MessageStatus);
|
|
|
|
/// <summary>Service descriptor</summary>
|
|
public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor
|
|
{
|
|
get { return global::Game.GameReflection.Descriptor.Services[0]; }
|
|
}
|
|
|
|
/// <summary>Base class for server-side implementations of Game</summary>
|
|
[grpc::BindServiceMethod(typeof(Game), "BindService")]
|
|
public abstract partial class GameBase
|
|
{
|
|
public virtual global::System.Threading.Tasks.Task<global::Game.Image> getCardImage(global::Game.CardKind request, grpc::ServerCallContext context)
|
|
{
|
|
throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, ""));
|
|
}
|
|
|
|
public virtual global::System.Threading.Tasks.Task<global::Google.Protobuf.WellKnownTypes.Empty> onClick(global::Game.CardId request, grpc::ServerCallContext context)
|
|
{
|
|
throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, ""));
|
|
}
|
|
|
|
public virtual global::System.Threading.Tasks.Task<global::Game.MessageStatus> status(global::Google.Protobuf.WellKnownTypes.Empty request, grpc::ServerCallContext context)
|
|
{
|
|
throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, ""));
|
|
}
|
|
|
|
}
|
|
|
|
/// <summary>Client for Game</summary>
|
|
public partial class GameClient : grpc::ClientBase<GameClient>
|
|
{
|
|
/// <summary>Creates a new client for Game</summary>
|
|
/// <param name="channel">The channel to use to make remote calls.</param>
|
|
public GameClient(grpc::ChannelBase channel) : base(channel)
|
|
{
|
|
}
|
|
/// <summary>Creates a new client for Game that uses a custom <c>CallInvoker</c>.</summary>
|
|
/// <param name="callInvoker">The callInvoker to use to make remote calls.</param>
|
|
public GameClient(grpc::CallInvoker callInvoker) : base(callInvoker)
|
|
{
|
|
}
|
|
/// <summary>Protected parameterless constructor to allow creation of test doubles.</summary>
|
|
protected GameClient() : base()
|
|
{
|
|
}
|
|
/// <summary>Protected constructor to allow creation of configured clients.</summary>
|
|
/// <param name="configuration">The client configuration.</param>
|
|
protected GameClient(ClientBaseConfiguration configuration) : base(configuration)
|
|
{
|
|
}
|
|
|
|
public virtual global::Game.Image getCardImage(global::Game.CardKind request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
|
|
{
|
|
return getCardImage(request, new grpc::CallOptions(headers, deadline, cancellationToken));
|
|
}
|
|
public virtual global::Game.Image getCardImage(global::Game.CardKind request, grpc::CallOptions options)
|
|
{
|
|
return CallInvoker.BlockingUnaryCall(__Method_getCardImage, null, options, request);
|
|
}
|
|
public virtual grpc::AsyncUnaryCall<global::Game.Image> getCardImageAsync(global::Game.CardKind request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
|
|
{
|
|
return getCardImageAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken));
|
|
}
|
|
public virtual grpc::AsyncUnaryCall<global::Game.Image> getCardImageAsync(global::Game.CardKind request, grpc::CallOptions options)
|
|
{
|
|
return CallInvoker.AsyncUnaryCall(__Method_getCardImage, null, options, request);
|
|
}
|
|
public virtual global::Google.Protobuf.WellKnownTypes.Empty onClick(global::Game.CardId request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
|
|
{
|
|
return onClick(request, new grpc::CallOptions(headers, deadline, cancellationToken));
|
|
}
|
|
public virtual global::Google.Protobuf.WellKnownTypes.Empty onClick(global::Game.CardId request, grpc::CallOptions options)
|
|
{
|
|
return CallInvoker.BlockingUnaryCall(__Method_onClick, null, options, request);
|
|
}
|
|
public virtual grpc::AsyncUnaryCall<global::Google.Protobuf.WellKnownTypes.Empty> onClickAsync(global::Game.CardId request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
|
|
{
|
|
return onClickAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken));
|
|
}
|
|
public virtual grpc::AsyncUnaryCall<global::Google.Protobuf.WellKnownTypes.Empty> onClickAsync(global::Game.CardId request, grpc::CallOptions options)
|
|
{
|
|
return CallInvoker.AsyncUnaryCall(__Method_onClick, null, options, request);
|
|
}
|
|
public virtual global::Game.MessageStatus status(global::Google.Protobuf.WellKnownTypes.Empty request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
|
|
{
|
|
return status(request, new grpc::CallOptions(headers, deadline, cancellationToken));
|
|
}
|
|
public virtual global::Game.MessageStatus status(global::Google.Protobuf.WellKnownTypes.Empty request, grpc::CallOptions options)
|
|
{
|
|
return CallInvoker.BlockingUnaryCall(__Method_status, null, options, request);
|
|
}
|
|
public virtual grpc::AsyncUnaryCall<global::Game.MessageStatus> statusAsync(global::Google.Protobuf.WellKnownTypes.Empty request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
|
|
{
|
|
return statusAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken));
|
|
}
|
|
public virtual grpc::AsyncUnaryCall<global::Game.MessageStatus> statusAsync(global::Google.Protobuf.WellKnownTypes.Empty request, grpc::CallOptions options)
|
|
{
|
|
return CallInvoker.AsyncUnaryCall(__Method_status, null, options, request);
|
|
}
|
|
/// <summary>Creates a new instance of client from given <c>ClientBaseConfiguration</c>.</summary>
|
|
protected override GameClient NewInstance(ClientBaseConfiguration configuration)
|
|
{
|
|
return new GameClient(configuration);
|
|
}
|
|
}
|
|
|
|
/// <summary>Creates service definition that can be registered with a server</summary>
|
|
/// <param name="serviceImpl">An object implementing the server-side handling logic.</param>
|
|
public static grpc::ServerServiceDefinition BindService(GameBase serviceImpl)
|
|
{
|
|
return grpc::ServerServiceDefinition.CreateBuilder()
|
|
.AddMethod(__Method_getCardImage, serviceImpl.getCardImage)
|
|
.AddMethod(__Method_onClick, serviceImpl.onClick)
|
|
.AddMethod(__Method_status, serviceImpl.status).Build();
|
|
}
|
|
|
|
/// <summary>Register service method with a service binder with or without implementation. Useful when customizing the service binding logic.
|
|
/// Note: this method is part of an experimental API that can change or be removed without any prior notice.</summary>
|
|
/// <param name="serviceBinder">Service methods will be bound by calling <c>AddMethod</c> on this object.</param>
|
|
/// <param name="serviceImpl">An object implementing the server-side handling logic.</param>
|
|
public static void BindService(grpc::ServiceBinderBase serviceBinder, GameBase serviceImpl)
|
|
{
|
|
serviceBinder.AddMethod(__Method_getCardImage, serviceImpl == null ? null : new grpc::UnaryServerMethod<global::Game.CardKind, global::Game.Image>(serviceImpl.getCardImage));
|
|
serviceBinder.AddMethod(__Method_onClick, serviceImpl == null ? null : new grpc::UnaryServerMethod<global::Game.CardId, global::Google.Protobuf.WellKnownTypes.Empty>(serviceImpl.onClick));
|
|
serviceBinder.AddMethod(__Method_status, serviceImpl == null ? null : new grpc::UnaryServerMethod<global::Google.Protobuf.WellKnownTypes.Empty, global::Game.MessageStatus>(serviceImpl.status));
|
|
}
|
|
|
|
}
|
|
}
|
|
#endregion
|
|
|