Skip to content

Rename class methods to lowerCamelCase - #2018

Merged
Flow86 merged 7 commits into
masterfrom
refactor/lowerCamelCase-methods
Nov 17, 2026
Merged

Flow86 merged 7 commits into
masterfrom
refactor/lowerCamelCase-methods

Conversation

@Flamefire

@Flamefire Flamefire commented Nov 16, 2026 •

Copy link
Copy Markdown
Member

@Flow86 As discussed in #2016 (comment)
this is the AI generated renaming of member method names.
I scrolled over the diff and looks good, builds and tests pass locally

I also added our guide from the Wiki to the repo directly for easier access by users and agents.

Missing are changes that require submodule updates (base classes in liblobby/s25util like Socket and Serialize/Deserialize, and s25edit using e.g. GetBQ)
Equally trivial to add but wanted to confirm first.

What I noticed/choose:

  • Foo_() -> fooImpl() which seems more common and avoids conflict with foo_ member variables
  • GameMessage::Run -> ..::runGame to avoid conflict with Message::run (bad design to have a base class that isn't actually compatible)
  • LC_Foo, GI_Foo, CI_Foo interface methods (LobbyClient, GameInterface, ClientInterface) as abbreviations
  • Msg_foo -> msgFoo (not keeping the underscored prefix for our key/mouse/... callbacks)
  • GameCommand factory methods like BuildRoad in GameCommandFactory
  • "driver" interface functions like GetDriverAPIVersion look better in UpperCamelCase to me.
  • isSoldier(job) and nofFigure::isSoldier() conflict -> need ::isSoldier
  • ctrlList::swap(int left, int right) is now ambiguous with std::swap but usually called as foo.swap(x,y) anyways
  • IsDefeated() {return isDefeated;} -> Suffix member variable isDefeated_ as already stated. Not sure we should do that consistently (myFoo_.doBar() looks odd for contained classes) but might be worth it.

Keeping member functions UpperCamel would disambiguate them from free functions but could be/look ambiguous to a constructor when called from inside the same class.
So all in all I'd use this PR with lowerCamel names and the submodule stuff on top

@Flamefire
Flamefire force-pushed the refactor/lowerCamelCase-methods branch from cdb7e1d to 5b9ad21 Compare November 16, 2026 13:56
@Flow86
Flow86 merged commit d35e7ad into master Nov 17, 2026
21 checks passed
@Flow86
Flow86 deleted the refactor/lowerCamelCase-methods branch November 17, 2026 11:43
@Flamefire Flamefire changed the title Rename Msg_* handlers to lowerCamelCase Rename class methods to lowerCamelCase Nov 17, 2026
vader1986 pushed a commit to vader1986/s25client that referenced this pull request Nov 17, 2026
Resolve conflicts with the lowerCamelCase refactoring (Return-To-The-Roots#2018, Return-To-The-Roots#2019):
keep the swamp/desert/special-object changes of this branch and use the
renamed upstream API everywhere, including the new files that merged
without textual conflicts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01J1xFd2ZsbRhtWeVV21cLbw
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants