tgstation-server 6.12.0
The /tg/station 13 server suite
Loading...
Searching...
No Matches
ChannelRepresentation.cs
Go to the documentation of this file.
1using System;
2using System.Globalization;
3
4using Newtonsoft.Json;
5
7{
12 public sealed class ChannelRepresentation
13 {
17 public string Id { get; private set; }
18
23 [JsonIgnore]
24 public ulong RealId
25 {
26 get => UInt64.Parse(Id, CultureInfo.InvariantCulture);
27 set => Id = value.ToString(CultureInfo.InvariantCulture);
28 }
29
33 public string FriendlyName { get; }
34
38 public string ConnectionName { get; }
39
43 public bool IsAdminChannel { get; set; }
44
48 public bool IsPrivateChannel { get; init; }
49
53 public string? Tag { get; set; }
54
58 public bool EmbedsSupported { get; init; }
59
66 public ChannelRepresentation(string connectionName, string friendlyName, ulong id)
67 {
68 ConnectionName = connectionName ?? throw new ArgumentNullException(nameof(connectionName));
69 FriendlyName = friendlyName ?? throw new ArgumentNullException(nameof(friendlyName));
70 Id = null!;
71 RealId = id;
72 }
73 }
74}
string ConnectionName
The name of the connection the ChannelRepresentation belongs to.
bool IsAdminChannel
If this is considered a channel for admin commands.
ChannelRepresentation(string connectionName, string friendlyName, ulong id)
Initializes a new instance of the ChannelRepresentation class.
string FriendlyName
The user friendly name of the ChannelRepresentation.
string Id
Backing field for RealId. Represented as a string to avoid BYOND percision loss.