Skip to content

Commit

Permalink
Update game view due to game changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Parsa2820 committed Sep 1, 2022
1 parent c02fd1d commit 4880482
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public List<Agent> findVisibleAgentsByViewerAndTurn(Agent viewer, Turn turn) {
if (agent.equals(viewer))
continue;
var agentNode = graphMap.getNodeById(agent.getNodeId());
if (agent.is(AgentType.POLICE) || agent.is(AgentType.BATMAN))
if ((agent.is(AgentType.POLICE) || agent.is(AgentType.BATMAN)) && agent.getTeam().equals(viewer.getTeam()))
visibleAgents.add(agent);
else if (agent.is(AgentType.THIEF)) {
if (currentNode.getVisibleRadiusXPoliceThief().contains(agentNode))
Expand Down Expand Up @@ -117,7 +117,7 @@ private void getPoliceAndBatmanNormalView(Agent viewer, List<Agent> visibleAgent
for (Agent agent : agentMap.values()) {
if (agent.equals(viewer))
continue;
if (agent.is(AgentType.POLICE) || agent.is(AgentType.BATMAN))
if ((agent.is(AgentType.POLICE) || agent.is(AgentType.BATMAN)) && agent.getTeam().equals(viewer.getTeam()))
visibleAgents.add(agent);
}
}
Expand All @@ -126,6 +126,8 @@ private void getThiefAndJokerView(Agent viewer, List<Agent> visibleAgents, Node
for (Agent agent : agentMap.values()) {
if (agent.equals(viewer))
continue;
if ((agent.is(AgentType.THIEF) || agent.is(AgentType.JOKER)) && agent.getTeam().equals(viewer.getTeam()))
visibleAgents.add(agent);
if (agent.is(AgentType.POLICE))
visibleAgents.add(agent);
else if (agent.is(AgentType.BATMAN)) {
Expand Down

0 comments on commit 4880482

Please sign in to comment.