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

/**
 * Stub of an object that represents the state of a card game. This
 * class is used to illustrate the use of the Prototype design pattern.
 */
public class GameModel {
	
	private final CardSource aCardSourcePrototype;
	
	// In a complete code base this field would be used.
	@SuppressWarnings("unused") 
	private CardSource aCardSource;
	
	public GameModel(CardSource pCardSourcePrototype) {
		aCardSourcePrototype = pCardSourcePrototype;
		newGame();
	}
	
	public void newGame() {
aCardSource = aCardSourcePrototype.copy();
} }