Removing two old invalid aproaches.

This commit is contained in:
Olof Larsson 2012-09-21 00:55:59 +02:00
parent 4d613e3b45
commit 1527dc5aa7
2 changed files with 0 additions and 91 deletions

View File

@ -1,63 +0,0 @@
package com.massivecraft.mcore4.cmd.arg.old;
import java.util.Collection;
import org.bukkit.command.CommandSender;
import com.massivecraft.mcore4.MPlugin;
import com.massivecraft.mcore4.store.Coll;
import com.massivecraft.mcore4.util.PlayerUtil;
import com.massivecraft.mcore4.util.Txt;
public class AHPlayerWrapperColl<E> extends AHBase<E>
{
final Coll<E, ?> coll;
public Coll<E, ?> coll() { return this.coll; };
public AHPlayerWrapperColl(Coll<E, ?> coll)
{
this.coll = coll;
}
@Override
public E parse(String str, String style, CommandSender sender, MPlugin p)
{
this.error.clear();
if (str == null) return null;
E ret;
if (style != null && style.equalsIgnoreCase("match"))
{
@SuppressWarnings("unchecked")
Collection<String> ids = (Collection<String>) this.coll().ids();
String id = Txt.getBestCIStart(ids, str);
ret = this.coll().get(id);
if (ret != null)
{
return ret;
}
this.error.add("<b>No player name begins with \"<p>"+str+"<b>\".");
}
else if (style != null && style.equalsIgnoreCase("matchany"))
{
ret = this.coll().get(Txt.getBestCIStart(PlayerUtil.getAllVisitorNames(), str));
if (ret != null)
{
return ret;
}
this.error.add("<b>No player name begins with \"<p>"+str+"<b>\".");
}
else
{
ret = this.coll().get(str);
if (ret != null)
{
return ret;
}
this.error.add("<b>No player with the exact name \"<p>"+str+"<b>\".");
}
return null;
}
}

View File

@ -1,28 +0,0 @@
package com.massivecraft.mcore4.cmd.arg.old;
import org.bukkit.command.CommandSender;
import com.massivecraft.mcore4.MPlugin;
import com.massivecraft.mcore4.store.Coll;
import com.massivecraft.mcore4.store.Colls;
public class AHPlayerWrapperColls<E> extends AHBase<E>
{
protected final Colls<Coll<E, ?>, E, ?> colls;
public Colls<Coll<E, ?>, E, ?> colls() { return this.colls; };
@SuppressWarnings("unchecked")
public AHPlayerWrapperColls(Object colls)
{
this.colls = (Colls<Coll<E, ?>, E, ?>) colls;
}
@Override
public E parse(String str, String style, CommandSender sender, MPlugin p)
{
Coll<E, ?> coll = colls.get(sender);
AHPlayerWrapperColl<E> ahinner = new AHPlayerWrapperColl<E>(coll);
E ret = ahinner.parse(str, style, sender, p);
this.error.addAll(ahinner.error);
return ret;
}
}