Exemple #1
0
  /**
   * Called to serialize entity's state.
   *
   * @param saver
   */
  public void save(DataSaver saver) {
    if (saver == null) {
      return;
    }

    // load common entity parameters
    m_bb.save("localBounds", saver);
    m_pos.save("position", saver);
    saver.setFloatValue("facing", m_facing);

    // load the aspects
    int aspectsCount = m_aspects.size();
    for (int i = 0; i < aspectsCount; ++i) {
      m_aspects.get(i).save(saver);
    }

    // save implementation specific stuff
    onSave(saver);
  }