aigames.soccer.application
Class LogMessageBuilder

java.lang.Object
  extended byaigames.soccer.application.LogMessageBuilder

public class LogMessageBuilder
extends java.lang.Object

Class for creating log messages for observer clients.

Version:
$Id: LogMessageBuilder.java,v 1.5 2004/05/08 21:55:28 mwerla Exp $

Constructor Summary
LogMessageBuilder()
          Class constructor - creates class instance and initiates log structure.
 
Method Summary
 void addBegin(java.lang.String name)
          Adds to log information about player which starts game.
 void addError(java.lang.String who, java.lang.String reason)
          Adds to log information about error which occured during game.
 void addMap(int mapWidth, int mapHeight, int goalHeight)
          Adds map informations to log.
 void addMove(Move m, java.util.Date date)
          Adds move to log.
 void addName(java.lang.String name)
          Adds player name to log.
 void addTextElement(java.lang.String nodeName, java.lang.String value)
          Helper method, which adds text element to log.
 void addWinner(java.lang.String name)
          Adds to log information about game winner.
 org.dom4j.Document getMessage()
          Returns document containing entire log.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LogMessageBuilder

public LogMessageBuilder()
Class constructor - creates class instance and initiates log structure.

Method Detail

addMove

public void addMove(Move m,
                    java.util.Date date)
Adds move to log.

Parameters:
m - Move to add.
date - Date at which move mwas made.

addName

public void addName(java.lang.String name)
Adds player name to log.

Parameters:
name - Player name.

addMap

public void addMap(int mapWidth,
                   int mapHeight,
                   int goalHeight)
Adds map informations to log.

Parameters:
mapWidth - Field width.
mapHeight - Field height.
goalHeight - Goal height.

addBegin

public void addBegin(java.lang.String name)
Adds to log information about player which starts game.

Parameters:
name - Player name.

addWinner

public void addWinner(java.lang.String name)
Adds to log information about game winner.

Parameters:
name -

addError

public void addError(java.lang.String who,
                     java.lang.String reason)
Adds to log information about error which occured during game.

Parameters:
who - User name which message casued error.
reason - Message explaining error cause.

addTextElement

public void addTextElement(java.lang.String nodeName,
                           java.lang.String value)
Helper method, which adds text element to log.

Parameters:
nodeName - Name of the element.
value - Element value.

getMessage

public org.dom4j.Document getMessage()
Returns document containing entire log.

Returns:
Document containing entire log.


Copyright © 2001-2004 MoMaT & MWe Team. All Rights Reserved.