Refactor TrackableObjects to support copy forward changed properties without completely overwriting references

This commit is contained in:
drdev
2015-06-27 22:41:04 +00:00
parent 61f5424b2e
commit e03156cd0c
8 changed files with 102 additions and 50 deletions

View File

@@ -174,14 +174,14 @@ public final class CMatchUI
}
@Override
public void setGameView(final GameView gameView) {
super.setGameView(gameView);
cDetailPicture.setGameView(gameView);
screen.setTabCaption(gameView.getTitle());
public void setGameView(GameView gameView0) {
super.setGameView(gameView0);
gameView0 = getGameView(); //ensure updated game view used for below logic
if (gameView0 == null) { return; }
cDetailPicture.setGameView(gameView0);
screen.setTabCaption(gameView0.getTitle());
if (sortedPlayers != null) {
for (final PlayerView pv : sortedPlayers) {
pv.copy(gameView.getPlayers());
}
FThreads.invokeInEdtNowOrLater(new Runnable() {
@Override public final void run() {
for (final VField f : getFieldViews()) {