Skip to content

Commit

Permalink
Merge pull request #21 from eulynx-live/Cleanup
Browse files Browse the repository at this point in the history
Removes PointMachineState
  • Loading branch information
rs22 authored Dec 16, 2023
2 parents 79da25a + 7b83446 commit bb341f3
Show file tree
Hide file tree
Showing 6 changed files with 0 additions and 526 deletions.
15 changes: 0 additions & 15 deletions src/Point/Components/PointMachine/PointMachineState.cs

This file was deleted.

20 changes: 0 additions & 20 deletions src/Point/Services/PointService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,25 +59,5 @@ public override Task<PointPositionMessage> GetPointPosition(Empty request, Serve
return Task.FromResult(response);
}

public override Task<Empty> EstablishPointMachineState(PointMachineStateMessage request, ServerCallContext context)
{
// Perform validation
if (request.Crucial == PointMachineStateMessage.Types.Crucial.Crucial && !_point.AllPointMachinesCrucial) {
throw new InvalidOperationException("Point has only crucial point machines");
}

_point.PointState.PointPosition = request.PointPosition.ConvertToReportedPointPosition();

return Task.FromResult(new Empty());
}

public override Task<PointMachineStateMessage> GetPointMachineState(Empty request, ServerCallContext context)
{
return Task.FromResult(new PointMachineStateMessage()
{
Crucial = _point.AllPointMachinesCrucial ? PointMachineStateMessage.Types.Crucial.Crucial : PointMachineStateMessage.Types.Crucial.NonCrucial,
PointPosition = _point.PointState.PointPosition.ConvertToProtoMessage(),
});
}
}
}
86 changes: 0 additions & 86 deletions src/Point/rasta-point-web/src/proto/PointServiceClientPb.ts
Original file line number Diff line number Diff line change
Expand Up @@ -384,91 +384,5 @@ export class PointClient {
this.methodDescriptorReset);
}

methodDescriptorEstablishPointMachineState = new grpcWeb.MethodDescriptor(
'/point.Point/EstablishPointMachineState',
grpcWeb.MethodType.UNARY,
point_pb.PointMachineStateMessage,
google_protobuf_empty_pb.Empty,
(request: point_pb.PointMachineStateMessage) => {
return request.serializeBinary();
},
google_protobuf_empty_pb.Empty.deserializeBinary
);

establishPointMachineState(
request: point_pb.PointMachineStateMessage,
metadata: grpcWeb.Metadata | null): Promise<google_protobuf_empty_pb.Empty>;

establishPointMachineState(
request: point_pb.PointMachineStateMessage,
metadata: grpcWeb.Metadata | null,
callback: (err: grpcWeb.RpcError,
response: google_protobuf_empty_pb.Empty) => void): grpcWeb.ClientReadableStream<google_protobuf_empty_pb.Empty>;

establishPointMachineState(
request: point_pb.PointMachineStateMessage,
metadata: grpcWeb.Metadata | null,
callback?: (err: grpcWeb.RpcError,
response: google_protobuf_empty_pb.Empty) => void) {
if (callback !== undefined) {
return this.client_.rpcCall(
this.hostname_ +
'/point.Point/EstablishPointMachineState',
request,
metadata || {},
this.methodDescriptorEstablishPointMachineState,
callback);
}
return this.client_.unaryCall(
this.hostname_ +
'/point.Point/EstablishPointMachineState',
request,
metadata || {},
this.methodDescriptorEstablishPointMachineState);
}

methodDescriptorGetPointMachineState = new grpcWeb.MethodDescriptor(
'/point.Point/GetPointMachineState',
grpcWeb.MethodType.UNARY,
google_protobuf_empty_pb.Empty,
point_pb.PointMachineStateMessage,
(request: google_protobuf_empty_pb.Empty) => {
return request.serializeBinary();
},
point_pb.PointMachineStateMessage.deserializeBinary
);

getPointMachineState(
request: google_protobuf_empty_pb.Empty,
metadata: grpcWeb.Metadata | null): Promise<point_pb.PointMachineStateMessage>;

getPointMachineState(
request: google_protobuf_empty_pb.Empty,
metadata: grpcWeb.Metadata | null,
callback: (err: grpcWeb.RpcError,
response: point_pb.PointMachineStateMessage) => void): grpcWeb.ClientReadableStream<point_pb.PointMachineStateMessage>;

getPointMachineState(
request: google_protobuf_empty_pb.Empty,
metadata: grpcWeb.Metadata | null,
callback?: (err: grpcWeb.RpcError,
response: point_pb.PointMachineStateMessage) => void) {
if (callback !== undefined) {
return this.client_.rpcCall(
this.hostname_ +
'/point.Point/GetPointMachineState',
request,
metadata || {},
this.methodDescriptorGetPointMachineState,
callback);
}
return this.client_.unaryCall(
this.hostname_ +
'/point.Point/GetPointMachineState',
request,
metadata || {},
this.methodDescriptorGetPointMachineState);
}

}

58 changes: 0 additions & 58 deletions src/Point/rasta-point-web/src/proto/point_pb.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,64 +103,6 @@ export namespace PointDegradedPositionMessage {
}
}

export class PointMachineStateMessage extends jspb.Message {
getPointposition(): PointPosition;
setPointposition(value: PointPosition): PointMachineStateMessage;

getTarget(): PointMachineStateMessage.Target;
setTarget(value: PointMachineStateMessage.Target): PointMachineStateMessage;

getAbilitytomove(): PointMachineStateMessage.AbilityToMove;
setAbilitytomove(value: PointMachineStateMessage.AbilityToMove): PointMachineStateMessage;

getLastpointposition(): PointMachineStateMessage.LastPointPosition;
setLastpointposition(value: PointMachineStateMessage.LastPointPosition): PointMachineStateMessage;

getCrucial(): PointMachineStateMessage.Crucial;
setCrucial(value: PointMachineStateMessage.Crucial): PointMachineStateMessage;

serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): PointMachineStateMessage.AsObject;
static toObject(includeInstance: boolean, msg: PointMachineStateMessage): PointMachineStateMessage.AsObject;
static serializeBinaryToWriter(message: PointMachineStateMessage, writer: jspb.BinaryWriter): void;
static deserializeBinary(bytes: Uint8Array): PointMachineStateMessage;
static deserializeBinaryFromReader(message: PointMachineStateMessage, reader: jspb.BinaryReader): PointMachineStateMessage;
}

export namespace PointMachineStateMessage {
export type AsObject = {
pointposition: PointPosition,
target: PointMachineStateMessage.Target,
abilitytomove: PointMachineStateMessage.AbilityToMove,
lastpointposition: PointMachineStateMessage.LastPointPosition,
crucial: PointMachineStateMessage.Crucial,
}

export enum Target {
TARGET_UNDEFINED = 0,
TARGET_LEFT = 1,
TARGET_RIGHT = 2,
TARGET_NONE = 3,
}

export enum AbilityToMove {
ABILITYTOMOVE_UNDEFINED = 0,
ABILITYTOMOVE_ABLE = 1,
ABILITYTOMOVE_UNABLE = 2,
}

export enum LastPointPosition {
LASTPOINTPOSITION_UNDEFINED = 0,
LASTPOINTPOSITION_NONE = 1,
}

export enum Crucial {
CRUCIAL_UNDEFINED = 0,
CRUCIAL_CRUCIAL = 1,
CRUCIAL_NONCRUCIAL = 2,
}
}

export enum PointPosition {
RIGHT = 0,
LEFT = 1,
Expand Down
Loading

0 comments on commit bb341f3

Please sign in to comment.