Parcourir la source

Ajout contructeur action

Martin Passard il y a 7 ans
Parent
commit
133547aede
1 fichiers modifiés avec 13 ajouts et 0 suppressions
  1. 13 0
      src/actions/Action.java

+ 13 - 0
src/actions/Action.java

@@ -21,6 +21,15 @@ public abstract class Action {
 		this.bot = b;
 	}
 	
+	protected Action(Bot b, String...keywords) {
+		this.bot = b;
+		List<String> ar = new ArrayList<>(keywords.length); 
+		for(int i=0;i<keywords.length;++i) {
+			ar.add(keywords[i]);
+		}
+		this.keyWords=ar;
+	}
+	
 	/**
 	 * 
 	 * Methode réagissant au message @see PircBot;
@@ -79,6 +88,10 @@ public abstract class Action {
 		return ar;
 	}
 	
+	/**
+	 * Renvoie le message help de la fonction. Ce message sert lors de l'utilisation de +help <nom de commande>
+	 * @return chaine help de la commande
+	 */
 	public abstract String help();