blob: 6bc07552469a3f1a1c51a2f61d5e691b9cbe1493 (
plain)
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
64
65
66
67
68
69
70
71
72
|
using System;
using libsecondlife;
namespace OpenSim.Framework
{
[Serializable]
public class Location : ICloneable
{
private readonly int m_x;
private readonly int m_y;
public Location(int x, int y)
{
m_x = x;
m_y = y;
}
public Location(ulong regionHandle)
{
m_x = (int) regionHandle;
m_y = (int) (regionHandle >> 32);
}
public ulong RegionHandle
{
get { return Helpers.UIntsToLong((uint) m_x, (uint) m_y); }
}
public int X
{
get { return m_x; }
}
public int Y
{
get { return m_y; }
}
public override bool Equals(object obj)
{
if (ReferenceEquals(obj, this))
return true;
if (obj is Location)
{
return Equals((Location) obj);
}
return base.Equals(obj);
}
public bool Equals(Location loc)
{
return loc.X == X && loc.Y == Y;
}
public bool Equals(int x, int y)
{
return X == x && y == Y;
}
public override int GetHashCode()
{
return X.GetHashCode() * 29 + Y.GetHashCode();
}
public object Clone()
{
return new Location(X, Y);
}
}
}
|