beyond-all-reason / beyond-all-reason/RecoilEngine

Consider consistent C++ type for unitID (and other IDs)

Open
#1,233 1 comment 0 reactions 0 assignees View on GitHub
refactor
Dominant language
C++
Stars
679
Forks
290
Avg merge
3d 2h
Merged PRs (30d)
40

Description

Sometimes unitID is `uint32_t`
https://github.com/beyond-all-reason/RecoilEngine/blob/33720aaa8b8b8c0b45edbf335bb049b18e953cf1/rts/Sim/Misc/SimObjectIDPool.h#L41

Sometimes it is `int16_t`
https://github.com/beyond-all-reason/RecoilEngine/blob/33720aaa8b8b8c0b45edbf335bb049b18e953cf1/rts/Net/Protocol/BaseNetProtocol.cpp#L98

Sometimes it is plain `int`
https://github.com/beyond-all-reason/RecoilEngine/blob/33720aaa8b8b8c0b45edbf335bb049b18e953cf1/rts/Lua/LuaUnsyncedRead.cpp#L2335

Consider some sort of `using unitID_t = XYZ` and making it consistent where possible.
Keep the wider ID issues in mind though https://github.com/beyond-all-reason/RecoilEngine/issues/717#issuecomment-1757643149

Contributor guide

Open the contributing guide

Research direction

Compare the unitID uses in rts/Sim/Misc/SimObjectIDPool.h, rts/Net/Protocol/BaseNetProtocol.cpp, and rts/Lua/LuaUnsyncedRead.cpp. Review the wider ID concerns in issue 717 and its referenced comment before choosing a shared type. Done means the applicable unitID uses are consistent without overlooking the wider ID design.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
game-dev
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.