// Path: src/main/java/model/KnightWeapon.java
// public enum KnightWeapon {
//     SWORD(10), DOUBLE_SWORD(19), FAITH(1);
//     
//     /**
//      * Damage this weapon can do
//      */
//     private Integer damage;
// 
//     private KnightWeapon(Integer damage) {
// 	this.damage = damage;
//     }
// 
//     public Integer getDamage() {
// 	return damage;
//     }
// }


import model.KnightWeapon;
package behavioral.memento;


/**
 * 
 * @author prvoslav
 *
 *         Main class that demonstrates memento pattern. At first we create a
 *         holy memento knight and create a memento. After chaning the weapon to
 *         the knight we can use previously created memento.
 * 
 */
public class Main {

    public static void main(String[] args) {
	Caretaker caretaker = new Caretaker();

	MementoKnight knight = new HolyKnightMemento();
	System.out.println("Init Weapon: " + knight.getWeapon());

	caretaker.addMemento(knight.getMemento());

// Path: src/main/java/model/KnightWeapon.java
// public enum KnightWeapon {
//     SWORD(10), DOUBLE_SWORD(19), FAITH(1);
//     
//     /**
//      * Damage this weapon can do
//      */
//     private Integer damage;
// 
//     private KnightWeapon(Integer damage) {
// 	this.damage = damage;
//     }
// 
//     public Integer getDamage() {
// 	return damage;
//     }
// }


// Path: src/main/java/behavioral/memento/Main.java
import model.KnightWeapon;

package behavioral.memento;


/**
 * 
 * @author prvoslav
 *
 *         Main class that demonstrates memento pattern. At first we create a
 *         holy memento knight and create a memento. After chaning the weapon to
 *         the knight we can use previously created memento.
 * 
 */
public class Main {

    public static void main(String[] args) {
	Caretaker caretaker = new Caretaker();

	MementoKnight knight = new HolyKnightMemento();
	System.out.println("Init Weapon: " + knight.getWeapon());

	caretaker.addMemento(knight.getMemento());

	knight.setWeapon(KnightWeapon.DOUBLE_SWORD);