{
throw new IllegalArgumentException( "PLAY request should have exactly three arguments, not "
+ content_.getSize() );
}
GdlExpression prevExp = content_.getElement(2);
GdlList prevMoves;
StringBuilder prevMovesStr = new StringBuilder();
if ( prevExp instanceof GdlList )
{
prevMoves = (GdlList) content_.getElement(2);
prevMovesStr.append(" Previous moves: ");
for ( GdlExpression exp: prevMoves )
{
prevMovesStr.append( exp.toString() );
prevMovesStr.append(" ");
}
}
else
{
// make sure it's an atom containing NIL
if ( prevExp instanceof GdlAtom == false || prevExp.equals( GameManager.getParser().TOK_NIL ) == false )
throw new IllegalArgumentException("PLAY request doesn't have LIST and doesn't have NIL atom as prev-moves!");
prevMoves = null; // empty prev moves
}
Gamer game = GameManager.getGame(gameId_);