addshore
08/21/2025, 11:06 AMsound-type field is actually an enum
Whats the best way to document that fact?
And or is there already IDE integreation and hinting for such as thing?
/**
Creates a protocol.Data object with all available fields for this message type.
This is a comprehensive helper that accepts all possible fields.
For method-specific usage, consider using the dedicated request/response methods.
Returns: A protocol.Data object with the specified field values
*/
static data --duration/int?=null --sound-type/int?=null --intensity/int?=null --run-count/int?=null --frequency/float?=null --base-data/protocol.Data?=protocol.Data -> protocol.Data:
data := base-data
if duration != null: data.add-data-uint DURATION duration
if sound-type != null: data.add-data-uint SOUND-TYPE sound-type
if intensity != null: data.add-data-uint INTENSITY intensity
if run-count != null: data.add-data-uint RUN-COUNT run-count
if frequency != null: data.add-data-float FREQUENCY frequency
return datafloitsch
08/21/2025, 3:11 PMfloitsch
08/21/2025, 3:12 PMReturns: should be Returns ... (without any ":"), and it doesn't finish with a dot.
The protocol.Data should probably just be an object since the actual type is given in the return type, or, if you keep the type it should be $protocol.Data.
Same for the Creates ....addshore
08/21/2025, 3:17 PM