@Override
	protected Command doPlay() {
		Command cmd = null;
		try {
			print();

			String line;
			ChessmenEntity target = null;
			PositionEntity position = null;
			while (true) {
				System.out.print("IĂ");
				line = reader.readLine();
				if ("end".equals(line.toLowerCase())) {
					cmd = new GiveUpCommand();
					break;
				}
				int no = getNumber(line);
				if (0 == no) {
					PositionEntity p = new PositionEntity(line);
					target = getMyChessmen(p);
					if (null == target) {
						continue;
					} else {
						break;
					}
				} else {
					List<ChessmenEntity> chessmens = getMyStockChessmens();
					if (chessmens.size() <= no) {
						continue;
					} else {
						target = chessmens.get(no - 1);
						break;
					}
				}
			}

			if (null == cmd) {
				while (true) {
					System.out.print("ʒuIĂ");
					line = reader.readLine();

					PositionEntity p = new PositionEntity(line);
					if (target.isBoard()) {
						if (isMoveChessmen(target, p)) {
							position = p;
							boolean promote = false;
							if (!target.isPromote()) {
								if (3 > p.getY()) {
									System.out.print("Ȃ܂(Y)");
									line = reader.readLine();
									if ("y".equals(line.toLowerCase())) {
										promote = true;
									}
								}
							}
							cmd = new MoveCommand(target, position, promote);
							break;
						} else {
							continue;
						}
					} else {
						if (isPutChessmen(target, p)) {
							position = p;
							cmd = new PutCommand(target, position);
							break;
						} else {
							continue;
						}
					}
				}
			}

		} catch (IOException ex) {
			ex.printStackTrace();
		}
		return cmd;
	}