⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 coinlevel.java

📁 liu7788414
💻 JAVA
字号:
package staticdata;

/**
 * <p>Title: Reader.java</p>
 * <p>Description: read and convert xml file</p>
 * <p>Copyright: Gameloft 2004</p>
 * <p>Company: Gameloft Shanghai</p>
 * @author Yi Wen Hu
 * @version 1.0
 */

import javax.xml.parsers.*;
import org.w3c.dom.*;

import java.util.Vector;
import java.io.*;

public class CoinLevel {
  private short m_id;
  private short m_roundCount;
  private CoinRound[] m_coinRounds;

  public CoinLevel(Element e) {
    m_roundCount = Integer.valueOf(e.getAttribute(Reader.XML_COIN_LEVEL_ROUNDCOUNT)).shortValue();

    NodeList list=e.getElementsByTagName(Reader.XML_COIN_LEVEL_ROUND);
    if(m_roundCount!=list.getLength())
    {
      System.out.println("ERROR: wrong round count number in CoinDeleiverInfo");
      return;
    }

    short count=(short)list.getLength();
    m_coinRounds=new CoinRound[count];
    for(int i=0;i<count;i++)
      m_coinRounds[i]=new CoinRound((Element)list.item(i));
  }

  public void save(FileOutputStream fos) {
    try {
      if(m_coinRounds==null)
      {
        Reader.WriteShort((short)0,fos);
        return;
      }
      short count=(short)(m_coinRounds.length);
      Reader.WriteShort(count,fos);
      for(int i=0;i<count;i++)
        m_coinRounds[i].save(fos);

    }
    catch (Exception e) {
      e.printStackTrace();
    }
  }

  public void test() {
    if(m_coinRounds==null)return;
    short count=(short)(m_coinRounds.length);
    System.out.println("CoinLever");
    for(int i=0;i<count;i++)
      m_coinRounds[i].test();

  }
}


⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -