if (champions == null) {
SQLiteQueue queue = GameStatsDBWrapper.getQueue();
champions = new LinkedList<Champion>();
queue.execute(new SQLiteJob<Object>() {
protected Object job(SQLiteConnection connection) throws Throwable {
SQLiteStatement st = connection
.prepare("SELECT * FROM champions");
while (st.step()) {
Champion newChamp = new Champion();
int i = 0; // first column is id
newChamp.ID = st.columnInt(i); i++;
newChamp.name = st.columnString(i); i++;
newChamp.displayName = st.columnString(i); i++;
newChamp.title = st.columnString(i); i++;
newChamp.iconPath = st.columnString(i); i++;
newChamp.portraitPath = st.columnString(i); i++;
newChamp.splashPath = st.columnString(i); i++;
newChamp.danceVideoPath = st.columnString(i); i++; i++; // TODO: tags
newChamp.description = st.columnString(i); i++;
newChamp.quote = st.columnString(i); i++;
newChamp.quoteAuthor = st.columnString(i); i++;
newChamp.range = st.columnInt(i); i++;
newChamp.movementSpeed = st.columnInt(i); i++;
newChamp.armorBase = st.columnDouble(i); i++;
newChamp.armorLevel = st.columnDouble(i); i++;
newChamp.manaBase = st.columnInt(i); i++;
newChamp.manaLevel = st.columnInt(i); i++;
newChamp.criticalChanceBase = st.columnInt(i); i++;
newChamp.criticalChanceLevel = st.columnInt(i); i++;
newChamp.manaRegenBase = st.columnDouble(i); i++;
newChamp.manaRegenLevel = st.columnDouble(i); i++;
newChamp.healthRegenBase = st.columnDouble(i); i++;
newChamp.healthRegenLevel = st.columnDouble(i); i++;
newChamp.magicResistBase = st.columnInt(i); i++;
newChamp.magicResistLevel = st.columnDouble(i); i++;
newChamp.healthBase = st.columnInt(i); i++;
newChamp.healthLevel = st.columnDouble(i); i++;
newChamp.attackBase = st.columnDouble(i); i++;
newChamp.attackLevel = st.columnDouble(i); i++;
newChamp.ratingAttack = st.columnInt(i); i++;
newChamp.ratingDefense = st.columnInt(i); i++;
newChamp.ratingDifficulty = st.columnInt(i); i++;
newChamp.ratingMagic = st.columnInt(i); i++;
newChamp.tips = st.columnString(i); i++;
newChamp.opponentTips = st.columnString(i); i++;
newChamp.selectSoundPath = st.columnString(i); i++;
SQLiteStatement skinsDB = connection
.prepare("SELECT * FROM championskins WHERE championId = ?");
skinsDB.bind(1, newChamp.ID);
while (skinsDB.step()) {
ChampionSkin theSkin = new ChampionSkin();
i = 0;
theSkin.ID = skinsDB.columnInt(i); i++;
theSkin.isDefault = skinsDB.columnInt(i) == 1; i++;
theSkin.order = skinsDB.columnInt(i); i++;
theSkin.championID = skinsDB.columnInt(i); i++;
theSkin.name = skinsDB.columnString(i); i++;
theSkin.displayName = skinsDB.columnString(i); i++;
theSkin.portraitPath = skinsDB.columnString(i); i++;
theSkin.splashPath = skinsDB.columnString(i); i++;
newChamp.skins.add(theSkin);
}
skinsDB.dispose();
/*
* SQLiteStatement itemsDB = connection.prepare(
* "SELECT * FROM championitems WHERE championId = ?");
* itemsDB.bind(1, newChamp.ID); while (itemsDB.step()) {