Browse Source

Ajout contructeur action

Martin Passard 7 years ago
parent
commit
133547aede
1 changed files with 13 additions and 0 deletions
  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();