afritz1 / OpenTESArena

Open-source re-implementation of The Elder Scrolls: Arena.
MIT License
987 stars 68 forks source link

#188 - provide read only BufferViews #217

Closed makemeunsee closed 1 year ago

makemeunsee commented 3 years ago

somewhat extensive changes but mostly straightforward:

of note, this code doesnt seem called ever, maybe I miss something?

afritz1 commented 3 years ago

I need some time to think about this. I'm not immediately satisfied with the not const ...ReadOnly& pattern I'm seeing. It just looks weird, but it's that or a redundant const ...ReadOnly&. I think I would prefer the latter. Removing const from the template parameter seems like an improvement.

I think the changes from copy to move are unnecessary.

The wildBlockIDs are referenced in MapDefinition::initWild().

afritz1 commented 3 years ago

Saw a video recently where the person stored both non-const and const pointer members and used those with non-const and const functions. Haven't looked into it here but might work better?

afritz1 commented 1 year ago

Ended up doing this another way that seems to work fine, and I improved all the buffer view classes in the process.