-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathRetriverWifi.cs
63 lines (52 loc) · 1.63 KB
/
RetriverWifi.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
using BSRetriever.Links;
using BSRetriever.RetriversAddress;
namespace BSRetriever.Interfaces
{
public class RetriverWifi : BaseRetriver
{
public RetriverWifi(string data, IAddressRetriver retriverAddress = null, ILinkLocation linkLocation = null) : base(retriverAddress, linkLocation)
{
Data = data;
retriverAddress = retriverAddress ?? new Nominatim();
linkLocation = linkLocation ?? new YandexLink();
}
public string Data { get; protected set; }
#region private
private IWifiRetriverLocation _retriverLocation;
#endregion
public override bool Retrive()
{
var retrived = _retriverLocation.Retrive(Data);
Location = retrived;
if (retrived == (0, 0))
{
HasLocation = false;
return false;
}
HasLocation = true;
return true;
}
#region Fluent
public RetriverWifi setData(string data)
{
Data = data;
return this;
}
public RetriverWifi withLocationRetriver(IWifiRetriverLocation retriverLocation)
{
this._retriverLocation = retriverLocation;
return this;
}
public RetriverWifi withRetriverAddress(IAddressRetriver addressRetriver)
{
this._retriverAddress = addressRetriver;
return this;
}
public RetriverWifi withLink(ILinkLocation linkLocation)
{
this._linkLocation = linkLocation;
return this;
}
#endregion
}
}