#!/usr/bin/perl
# Show the concrete classes.
#use Mooix::Thing;
#use Mooix::Root;
run sub {
	my $this=shift;
	%_=@_;
	
	# Make sure that this command is not spoofed, just in case.
        if ($_{avatar} != $this) {
		fail "No!"; 
	}
	
	my @ret;
	my $maxlen=0;
	foreach my $obj ($Mooix::Root->concrete->list) {
		my $id=$obj->id;
		$id=~s!^.*/([^/]+$)!$1!;
		my $name=$obj->name;
		if ($maxlen < length($name)) {
			$maxlen=length($name);
		}
		push @ret, [ $name, "(mooix:$id)" ];
	}

	@ret = map { "\t".$_->[0].(' ' x (2 + $maxlen - length($_->[0]))).$_->[1] } @ret;
	$_{session}->page("Available classes:", @ret);
}
