/**
 * Copyright (C) 2022 by Martin Robillard. See https://codesample.info/about.html
 */
package e2.chapter8;

/**
 * Sample observer of ObservableCardStack. Detects when an ace is pushed onto
 * the stack. Two of the callbacks are unnecessary and purposefully not 
 * overridden.
 */
public class AceDetector implements CardStackObserver {

	@Override
	public void pushed(Card pCard) {
		if (pCard.getRank() == Rank.ACE) {
			System.out.println("Ace detected!");
		}
	}
}