diff options
Diffstat (limited to 'OpenSim/Framework/Location.cs')
-rw-r--r-- | OpenSim/Framework/Location.cs | 128 |
1 files changed, 64 insertions, 64 deletions
diff --git a/OpenSim/Framework/Location.cs b/OpenSim/Framework/Location.cs index 24430c6..4019a79 100644 --- a/OpenSim/Framework/Location.cs +++ b/OpenSim/Framework/Location.cs | |||
@@ -1,65 +1,65 @@ | |||
1 | using System; | 1 | using System; |
2 | 2 | ||
3 | namespace OpenSim.Framework | 3 | namespace OpenSim.Framework |
4 | { | 4 | { |
5 | [Serializable] | 5 | [Serializable] |
6 | public class Location : ICloneable | 6 | public class Location : ICloneable |
7 | { | 7 | { |
8 | private readonly int m_x; | 8 | private readonly int m_x; |
9 | private readonly int m_y; | 9 | private readonly int m_y; |
10 | 10 | ||
11 | public Location(int x, int y) | 11 | public Location(int x, int y) |
12 | { | 12 | { |
13 | m_x = x; | 13 | m_x = x; |
14 | m_y = y; | 14 | m_y = y; |
15 | } | 15 | } |
16 | 16 | ||
17 | public int X | 17 | public int X |
18 | { | 18 | { |
19 | get { return m_x; } | 19 | get { return m_x; } |
20 | } | 20 | } |
21 | 21 | ||
22 | public int Y | 22 | public int Y |
23 | { | 23 | { |
24 | get { return m_y; } | 24 | get { return m_y; } |
25 | } | 25 | } |
26 | 26 | ||
27 | public override bool Equals(object obj) | 27 | public override bool Equals(object obj) |
28 | { | 28 | { |
29 | if (ReferenceEquals(obj, this)) | 29 | if (ReferenceEquals(obj, this)) |
30 | return true; | 30 | return true; |
31 | 31 | ||
32 | if (obj is Location) | 32 | if (obj is Location) |
33 | { | 33 | { |
34 | return Equals((Location) obj); | 34 | return Equals((Location) obj); |
35 | } | 35 | } |
36 | 36 | ||
37 | return base.Equals(obj); | 37 | return base.Equals(obj); |
38 | } | 38 | } |
39 | 39 | ||
40 | public bool Equals(Location loc) | 40 | public bool Equals(Location loc) |
41 | { | 41 | { |
42 | return loc.X == X && loc.Y == Y; | 42 | return loc.X == X && loc.Y == Y; |
43 | } | 43 | } |
44 | 44 | ||
45 | public bool Equals(int x, int y) | 45 | public bool Equals(int x, int y) |
46 | { | 46 | { |
47 | return X == x && y == Y; | 47 | return X == x && y == Y; |
48 | } | 48 | } |
49 | 49 | ||
50 | public UInt64 RegionHandle | 50 | public UInt64 RegionHandle |
51 | { | 51 | { |
52 | get { return UInt64.MinValue; } | 52 | get { return UInt64.MinValue; } |
53 | } | 53 | } |
54 | 54 | ||
55 | public override int GetHashCode() | 55 | public override int GetHashCode() |
56 | { | 56 | { |
57 | return X.GetHashCode() * 29 + Y.GetHashCode(); | 57 | return X.GetHashCode() * 29 + Y.GetHashCode(); |
58 | } | 58 | } |
59 | 59 | ||
60 | public object Clone() | 60 | public object Clone() |
61 | { | 61 | { |
62 | return new Location(X, Y); | 62 | return new Location(X, Y); |
63 | } | 63 | } |
64 | } | 64 | } |
65 | } \ No newline at end of file | 65 | } \ No newline at end of file |