|
@@ -199,6 +199,61 @@ func (m *Field) GetFood() *Point {
|
|
return nil
|
|
return nil
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+type Stats struct {
|
|
|
|
+ Generation uint32 `protobuf:"varint,1,opt,name=generation,proto3" json:"generation,omitempty"`
|
|
|
|
+ Individual uint32 `protobuf:"varint,2,opt,name=individual,proto3" json:"individual,omitempty"`
|
|
|
|
+ Move uint32 `protobuf:"varint,3,opt,name=move,proto3" json:"move,omitempty"`
|
|
|
|
+ XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
|
|
|
+ XXX_unrecognized []byte `json:"-"`
|
|
|
|
+ XXX_sizecache int32 `json:"-"`
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+func (m *Stats) Reset() { *m = Stats{} }
|
|
|
|
+func (m *Stats) String() string { return proto.CompactTextString(m) }
|
|
|
|
+func (*Stats) ProtoMessage() {}
|
|
|
|
+func (*Stats) Descriptor() ([]byte, []int) {
|
|
|
|
+ return fileDescriptor_b704e55df18a3970, []int{3}
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+func (m *Stats) XXX_Unmarshal(b []byte) error {
|
|
|
|
+ return xxx_messageInfo_Stats.Unmarshal(m, b)
|
|
|
|
+}
|
|
|
|
+func (m *Stats) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
|
|
+ return xxx_messageInfo_Stats.Marshal(b, m, deterministic)
|
|
|
|
+}
|
|
|
|
+func (m *Stats) XXX_Merge(src proto.Message) {
|
|
|
|
+ xxx_messageInfo_Stats.Merge(m, src)
|
|
|
|
+}
|
|
|
|
+func (m *Stats) XXX_Size() int {
|
|
|
|
+ return xxx_messageInfo_Stats.Size(m)
|
|
|
|
+}
|
|
|
|
+func (m *Stats) XXX_DiscardUnknown() {
|
|
|
|
+ xxx_messageInfo_Stats.DiscardUnknown(m)
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+var xxx_messageInfo_Stats proto.InternalMessageInfo
|
|
|
|
+
|
|
|
|
+func (m *Stats) GetGeneration() uint32 {
|
|
|
|
+ if m != nil {
|
|
|
|
+ return m.Generation
|
|
|
|
+ }
|
|
|
|
+ return 0
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+func (m *Stats) GetIndividual() uint32 {
|
|
|
|
+ if m != nil {
|
|
|
|
+ return m.Individual
|
|
|
|
+ }
|
|
|
|
+ return 0
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+func (m *Stats) GetMove() uint32 {
|
|
|
|
+ if m != nil {
|
|
|
|
+ return m.Move
|
|
|
|
+ }
|
|
|
|
+ return 0
|
|
|
|
+}
|
|
|
|
+
|
|
type None struct {
|
|
type None struct {
|
|
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
|
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
|
XXX_unrecognized []byte `json:"-"`
|
|
XXX_unrecognized []byte `json:"-"`
|
|
@@ -209,7 +264,7 @@ func (m *None) Reset() { *m = None{} }
|
|
func (m *None) String() string { return proto.CompactTextString(m) }
|
|
func (m *None) String() string { return proto.CompactTextString(m) }
|
|
func (*None) ProtoMessage() {}
|
|
func (*None) ProtoMessage() {}
|
|
func (*None) Descriptor() ([]byte, []int) {
|
|
func (*None) Descriptor() ([]byte, []int) {
|
|
- return fileDescriptor_b704e55df18a3970, []int{3}
|
|
|
|
|
|
+ return fileDescriptor_b704e55df18a3970, []int{4}
|
|
}
|
|
}
|
|
|
|
|
|
func (m *None) XXX_Unmarshal(b []byte) error {
|
|
func (m *None) XXX_Unmarshal(b []byte) error {
|
|
@@ -235,31 +290,35 @@ func init() {
|
|
proto.RegisterType((*Point)(nil), "snakesimulator.Point")
|
|
proto.RegisterType((*Point)(nil), "snakesimulator.Point")
|
|
proto.RegisterType((*Snake)(nil), "snakesimulator.Snake")
|
|
proto.RegisterType((*Snake)(nil), "snakesimulator.Snake")
|
|
proto.RegisterType((*Field)(nil), "snakesimulator.Field")
|
|
proto.RegisterType((*Field)(nil), "snakesimulator.Field")
|
|
|
|
+ proto.RegisterType((*Stats)(nil), "snakesimulator.Stats")
|
|
proto.RegisterType((*None)(nil), "snakesimulator.None")
|
|
proto.RegisterType((*None)(nil), "snakesimulator.None")
|
|
}
|
|
}
|
|
|
|
|
|
func init() { proto.RegisterFile("snakesimulator.proto", fileDescriptor_b704e55df18a3970) }
|
|
func init() { proto.RegisterFile("snakesimulator.proto", fileDescriptor_b704e55df18a3970) }
|
|
|
|
|
|
var fileDescriptor_b704e55df18a3970 = []byte{
|
|
var fileDescriptor_b704e55df18a3970 = []byte{
|
|
- // 273 bytes of a gzipped FileDescriptorProto
|
|
|
|
- 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x91, 0xc1, 0x4b, 0xc3, 0x30,
|
|
|
|
- 0x14, 0x87, 0x97, 0xb6, 0xa9, 0xee, 0x4d, 0x47, 0x79, 0x54, 0x29, 0x9e, 0x4a, 0xbc, 0x4c, 0xc1,
|
|
|
|
- 0x21, 0x13, 0xc4, 0x9b, 0x97, 0xe1, 0x49, 0x44, 0x3a, 0x76, 0x77, 0xda, 0xd4, 0x86, 0xcd, 0xa4,
|
|
|
|
- 0xb4, 0x91, 0x6d, 0x77, 0xff, 0x70, 0x79, 0x69, 0x3d, 0x38, 0x11, 0x76, 0xcb, 0xef, 0xf1, 0xbe,
|
|
|
|
- 0x7c, 0xef, 0x25, 0x10, 0x37, 0x7a, 0xb1, 0x94, 0x8d, 0xfa, 0xf8, 0x5c, 0x2d, 0xac, 0xa9, 0xc7,
|
|
|
|
- 0x55, 0x6d, 0xac, 0xc1, 0xe1, 0xef, 0xaa, 0x38, 0x07, 0xfe, 0x6c, 0x94, 0xb6, 0x78, 0x04, 0x6c,
|
|
|
|
- 0x93, 0xb0, 0x94, 0x8d, 0x8e, 0x33, 0xb6, 0xa1, 0xb4, 0x4d, 0xbc, 0x36, 0x6d, 0xc5, 0x2d, 0xf0,
|
|
|
|
- 0x19, 0x61, 0x78, 0x05, 0x61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ress errors if they are not otherwise used.
|
|
// Reference imports to suppress errors if they are not otherwise used.
|
|
@@ -276,6 +335,7 @@ const _ = grpc.SupportPackageIsVersion4
|
|
type SnakeSimulatorClient interface {
|
|
type SnakeSimulatorClient interface {
|
|
Snake(ctx context.Context, in *None, opts ...grpc.CallOption) (SnakeSimulator_SnakeClient, error)
|
|
Snake(ctx context.Context, in *None, opts ...grpc.CallOption) (SnakeSimulator_SnakeClient, error)
|
|
Field(ctx context.Context, in *None, opts ...grpc.CallOption) (SnakeSimulator_FieldClient, error)
|
|
Field(ctx context.Context, in *None, opts ...grpc.CallOption) (SnakeSimulator_FieldClient, error)
|
|
|
|
+ Stats(ctx context.Context, in *None, opts ...grpc.CallOption) (SnakeSimulator_StatsClient, error)
|
|
}
|
|
}
|
|
|
|
|
|
type snakeSimulatorClient struct {
|
|
type snakeSimulatorClient struct {
|
|
@@ -350,10 +410,43 @@ func (x *snakeSimulatorFieldClient) Recv() (*Field, error) {
|
|
return m, nil
|
|
return m, nil
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+func (c *snakeSimulatorClient) Stats(ctx context.Context, in *None, opts ...grpc.CallOption) (SnakeSimulator_StatsClient, error) {
|
|
|
|
+ stream, err := c.cc.NewStream(ctx, &_SnakeSimulator_serviceDesc.Streams[2], "/snakesimulator.SnakeSimulator/stats", opts...)
|
|
|
|
+ if err != nil {
|
|
|
|
+ return nil, err
|
|
|
|
+ }
|
|
|
|
+ x := &snakeSimulatorStatsClient{stream}
|
|
|
|
+ if err := x.ClientStream.SendMsg(in); err != nil {
|
|
|
|
+ return nil, err
|
|
|
|
+ }
|
|
|
|
+ if err := x.ClientStream.CloseSend(); err != nil {
|
|
|
|
+ return nil, err
|
|
|
|
+ }
|
|
|
|
+ return x, nil
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+type SnakeSimulator_StatsClient interface {
|
|
|
|
+ Recv() (*Stats, error)
|
|
|
|
+ grpc.ClientStream
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+type snakeSimulatorStatsClient struct {
|
|
|
|
+ grpc.ClientStream
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+func (x *snakeSimulatorStatsClient) Recv() (*Stats, error) {
|
|
|
|
+ m := new(Stats)
|
|
|
|
+ if err := x.ClientStream.RecvMsg(m); err != nil {
|
|
|
|
+ return nil, err
|
|
|
|
+ }
|
|
|
|
+ return m, nil
|
|
|
|
+}
|
|
|
|
+
|
|
// SnakeSimulatorServer is the server API for SnakeSimulator service.
|
|
// SnakeSimulatorServer is the server API for SnakeSimulator service.
|
|
type SnakeSimulatorServer interface {
|
|
type SnakeSimulatorServer interface {
|
|
Snake(*None, SnakeSimulator_SnakeServer) error
|
|
Snake(*None, SnakeSimulator_SnakeServer) error
|
|
Field(*None, SnakeSimulator_FieldServer) error
|
|
Field(*None, SnakeSimulator_FieldServer) error
|
|
|
|
+ Stats(*None, SnakeSimulator_StatsServer) error
|
|
}
|
|
}
|
|
|
|
|
|
// UnimplementedSnakeSimulatorServer can be embedded to have forward compatible implementations.
|
|
// UnimplementedSnakeSimulatorServer can be embedded to have forward compatible implementations.
|
|
@@ -366,6 +459,9 @@ func (*UnimplementedSnakeSimulatorServer) Snake(req *None, srv SnakeSimulator_Sn
|
|
func (*UnimplementedSnakeSimulatorServer) Field(req *None, srv SnakeSimulator_FieldServer) error {
|
|
func (*UnimplementedSnakeSimulatorServer) Field(req *None, srv SnakeSimulator_FieldServer) error {
|
|
return status.Errorf(codes.Unimplemented, "method Field not implemented")
|
|
return status.Errorf(codes.Unimplemented, "method Field not implemented")
|
|
}
|
|
}
|
|
|
|
+func (*UnimplementedSnakeSimulatorServer) Stats(req *None, srv SnakeSimulator_StatsServer) error {
|
|
|
|
+ return status.Errorf(codes.Unimplemented, "method Stats not implemented")
|
|
|
|
+}
|
|
|
|
|
|
func RegisterSnakeSimulatorServer(s *grpc.Server, srv SnakeSimulatorServer) {
|
|
func RegisterSnakeSimulatorServer(s *grpc.Server, srv SnakeSimulatorServer) {
|
|
s.RegisterService(&_SnakeSimulator_serviceDesc, srv)
|
|
s.RegisterService(&_SnakeSimulator_serviceDesc, srv)
|
|
@@ -413,6 +509,27 @@ func (x *snakeSimulatorFieldServer) Send(m *Field) error {
|
|
return x.ServerStream.SendMsg(m)
|
|
return x.ServerStream.SendMsg(m)
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+func _SnakeSimulator_Stats_Handler(srv interface{}, stream grpc.ServerStream) error {
|
|
|
|
+ m := new(None)
|
|
|
|
+ if err := stream.RecvMsg(m); err != nil {
|
|
|
|
+ return err
|
|
|
|
+ }
|
|
|
|
+ return srv.(SnakeSimulatorServer).Stats(m, &snakeSimulatorStatsServer{stream})
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+type SnakeSimulator_StatsServer interface {
|
|
|
|
+ Send(*Stats) error
|
|
|
|
+ grpc.ServerStream
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+type snakeSimulatorStatsServer struct {
|
|
|
|
+ grpc.ServerStream
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+func (x *snakeSimulatorStatsServer) Send(m *Stats) error {
|
|
|
|
+ return x.ServerStream.SendMsg(m)
|
|
|
|
+}
|
|
|
|
+
|
|
var _SnakeSimulator_serviceDesc = grpc.ServiceDesc{
|
|
var _SnakeSimulator_serviceDesc = grpc.ServiceDesc{
|
|
ServiceName: "snakesimulator.SnakeSimulator",
|
|
ServiceName: "snakesimulator.SnakeSimulator",
|
|
HandlerType: (*SnakeSimulatorServer)(nil),
|
|
HandlerType: (*SnakeSimulatorServer)(nil),
|
|
@@ -428,6 +545,11 @@ var _SnakeSimulator_serviceDesc = grpc.ServiceDesc{
|
|
Handler: _SnakeSimulator_Field_Handler,
|
|
Handler: _SnakeSimulator_Field_Handler,
|
|
ServerStreams: true,
|
|
ServerStreams: true,
|
|
},
|
|
},
|
|
|
|
+ {
|
|
|
|
+ StreamName: "stats",
|
|
|
|
+ Handler: _SnakeSimulator_Stats_Handler,
|
|
|
|
+ ServerStreams: true,
|
|
|
|
+ },
|
|
},
|
|
},
|
|
Metadata: "snakesimulator.proto",
|
|
Metadata: "snakesimulator.proto",
|
|
}
|
|
}
|