1
|
//
|
2
|
// Author: A. Konig
|
3
|
//
|
4
|
|
5
|
using ServerApp.Parser.OutputInfo;
|
6
|
using System;
|
7
|
using System.Collections.Generic;
|
8
|
|
9
|
namespace ServerApp.WeatherPredictionParser
|
10
|
{
|
11
|
/// <summary>
|
12
|
/// Abstract class that every Json parser should inherit from
|
13
|
/// </summary>
|
14
|
abstract class IJsonParser
|
15
|
{
|
16
|
|
17
|
/// <summary> Current weather </summary>
|
18
|
WeatherInfo current;
|
19
|
public WeatherInfo Current { get => current; set => current = value; }
|
20
|
|
21
|
/// <summary> Prediction for today, tommorrow and day after tommorrow </summary>
|
22
|
List<WeatherInfo> predictions;
|
23
|
public List<WeatherInfo> Predictions { get => predictions; set => predictions = value; }
|
24
|
|
25
|
/// <summary>
|
26
|
/// Parse weather prediction
|
27
|
/// Results is in attributes current for current weather and pred for weather prediction for today, tommorrow and day after tommorrow
|
28
|
/// </summary>
|
29
|
abstract public void ParsePrediction();
|
30
|
|
31
|
/// <summary>
|
32
|
/// Get predictions from Predictions that are within specified time span
|
33
|
/// </summary>
|
34
|
/// <param name="from">DateTime from</param>
|
35
|
/// <param name="to">DateTime to</param>
|
36
|
/// <returns>List of predictions that fit specified criteria</returns>
|
37
|
abstract public List<WeatherInfo> GetPredictionForTime(DateTime from, DateTime to);
|
38
|
|
39
|
}
|
40
|
|
41
|
}
|