コード例 #1
0
ファイル: People.java プロジェクト: pschiffm/Illarion-Java
  /**
   * Process a record from the table containing the names and add the name to the name storage of
   * this class.
   *
   * @param line current line that is handled
   * @param loader table loader that loads the name table
   * @return true at all times
   */
  @Override
  public boolean processRecord(final int line, final TableLoader loader) {
    throwNullException(loader);

    names.addName(new CharacterId(loader.getLong(0)), loader.getString(1));

    return true;
  }
コード例 #2
0
ファイル: People.java プロジェクト: pschiffm/Illarion-Java
  /**
   * Introduce a character and store the name in the table or overwrite a existing entry for this
   * character.
   *
   * @param id the ID of the character that shall get a name
   * @param name the name that the character shall get
   */
  public void introduce(final CharacterId id, final String name) {
    throwNullException(name);

    // update character with his name
    final Char chara = getCharacter(id);
    if (chara != null) {
      chara.setName(name);
    }

    // add name to list of known names
    names.addName(id, name);
  }