added uebung07 angabe
This commit is contained in:
15
uebung07/src/oop/ch05/mensa/CountCard.java
Normal file
15
uebung07/src/oop/ch05/mensa/CountCard.java
Normal file
@@ -0,0 +1,15 @@
|
||||
package oop.ch05.mensa;
|
||||
|
||||
public class CountCard extends MensaCard {
|
||||
|
||||
public CountCard(String key, Color color) {
|
||||
super(key, color);
|
||||
if (color != Color.red && color != Color.gray)
|
||||
throw new IllegalArgumentException("Invalid CountCard color " + color);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void pass(CashPoint cashPoint) {
|
||||
cashPoint.count(this);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user