-
Notifications
You must be signed in to change notification settings - Fork 5
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
Conversation
There was a problem hiding this 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; |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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() { |
There was a problem hiding this comment.
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() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change name to leftRestrictedArea
Closes #59