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

Add wanted mark when player's in restricted area #88

Merged
merged 5 commits into from
Mar 29, 2024

Conversation

iquelli
Copy link
Collaborator

@iquelli iquelli commented Mar 28, 2024

Closes #59

Copy link
Owner

@TiagoFar78 TiagoFar78 left a comment

Choose a reason for hiding this comment

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

This was not how I was thinking this should be. I imagined that whenver a prisioner is seen by police in a restricted area he would become wanted. However, I liked this solution because it avoids the "seen" factor that would be really hard to do. Good job.

@@ -97,7 +99,7 @@ public boolean hasIllegalItems() {
// ########################################

public boolean isWanted() {
return _isWanted;
return _isWanted || _inRestrictedArea;
Copy link
Owner

Choose a reason for hiding this comment

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

You can never do this. You have to call isInRestrictedArea() whenever isWanted() is called. The name of a method tells you what it is supposed to do. Don't change it's purpose.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I feel like it would make sense to have a function in player that would say if he can be arrested or not rather than adding 2 conditions everytime

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

so I thought that adding it in the isWanted made sense

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

but maybe I can create another function in client that will do that @TiagoFar78 instead of adding it to that one

Copy link
Owner

Choose a reason for hiding this comment

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

Ok sure that's a nice solution.

return _inRestrictedArea;
}

public void setInRestrictedArea() {
Copy link
Owner

Choose a reason for hiding this comment

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

Change name to enteredRestrictedArea

_inRestrictedArea = true;
}

public void removeInRestrictedArea() {
Copy link
Owner

Choose a reason for hiding this comment

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

Change name to leftRestrictedArea

@iquelli iquelli merged commit 2348c50 into TiagoFar78:master Mar 29, 2024
@iquelli iquelli deleted the wanted branch March 31, 2024 00:38
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.

ENH: Implement wanted mark
2 participants