forked from MaximumADHD/Roblox-File-Format
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathContent.cs
40 lines (34 loc) · 928 Bytes
/
Content.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
namespace RobloxFiles.DataTypes
{
/// <summary>
/// Content is a type used by most url-based XML properties.
/// Here, it only exists as a wrapper class for strings.
/// </summary>
public class Content
{
public readonly string Url;
public override string ToString() => Url;
public Content(string url)
{
Url = url;
}
public static implicit operator string(Content content)
{
return content?.Url;
}
public static implicit operator Content(string url)
{
return new Content(url);
}
public override int GetHashCode()
{
return Url.GetHashCode();
}
public override bool Equals(object obj)
{
if (!(obj is Content content))
return false;
return Url.Equals(content.Url);
}
}
}