-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added ZoneView class, made opponent hand use it
- Loading branch information
Showing
2 changed files
with
67 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
cardshifter-fx/src/main/java/com/cardshifter/client/ZoneView.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package com.cardshifter.client; | ||
|
||
import java.util.HashMap; | ||
import java.util.Map; | ||
import javafx.scene.layout.Pane; | ||
|
||
public class ZoneView { | ||
|
||
private final int zoneId; | ||
private final Pane rootPane; | ||
private final Map<Integer, Pane> zoneMap = new HashMap<>(); | ||
|
||
public ZoneView(int zoneId, Pane pane) { | ||
this.zoneId = zoneId; | ||
this.rootPane = pane; | ||
} | ||
|
||
public void addPane(int paneId, Pane pane) { | ||
this.zoneMap.put(paneId, pane); | ||
this.rootPane.getChildren().add(pane); | ||
} | ||
|
||
public void removePane(int paneId) { | ||
Pane paneToRemove = this.zoneMap.get(paneId); | ||
this.rootPane.getChildren().remove(paneToRemove); | ||
this.zoneMap.remove(paneId); | ||
} | ||
|
||
public int getId() { | ||
return this.zoneId; | ||
} | ||
|
||
public int getSize() { | ||
return this.zoneMap.size(); | ||
} | ||
|
||
public Pane getRootPane() { | ||
return this.rootPane; | ||
} | ||
|
||
} |