/// <inheritdoc /> public BlockNetworkCommand62EventClientPayload([NotNull] BaseSubCommand62 command) { if (command == null) { throw new ArgumentNullException(nameof(command)); } Command = command; }
/// <summary> /// Creates a new <see cref="BlockNetworkCommand62EventClientPayload"/> with the provided <see cref="command"/> 0x60 /// command. /// </summary> /// <param name="command">The command to initialize the payload with.</param> /// <returns>A new <see cref="BlockNetworkCommand62EventClientPayload"/> with the <see cref="command"/></returns> public static BlockNetworkCommand62EventClientPayload ToPayload([NotNull] this BaseSubCommand62 command) { if (command == null) { throw new ArgumentNullException(nameof(command)); } //Just create a new command container (the 0x60 payload) around the command. return(new BlockNetworkCommand62EventClientPayload(command)); }
//TODO: We can probably cache this string for performance in the future /// <summary> /// Computes the hex string opcode for the provided <see cref="BaseSubCommand62"/>. /// </summary> /// <param name="command"></param> /// <returns></returns> public static string OpCodeHexString(this BaseSubCommand62 command) { return($"0x62 {command.CommandOperationCode:X}"); }