Yandex Mobile Ads
Loading...
Searching...
No Matches
Location.cs
Go to the documentation of this file.
1/*
2 * This file is a part of the Yandex Advertising Network
3 *
4 * Version for Unity (C) 2023 YANDEX
5 *
6 * You may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at https://legal.yandex.com/partner_ch/
8 */
9
10using System;
11
13{
17 public class Location
18 {
19 public double Latitude { get; private set; }
20
21 public double Longitude { get; private set; }
22
23 public double HorizontalAccuracy { get; private set; }
24
25 private Location(Builder builder)
26 {
27 this.Latitude = builder.Latitude;
28 this.Longitude = builder.Longitude;
29 this.HorizontalAccuracy = builder.HorizontalAccuracy;
30 }
31
32 public class Builder
33 {
34 internal double Latitude { get; private set; }
35
36 internal double Longitude { get; private set; }
37
38 internal double HorizontalAccuracy { get; private set; }
39
40 public Builder SetLatitude(double latitude)
41 {
42 this.Latitude = latitude;
43 return this;
44 }
45
46 public Builder SetLongitude(double longitude)
47 {
48 this.Longitude = longitude;
49 return this;
50 }
51
52 public Builder SetHorizontalAccuracy(double horizontalAccuracy)
53 {
54 this.HorizontalAccuracy = horizontalAccuracy;
55 return this;
56 }
57
58 public Location Build()
59 {
60 return new Location(this);
61 }
62 }
63 }
64}
Builder SetLatitude(double latitude)
Definition Location.cs:40
Builder SetLongitude(double longitude)
Definition Location.cs:46
Builder SetHorizontalAccuracy(double horizontalAccuracy)
Definition Location.cs:52
Current user location.
Definition Location.cs:18