private static UnitOfIncident GetUnitFromUnitList( string unitId, List <JObject> unitJsonObjects, IncidentTaskState taskStateOfUnit) { UnitOfIncident ownUnit = null; var matchingUnitJson = unitJsonObjects.FirstOrDefault(unit => unit.Value <string>(GeobrokerConstants.UnitIdProperty) == unitId); if (matchingUnitJson != null) { ownUnit = new UnitOfIncident( unitId, matchingUnitJson.Value <string>(GeobrokerConstants.UnitNameProperty), CreateGeoPoint(matchingUnitJson[GeobrokerConstants.UnitLastPointProperty]), taskStateOfUnit ); } else { Console.WriteLine($"Unit with ID {unitId} is not present in list of units!"); } return(ownUnit); }
private static UnitOfIncident CreateUnit1(IncidentTaskState expectedState) { return(new UnitOfIncident("unit-id-1", "Own Unit", new GeoPoint(48.5, 16.5), expectedState )); }
public UnitOfIncident( string id, string name, GeoPoint lastPoint = null, IncidentTaskState state = IncidentTaskState.Unknown) { Id = id; Name = name; LastPoint = lastPoint; State = state; }