<commit_before>package com.bachhuberdesign.gwentcardviewer.features.shared.model

import android.database.Cursor
import android.util.Log
import com.bachhuberdesign.gwentcardviewer.util.getIntFromColumn
import com.bachhuberdesign.gwentcardviewer.util.getStringFromColumn
import io.reactivex.functions.Function
import rx.functions.Func1

/**
 * @author <NAME>
 * @version 1.0.0
 * @since 1.0.0
 */
data class Card(var cardId: Int = 0,
                var name: String = "",
                var description: String = "",
                var flavorText: String = "",
                var iconUrl: String = "",
                var mill: Int = 0,
                var millPremium: Int = 0,
                var scrap: Int = 0,
                var scrapPremium: Int = 0,
                var power: Int = 0,
                var faction: Int = 0,
                var lane: Int = 0,
                var loyalty: Int = 0,
                var rarity: Int = 0,
                var cardType: Int = 0,
                var selectedLane: Int = 0) {

    companion object {
        const val TABLE = "cards"
        const val ID = "_id"
        const val NAME = "name"
        const val DESCRIPTION = "description"
        const val FLAVOR_TEXT = "flavor_text"
        const val ICON_URL = "icon_url"
        const val MILL = "mill"
        const val MILL_PREMIUM = "mill_premium"
        const val SCRAP = "scrap"
        const val SCRAP_PREMIUM = "scrap_premium"
        const val POWER = "power"
        const val FACTION = "faction"
        const val LANE = "lane"
        const val LOYALTY = "loyalty"
        const val RARITY = "rarity"
        const val TYPE = "type"
        const val SELECTED_LANE = "selected_lane"

        val MAP1 = Func1<Cursor, Card> { cursor ->
            val card = Card()
            card.cardId = cursor.getIntFromColumn(Card.ID)
            card.name = cursor.getStringFromColumn(Card.NAME)
            card.description = cursor.getStringFromColumn(Card.DESCRIPTION)
            card.flavorText = cursor.getStringFromColumn(Card.FLAVOR_TEXT)
            card.iconUrl = cursor.getStringFromColumn(Card.ICON_URL)
            card.mill = cursor.getIntFromColumn(Card.MILL)
            card.millPremium = cursor.getIntFromColumn(Card.MILL_PREMIUM)
            card.scrap = cursor.getIntFromColumn(Card.SCRAP)
            card.scrapPremium = cursor.getIntFromColumn(Card.SCRAP_PREMIUM)
            card.faction = cursor.getIntFromColumn(Card.FACTION)
            card.lane = cursor.getIntFromColumn(Card.LANE)
            card.rarity = cursor.getIntFromColumn(Card.RARITY)
            card.cardType = cursor.getIntFromColumn(Card.TYPE)

            Log.d("Card", "Mapping to card: selectedLane: ${cursor.getIntFromColumn(Card.SELECTED_LANE)}")
            try {
                card.selectedLane = cursor.getIntFromColumn(Card.SELECTED_LANE)
            } catch (e: Exception) {
                card.selectedLane = 0
            }

            card
        }

        val MAPPER = Function<Cursor, Card> { cursor ->
            val card = Card()
            card.cardId = cursor.getIntFromColumn(Card.ID)
            card.name = cursor.getStringFromColumn(Card.NAME)
            card.description = cursor.getStringFromColumn(Card.DESCRIPTION)
            card.flavorText = cursor.getStringFromColumn(Card.FLAVOR_TEXT)
            card.iconUrl = cursor.getStringFromColumn(Card.ICON_URL)
            card.mill = cursor.getIntFromColumn(Card.MILL)
            card.millPremium = cursor.getIntFromColumn(Card.MILL_PREMIUM)
            card.scrap = cursor.getIntFromColumn(Card.SCRAP)
            card.scrapPremium = cursor.getIntFromColumn(Card.SCRAP_PREMIUM)
            card.faction = cursor.getIntFromColumn(Card.FACTION)
            card.lane = cursor.getIntFromColumn(Card.LANE)
            card.rarity = cursor.getIntFromColumn(Card.RARITY)
            card.cardType = cursor.getIntFromColumn(Card.TYPE)

            try {
                card.selectedLane = cursor.getIntFromColumn(Card.SELECTED_LANE)
            } catch (e: Exception) {
                card.selectedLane = 0
            }

            card<commit_msg>Fixed power not getting mapped from query to Card objects<commit_after>package com.bachhuberdesign.gwentcardviewer.features.shared.model

import android.database.Cursor
import android.util.Log
import com.bachhuberdesign.gwentcardviewer.util.getIntFromColumn
import com.bachhuberdesign.gwentcardviewer.util.getStringFromColumn
import io.reactivex.functions.Function
import rx.functions.Func1

/**
 * @author <NAME>
 * @version 1.0.0
 * @since 1.0.0
 */
data class Card(var cardId: Int = 0,
                var name: String = "",
                var description: String = "",
                var flavorText: String = "",
                var iconUrl: String = "",
                var mill: Int = 0,
                var millPremium: Int = 0,
                var scrap: Int = 0,
                var scrapPremium: Int = 0,
                var power: Int = 0,
                var faction: Int = 0,
                var lane: Int = 0,
                var loyalty: Int = 0,
                var rarity: Int = 0,
                var cardType: Int = 0,
                var selectedLane: Int = 0) {

    companion object {
        const val TABLE = "cards"
        const val ID = "_id"
        const val NAME = "name"
        const val DESCRIPTION = "description"
        const val FLAVOR_TEXT = "flavor_text"
        const val ICON_URL = "icon_url"
        const val MILL = "mill"
        const val MILL_PREMIUM = "mill_premium"
        const val SCRAP = "scrap"
        const val SCRAP_PREMIUM = "scrap_premium"
        const val POWER = "power"
        const val FACTION = "faction"
        const val LANE = "lane"
        const val LOYALTY = "loyalty"
        const val RARITY = "rarity"
        const val TYPE = "type"
        const val SELECTED_LANE = "selected_lane"

        val MAP1 = Func1<Cursor, Card> { cursor ->
            val card = Card()
            card.cardId = cursor.getIntFromColumn(Card.ID)
            card.name = cursor.getStringFromColumn(Card.NAME)
            card.description = cursor.getStringFromColumn(Card.DESCRIPTION)
            card.flavorText = cursor.getStringFromColumn(Card.FLAVOR_TEXT)
            card.iconUrl = cursor.getStringFromColumn(Card.ICON_URL)
            card.mill = cursor.getIntFromColumn(Card.MILL)
            card.millPremium = cursor.getIntFromColumn(Card.MILL_PREMIUM)
            card.scrap = cursor.getIntFromColumn(Card.SCRAP)
            card.scrapPremium = cursor.getIntFromColumn(Card.SCRAP_PREMIUM)
            card.faction = cursor.getIntFromColumn(Card.FACTION)
            card.lane = cursor.getIntFromColumn(Card.LANE)
            card.rarity = cursor.getIntFromColumn(Card.RARITY)
            card.cardType = cursor.getIntFromColumn(Card.TYPE)
            card.power = cursor.getIntFromColumn(Card.POWER)

            try {
                card.selectedLane = cursor.getIntFromColumn(Card.SELECTED_LANE)
            } catch (e: Exception) {
                card.selectedLane = 0
            }

            card
        }

        val MAPPER = Function<Cursor, Card> { cursor ->
            val card = Card()
            card.cardId = cursor.getIntFromColumn(Card.ID)
            card.name = cursor.getStringFromColumn(Card.NAME)
            card.description = cursor.getStringFromColumn(Card.DESCRIPTION)
            card.flavorText = cursor.getStringFromColumn(Card.FLAVOR_TEXT)
            card.iconUrl = cursor.getStringFromColumn(Card.ICON_URL)
            card.mill = cursor.getIntFromColumn(Card.MILL)
            card.millPremium = cursor.getIntFromColumn(Card.MILL_PREMIUM)
            card.scrap = cursor.getIntFromColumn(Card.SCRAP)
            card.scrapPremium = cursor.getIntFromColumn(Card.SCRAP_PREMIUM)
            card.faction = cursor.getIntFromColumn(Card.FACTION)
            card.lane = cursor.getIntFromColumn(Card.LANE)
            card.rarity = cursor.getIntFromColumn(Card.RARITY)
            card.cardType = cursor.getIntFromColumn(Card.TYPE)
            card.power = cursor.getIntFromColumn(Card.POWER)

            try {
                card.selectedLane = cursor.getIntFromColumn(Card.SELECTED_LANE)
            } catch (e: Exception) {
                card.selectedLane = 0
            }

            card
{'fraction_non_alphanumeric': 0.08968663705126666, 'fraction_numerical': 0.00552287189338456, 'mean_word_length': 1.9953254225098884, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1092959', 'n_tokens_mistral': 2483, 'n_tokens_neox': 2407, 'n_words': 494}