[Hattrickirc-commitlog] HattrickIRC/src/org/hattrick/hattrickirc/config/impl BotConfigImpl.java, 1
Status: Beta
Brought to you by:
suls
From: Mathias S. <su...@us...> - 2006-10-01 17:41:11
|
Update of /cvsroot/hattrickirc/HattrickIRC/src/org/hattrick/hattrickirc/config/impl In directory sc8-pr-cvs5.sourceforge.net:/tmp/cvs-serv20808/src/org/hattrick/hattrickirc/config/impl Modified Files: BotConfigImpl.java Log Message: Changes from Boy van der Werf (nethyperon) Index: BotConfigImpl.java =================================================================== RCS file: /cvsroot/hattrickirc/HattrickIRC/src/org/hattrick/hattrickirc/config/impl/BotConfigImpl.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- BotConfigImpl.java 2 Jul 2005 14:13:02 -0000 1.4 +++ BotConfigImpl.java 1 Oct 2006 17:41:07 -0000 1.5 @@ -25,6 +25,10 @@ package org.hattrick.hattrickirc.config.impl; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + import org.hattrick.hattrickirc.bot.EventFilter; import org.hattrick.hattrickirc.config.BotConfig; import org.jdom.Element; @@ -39,14 +43,11 @@ private boolean changeTopic = false; private int eventFilter; private String prefix = ""; + private List operators = null; public BotConfigImpl(Element node) { owner = node.getChildText("Owner"); - if(node.getChildText("ChangeTopic").equalsIgnoreCase("true")) { - changeTopic = true; - } - prefix = node.getChildText("Prefix"); if(node.getChildText("EventFilter").equalsIgnoreCase("none")) { @@ -58,15 +59,17 @@ if(node.getChildText("EventFilter").equalsIgnoreCase("all")) { eventFilter = EventFilter.ALL; } + List childList = node.getChild("Operators").getChildren(); + if(childList != null) { + operators = new ArrayList(); + for(Iterator iter = childList.iterator(); iter.hasNext(); ) { + Element currentElement = (Element) iter.next(); + operators.add(currentElement.getText()); + } + } } /** - * @return Returns the changeTopic. - */ - public boolean isChangeTopic() { - return changeTopic; - } - /** * @return Returns the eventFilter. */ public int getEventFilter() { @@ -78,6 +81,13 @@ public String getOwner() { return owner; } + + /** + * @return Returns the operators. + */ + public List getOperators() { + return operators; + } public String toString() { return "[ owner=" + owner + |