/** (C) Game Page Network, Inc., Confidential, All Rights Reserved */
// ListCommand.java
// --paul@gamepage.net, 02aug97

import java.io.*;
import java.util.*;

public class ListCommand extends Command {
  ListCommand() {
    super("list", 1, "TABLE",
	  "List all the moves made so far for the game at TABLE.");
  }
  public void process(StringTokenizer args, Client c) {
    Member current = c.getMember();
    
    String name = args.nextToken();
    Table table = Table.findIt(name);
    if (table == null) {
      c.send("! list "+name+": No such table.");
      return;
    }
    Game game = table.getGame();
    if (game == null) {
      c.send("! list "+name+": No game in progress.");
      return;
    }
    
    game.sendHistory(current);
  }
}

