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

Setters and Getters: Players #7401

Closed

Conversation

kphoenix137
Copy link
Collaborator

@kphoenix137 kphoenix137 commented Sep 3, 2024

Adds setters and getters for things related to the player, setting up the previously established structs as classes, ready for member variables to be made private once functions have been updated to use the new methods.

This is a step towards finishing: #7397

Currently I'm having difficulty getting Lua to be able to access and modify the Player struct. I believe by accessing members with setters and getters, we can avoid this problem utilizing a core aspect of object oriented programming.

I've begun to apply usage of these setters and getters within player.cpp, but decided to rather submit this with just the header files changes first so changes can be applied incrementally to avoid having a 100,000 line count diff 🗡️

@StephenCWills
Copy link
Member

Currently I'm having difficulty getting Lua to be able to access and modify the Player struct. I believe by accessing members with setters and getters, we can avoid this problem utilizing a core aspect of object oriented programming.

Can you help me to believe it as well by sharing examples of code or something? What's the nature of the difficulty you ran into, and how is it going to be made easier by introducing a bunch of getters and setters?

@kphoenix137 kphoenix137 marked this pull request as draft September 3, 2024 03:31
@kphoenix137 kphoenix137 closed this Sep 3, 2024
@kphoenix137 kphoenix137 deleted the oop-classes-player branch September 3, 2024 05:58
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