Example #1
0
 /// <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, ShaderRpcBase serviceImpl)
 {
     serviceBinder.AddMethod(__Method_BuildShader, serviceImpl == null ? null : new grpc::UnaryServerMethod <global::Nbrpc.BuildShaderRequest, global::Nbrpc.BuildShaderReply>(serviceImpl.BuildShader));
     serviceBinder.AddMethod(__Method_UniformBool, serviceImpl == null ? null : new grpc::UnaryServerMethod <global::Nbrpc.UniformBoolRequest, global::Nbrpc.CommonReply>(serviceImpl.UniformBool));
     serviceBinder.AddMethod(__Method_UniformFloat, serviceImpl == null ? null : new grpc::UnaryServerMethod <global::Nbrpc.UniformFloatRequest, global::Nbrpc.CommonReply>(serviceImpl.UniformFloat));
     serviceBinder.AddMethod(__Method_UniformInteger, serviceImpl == null ? null : new grpc::UnaryServerMethod <global::Nbrpc.UniformIntegerRequest, global::Nbrpc.CommonReply>(serviceImpl.UniformInteger));
     serviceBinder.AddMethod(__Method_UniformVec2, serviceImpl == null ? null : new grpc::UnaryServerMethod <global::Nbrpc.UniformVec2Request, global::Nbrpc.CommonReply>(serviceImpl.UniformVec2));
     serviceBinder.AddMethod(__Method_UniformVec3, serviceImpl == null ? null : new grpc::UnaryServerMethod <global::Nbrpc.UniformVec3Request, global::Nbrpc.CommonReply>(serviceImpl.UniformVec3));
     serviceBinder.AddMethod(__Method_UniformVec4, serviceImpl == null ? null : new grpc::UnaryServerMethod <global::Nbrpc.UniformVec4Request, global::Nbrpc.CommonReply>(serviceImpl.UniformVec4));
     serviceBinder.AddMethod(__Method_UniformMat3x3, serviceImpl == null ? null : new grpc::UnaryServerMethod <global::Nbrpc.UniformMat3x3Request, global::Nbrpc.CommonReply>(serviceImpl.UniformMat3x3));
     serviceBinder.AddMethod(__Method_UniformMat4x4, serviceImpl == null ? null : new grpc::UnaryServerMethod <global::Nbrpc.UniformMat4x4Request, global::Nbrpc.CommonReply>(serviceImpl.UniformMat4x4));
     serviceBinder.AddMethod(__Method_LoadModel, serviceImpl == null ? null : new grpc::UnaryServerMethod <global::Nbrpc.LoadModelRequest, global::Nbrpc.CommonReply>(serviceImpl.LoadModel));
 }
Example #2
0
 /// <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(ShaderRpcBase serviceImpl)
 {
     return(grpc::ServerServiceDefinition.CreateBuilder()
            .AddMethod(__Method_BuildShader, serviceImpl.BuildShader)
            .AddMethod(__Method_UniformBool, serviceImpl.UniformBool)
            .AddMethod(__Method_UniformFloat, serviceImpl.UniformFloat)
            .AddMethod(__Method_UniformInteger, serviceImpl.UniformInteger)
            .AddMethod(__Method_UniformVec2, serviceImpl.UniformVec2)
            .AddMethod(__Method_UniformVec3, serviceImpl.UniformVec3)
            .AddMethod(__Method_UniformVec4, serviceImpl.UniformVec4)
            .AddMethod(__Method_UniformMat3x3, serviceImpl.UniformMat3x3)
            .AddMethod(__Method_UniformMat4x4, serviceImpl.UniformMat4x4)
            .AddMethod(__Method_LoadModel, serviceImpl.LoadModel).Build());
 }