I have a structure named WaveSize to represent both an amount of samples or an amount of time, but I’m also using this structure to represent a position or an offset within a wave.
While it’s pretty common to represent both sizes and positions within a coordinate system with a Vector2d type, I’m unable to find a good name abstract enough to represent wave lengths and wave positions/offsets.
I find odd to see something like:
public WaveSize Size { get; }
public WaveSize Offset { get; }
I’d rather come up with a good name than creating empty classes or using ‘using’.
Any suggestions will be much appreciated. Thanks in advance.
EDIT: As Reed Copsey & Marc Gravel suggested it makes a lot of sense to have two different classes since they are two different concepts, so, any similarities in code should be seen as mere coincidences.
I would have two separate structs, and make conversions easy between them.
You’re trying to represent two concepts here, one for position, and one for size. Since these are two conceptually distinct ideas, I’d make them two structs.
I also agree with Marc Gravell’s answer regarding the BCL’s Point/Size structs. I think they’re a good model to follow.