Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make several more members private in game #42255

Merged
merged 5 commits into from
Jul 20, 2020

Conversation

kevingranade
Copy link
Member

@kevingranade kevingranade commented Jul 18, 2020

Summary

SUMMARY: None

Purpose of change

See #41347 for initial implementation.
The goal is to remove unnecessary game.h inclusions.

Describe the solution

This is the thirty-fourth in a series of PRs to transition to using the getters instead of calling directly through the game instance, doing bulk editing instead of targeted edits.
This removes the last references to a number of game members and makes them private to prevent regressions.
scent_map, timed_events, achievements, memorial_tracker, and the scenario variable.

Testing

This is strictly a refactor, so unless I make a horrific entry mistake if it builds it should work.

@ZhilkinSerg ZhilkinSerg added [C++] Changes (can be) made in C++. Previously named `Code` Code: Build Issues regarding different builds and build environments Code: Infrastructure / Style / Static Analysis Code internal infrastructure and style labels Jul 18, 2020
@kevingranade kevingranade changed the title Make scent_map private in game Make several more members private in game Jul 18, 2020
stats_tracker &get_stats()
{
return g->stats();
}

timed_event_manager &get_timed_events()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what think you about putting these in a namespace, like cata:: or somesuch?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yea as the number of them has started piling up I've been pondering that.

src/debug_menu.cpp Outdated Show resolved Hide resolved
@kevingranade kevingranade force-pushed the private-scentmap branch 2 times, most recently from a12b138 to 5949f0b Compare July 19, 2020 19:28
@ZhilkinSerg ZhilkinSerg merged commit 346d4c1 into CleverRaven:master Jul 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[C++] Changes (can be) made in C++. Previously named `Code` Code: Build Issues regarding different builds and build environments Code: Infrastructure / Style / Static Analysis Code internal infrastructure and style
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants