[virtualcommons-svn] commit/irrigation: alllee: fixing display bugs with unrestricted visibility
Status: Beta
Brought to you by:
alllee
From: <com...@bi...> - 2014-05-14 06:41:37
|
1 new commit in irrigation: https://bitbucket.org/virtualcommons/irrigation/commits/69fe6de7e90a/ Changeset: 69fe6de7e90a User: alllee Date: 2014-05-14 08:41:21 Summary: fixing display bugs with unrestricted visibility Affected #: 3 files diff -r 449d95d0bcd4b3d31237f6c076878cd0db92458c -r 69fe6de7e90a5e1cd7314721ddbbdd5f54f11abc src/main/java/edu/asu/commons/irrigation/client/CanalPanel.java --- a/src/main/java/edu/asu/commons/irrigation/client/CanalPanel.java +++ b/src/main/java/edu/asu/commons/irrigation/client/CanalPanel.java @@ -103,7 +103,7 @@ int priority = clientData.getPriority(); Gate gate = gates[priority]; // draw the irrigation canal - if (clientDataModel.getClientData().isDownstreamAndOutOfRange(clientData)) { + if (restrictedVisibility && clientDataModel.getClientData().isDownstreamAndOutOfRange(clientData)) { graphics2D.setColor(Color.WHITE); graphics2D.fillRect(gate.getX(), gate.getY(), gate.getWidth(), gate.getHeight()); @@ -114,7 +114,7 @@ gate.getWidth(), gate.getHeight()); } // draw the irrigation gate inlets - if (clientDataModel.getClientData().isImmediateNeighbor(clientData)) { + if (!restrictedVisibility || (restrictedVisibility && clientDataModel.getClientData().isImmediateNeighbor(clientData))) { graphics2D.setColor(Color.BLUE); graphics2D.fillRect(gate.getOpeningsX(), gate.getOpeningsY(), gate.getOpeningsWidth(), gate.getOpeningsHeight()); @@ -295,7 +295,7 @@ && (particles[i].x >= gates[0].getOpeningsX() && particles[i].x <= (gates[0].getOpeningsX() + gateBuffer)) && (particles[i].y >= reservoirHeight - gateBuffer && particles[i].y <= reservoirHeight)) { - if (restrictedVisibility && sortedClients.get(0).isImmediateNeighbor(thisClientData) || !restrictedVisibility) + if ((restrictedVisibility && sortedClients.get(0).isImmediateNeighbor(thisClientData)) || !restrictedVisibility) { // if we are in the restricted visibility condition AND gate 0 is an immediate neighbor of this client OR we are not in a restricted // visibility condition at all, put this ball in the diff -r 449d95d0bcd4b3d31237f6c076878cd0db92458c -r 69fe6de7e90a5e1cd7314721ddbbdd5f54f11abc src/main/java/edu/asu/commons/irrigation/client/IrrigationClient.java --- a/src/main/java/edu/asu/commons/irrigation/client/IrrigationClient.java +++ b/src/main/java/edu/asu/commons/irrigation/client/IrrigationClient.java @@ -172,6 +172,7 @@ channel.add(this, new EventTypeProcessor<RoundStartedEvent>(RoundStartedEvent.class) { public void handle(RoundStartedEvent event) { clientDataModel.initialize(event); + System.err.println("restricted visibility? " + getRoundConfiguration().isRestrictedVisibility()); experimentGameWindow.startRound(); } }); diff -r 449d95d0bcd4b3d31237f6c076878cd0db92458c -r 69fe6de7e90a5e1cd7314721ddbbdd5f54f11abc src/main/java/edu/asu/commons/irrigation/server/IrrigationServer.java --- a/src/main/java/edu/asu/commons/irrigation/server/IrrigationServer.java +++ b/src/main/java/edu/asu/commons/irrigation/server/IrrigationServer.java @@ -239,8 +239,7 @@ ArrayList<ClientData> allTargets = new ArrayList<ClientData>(); if (Identifier.ALL.equals(target)) { // relay to all clients in this client's group. - boolean restrictedVisibility = getRoundConfiguration() - .isRestrictedVisibility(); + boolean restrictedVisibility = getRoundConfiguration().isRestrictedVisibility(); for (ClientData clientData : clients.get(source).getGroupDataModel().getClientDataMap().values()) { Identifier targetId = clientData.getId(); if (targetId.equals(source) Repository URL: https://bitbucket.org/virtualcommons/irrigation/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email. |