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

Move pure operations on class attributes into those classes #212

Open
mlevatich opened this issue Oct 19, 2020 · 1 comment
Open

Move pure operations on class attributes into those classes #212

mlevatich opened this issue Oct 19, 2020 · 1 comment
Assignees
Labels
back-end A back-end task. refactor A code refactoring task.

Comments

@mlevatich
Copy link
Collaborator

mlevatich commented Oct 19, 2020

There's currently a lot of if character.alleg == C.Alleg.Hunter and if player.state != C.PlayerState.Dead kinds of things floating around, especially after #210

These sorts of checks on the attributes of characters, cards, etc belong in those classes, most of which are pretty empty at the moment. (for example, a Player.isAlive() function, or character.IsShadow()). This would do a lot to make the rest of the codebase more readable.

I'm not sure if there are any non-trivial operations that we can move in this way, but even moving the trivial ones still seems like a good idea to me.

@mlevatich mlevatich added back-end A back-end task. refactor A code refactoring task. labels Oct 19, 2020
@amritrau
Copy link
Owner

amritrau commented Oct 24, 2020

Strongly agreed on this one. I can try and handle this -- let's do this after we merge #208 and #210, though (we don't have enums in the main branch yet).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
back-end A back-end task. refactor A code refactoring task.
Projects
None yet
Development

No branches or pull requests

2 participants