Who.java

src/net/sourceforge/pain/logic/event/console/command/Who.java · 707 B

From the archive pain_0_41.zip

Download the archive   « Back to the archive contents

package net.sourceforge.pain.logic.event.console.command;

import net.sourceforge.pain.*;
import net.sourceforge.pain.data.type.*;
import net.sourceforge.pain.logic.event.console.*;
import net.sourceforge.pain.logic.fn.*;


public final class Who extends CommandHandler {

	public void processCommand() throws Exception {
		int n = 0;
		for (Player p = Core.getWorld().getFirstActivePlayer(); p != null; p = p.getNextActivePlayer()) {
			MessageOutFn.outln(console, "  " + p.getName());
			n++;
		}
		MessageOutFn.outln(console, "{x\nPlayers found: " + n + ".");
	}

	public void showHelp() {
		MessageOutFn.outln(console, command.name+": shows the players currently in game.");
	}
}

Site Stats

Snippets: 1791
Codebases: 571