// Path: src/main/java/model/HolyKnight.java
// public class HolyKnight extends AbstractKnight {
// 
//     public String getName() {
// 	return "Holy Knight is my name!";
//     }
// 
//     @Override
//     public String toString() {
// 	return "HolyKnight [getName()=" + getName() + ", getWeapon()=" + getWeapon() + "]";
//     }
// 
//     @Override
//     public Integer getDamage() {
// 	return super.getDamage() * 1;
//     }
// 
// }
// 
// Path: src/main/java/model/Knight.java
// public interface Knight {
//     String getName();
// 
//     void setWeapon(KnightWeapon knightWeapon);
// 
//     KnightWeapon getWeapon();
// 
//     Knight cloneKnight() throws CloneNotSupportedException;
// 
//     Integer getDamage();
// 
//     void readQuest(String questDetails);
// 
//     Double getArmor();
// 
//     void reduceArmor(Double reduceValue);
// 
// }
// 
// 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.HolyKnight;
import model.Knight;
import model.KnightWeapon;
package behavioral.chainofresponsibility;


/**
 * 
 * @author prvoslav
 * 
 *         Main class that tests the chain of responsibility by creating a chain
 *         of dragon slayer representatives and asking the head to attack. Chain
 *         communicates between elements to find appropriate solution.
 *
 */
public class Main {

    public static void main(String[] args) {
	Knight knight1 = new HolyKnight();
	knight1.setWeapon(KnightWeapon.DOUBLE_SWORD);

	DragonSlayer dragonSlayerHandler1 = new DragonSlayerRepresentitive(null, knight1);

	Knight knight2 = new HolyKnight();
	knight2.setWeapon(KnightWeapon.SWORD);

	DragonSlayer dragonSlayerHandler2 = new DragonSlayerRepresentitive(dragonSlayerHandler1, knight2);

	Knight knight3 = new HolyKnight();
	knight3.setWeapon(KnightWeapon.FAITH);

	DragonSlayer root = new DragonSlayerRepresentitive(dragonSlayerHandler2, knight3);

	if (root.attack(18)) {
	    System.out.println("Dragon way slayed!");
	} else {
// Path: src/main/java/model/HolyKnight.java
// public class HolyKnight extends AbstractKnight {
// 
//     public String getName() {
// 	return "Holy Knight is my name!";
//     }
// 
//     @Override
//     public String toString() {
// 	return "HolyKnight [getName()=" + getName() + ", getWeapon()=" + getWeapon() + "]";
//     }
// 
//     @Override
//     public Integer getDamage() {
// 	return super.getDamage() * 1;
//     }
// 
// }
// 
// Path: src/main/java/model/Knight.java
// public interface Knight {
//     String getName();
// 
//     void setWeapon(KnightWeapon knightWeapon);
// 
//     KnightWeapon getWeapon();
// 
//     Knight cloneKnight() throws CloneNotSupportedException;
// 
//     Integer getDamage();
// 
//     void readQuest(String questDetails);
// 
//     Double getArmor();
// 
//     void reduceArmor(Double reduceValue);
// 
// }
// 
// 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/chainofresponsibility/Main.java
import model.HolyKnight;
import model.Knight;
import model.KnightWeapon;

package behavioral.chainofresponsibility;


/**
 * 
 * @author prvoslav
 * 
 *         Main class that tests the chain of responsibility by creating a chain
 *         of dragon slayer representatives and asking the head to attack. Chain
 *         communicates between elements to find appropriate solution.
 *
 */
public class Main {

    public static void main(String[] args) {
	Knight knight1 = new HolyKnight();
	knight1.setWeapon(KnightWeapon.DOUBLE_SWORD);

	DragonSlayer dragonSlayerHandler1 = new DragonSlayerRepresentitive(null, knight1);

	Knight knight2 = new HolyKnight();
	knight2.setWeapon(KnightWeapon.SWORD);

	DragonSlayer dragonSlayerHandler2 = new DragonSlayerRepresentitive(dragonSlayerHandler1, knight2);

	Knight knight3 = new HolyKnight();
	knight3.setWeapon(KnightWeapon.FAITH);

	DragonSlayer root = new DragonSlayerRepresentitive(dragonSlayerHandler2, knight3);

	if (root.attack(18)) {
	    System.out.println("Dragon way slayed!");
	} else {
	    System.out.println("Knight was sleapy today");