Cleaned up realations regarding response classes
All checks were successful
continuous-integration/drone/pr Build is passing
All checks were successful
continuous-integration/drone/pr Build is passing
ref #132
This commit is contained in:
@@ -3,10 +3,10 @@ import {
|
||||
IsObject
|
||||
} from "class-validator";
|
||||
import { Runner } from '../entities/Runner';
|
||||
import { RunnerGroup } from '../entities/RunnerGroup';
|
||||
import { ResponseObjectType } from '../enums/ResponseObjectType';
|
||||
import { IResponse } from './IResponse';
|
||||
import { ResponseParticipant } from './ResponseParticipant';
|
||||
import { ResponseRunnerGroup } from './ResponseRunnerGroup';
|
||||
|
||||
/**
|
||||
* Defines the runner response.
|
||||
@@ -28,7 +28,7 @@ export class ResponseRunner extends ResponseParticipant implements IResponse {
|
||||
* The runner's group.
|
||||
*/
|
||||
@IsObject()
|
||||
group: RunnerGroup;
|
||||
group: ResponseRunnerGroup;
|
||||
|
||||
/**
|
||||
* Creates a ResponseRunner object from a runner.
|
||||
@@ -38,6 +38,6 @@ export class ResponseRunner extends ResponseParticipant implements IResponse {
|
||||
super(runner);
|
||||
if (!runner.scans) { this.distance = 0 }
|
||||
else { this.distance = runner.validScans.reduce((sum, current) => sum + current.distance, 0); }
|
||||
this.group = runner.group;
|
||||
if (runner.group) { this.group = runner.group.toResponse(); }
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user