namespace axXez.TS3.Protocol
{
/// Represents a channel group returned by channelgrouplist.
public class ChannelGroupInfo : TsEntity, IGroupInfo
{
/// Channel group ID.
[TsField("cgid")]
public int ID { get; protected set; }
/// Display name of the channel group.
[TsField("name")]
public string Name { get; protected set; }
/// Type of this channel group.
[TsField("type")]
public GroupType Type { get; protected set; }
/// Icon ID displayed next to the group name; negative values are signed representations of unsigned icon IDs.
[TsField("iconid")]
public int IconID { get; protected set; }
/// Whether group membership is stored in the database.
[TsField("savedb")]
public bool SaveDB { get; protected set; }
/// Sort position used when displaying the group in the client; lower values appear first.
[TsField("sortid")]
public int SortID { get; protected set; }
/// How the group name is displayed relative to a client's nickname.
[TsField("namemode")]
public GroupNameMode NameMode { get; protected set; }
/// Minimum modify power required to edit this group.
[TsField("n_modifyp")]
public int NeededPowerToModify { get; protected set; }
/// Minimum member add power required to assign clients to this group.
[TsField("n_member_addp")]
public int NeededPowerToAddClient { get; protected set; }
/// Minimum member remove power required to remove clients from this group.
[TsField("n_member_removep")]
public int NeededPowerToRemoveClient { get; protected set; }
internal ChannelGroupInfo(TsDataEntry data) : base(data) { }
///
public override string ToString() => $"ChannelGroup[{ID}] {Name}";
///
public override int GetHashCode() => ID.GetHashCode();
///
public override bool Equals(object obj) => obj is ChannelGroupInfo && ID.Equals((obj as ChannelGroupInfo).ID);
}
}