diff --git a/src/main/java/de/hsfulda/onses/models/Card.java b/src/main/java/de/hsfulda/onses/models/Card.java index 2dbc3d5..568851f 100644 --- a/src/main/java/de/hsfulda/onses/models/Card.java +++ b/src/main/java/de/hsfulda/onses/models/Card.java @@ -7,11 +7,14 @@ public class Card { public final static String PROPERTY_COLOR = "color"; public final static String PROPERTY_VALUE = "value"; + public final static String PROPERTY_SELECTED = "selected"; + protected PropertyChangeSupport listeners; private Color color; private Value value; private boolean facedown = false; + private boolean selected; public enum Color { RED, BLUE, GREEN, YELLOW, BLACK; @@ -51,6 +54,17 @@ public class Card { return this; } + public boolean isSelected() { + return selected; + } + + public Card setSelected(boolean selected) { + final boolean oldValue = this.selected; + this.selected = selected; + this.firePropertyChange(PROPERTY_SELECTED, oldValue, selected); + return this; + } + public PropertyChangeSupport listeners() { if(this.listeners == null) { this.listeners = new PropertyChangeSupport(this);