2019-06-30 22:01:19 +00:00
|
|
|
|
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
|
|
|
|
|
{
|
2019-07-04 23:26:53 +00:00
|
|
|
|
public readonly string Url;
|
2019-11-01 02:40:31 +00:00
|
|
|
|
public override string ToString() => Url;
|
2019-06-30 22:01:19 +00:00
|
|
|
|
|
2019-07-04 23:26:53 +00:00
|
|
|
|
public Content(string url)
|
2019-06-30 22:01:19 +00:00
|
|
|
|
{
|
2019-07-04 23:26:53 +00:00
|
|
|
|
Url = url;
|
2019-06-30 22:01:19 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static implicit operator string(Content content)
|
|
|
|
|
{
|
2020-09-14 16:20:34 +00:00
|
|
|
|
return content?.Url;
|
2019-06-30 22:01:19 +00:00
|
|
|
|
}
|
|
|
|
|
|
2019-07-04 23:26:53 +00:00
|
|
|
|
public static implicit operator Content(string url)
|
2019-06-30 22:01:19 +00:00
|
|
|
|
{
|
2019-07-04 23:26:53 +00:00
|
|
|
|
return new Content(url);
|
2019-06-30 22:01:19 +00:00
|
|
|
|
}
|
2020-09-13 01:16:19 +00:00
|
|
|
|
|
|
|
|
|
public override int GetHashCode()
|
|
|
|
|
{
|
|
|
|
|
return Url.GetHashCode();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override bool Equals(object obj)
|
|
|
|
|
{
|
|
|
|
|
if (!(obj is Content))
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
var content = obj as Content;
|
|
|
|
|
return Url.Equals(content.Url);
|
|
|
|
|
}
|
2019-06-30 22:01:19 +00:00
|
|
|
|
}
|
|
|
|
|
}
|