/*
Copyright (C) 2005 David Green <green@couchpotato.net>
All Rights Reserved.

This file is part of Aelfengard.

Aelfengard is proprietary software. You may not redistribute it without
prior written permission from the copyright holder.
*/

package server.command;

import server.DifficultyLevel;
import server.Living;
import server.Player;
import server.SyntaxException;

public class ConsiderCommand extends Command {

    public ConsiderCommand() {
        super(CommandCategory.COMBAT, "Considers the worthiness of an opponent.");
    }
    
    @Override
    public void run(Player player) throws SyntaxException {
        String name = CommandProcessor.nextToken();
        if (name == null || CommandProcessor.nextToken() != null) {
            throw new SyntaxException();
        }
        Living living = player.matchLocalLiving(name);
        if (living == null) {
            player.sendText(true, "There's nothing here by that name.");
            return;
        }
        DifficultyLevel level = DifficultyLevel.forPair(player.getLevel(), living.getLevel());
        player.sendText(true, null, null, null, level.getTokenString(), null, living);
    }

    @Override
    public String[] getSyntax(Player player) {
        return new String[] { "<who>" };
    }

}