<commit_before>
const Suit = require('./Suit');
const Color = require('./Color');
const Type = require('./Type');

function convertSuitToColor(suit) {
	if (suit === Suit.Spade || suit === Suit.Club) {
		return Color.Black;
	} else if (suit === Suit.Heart || suit === Suit.Diamond) {
		return Color.Red;
	} else {
		return Color.None;
	}
}

class Card {

	constructor(name, suit, number) {
		this._id = 0;
		this._name = name;
		this._suit = suit;
		this._number = number;
		this._color = convertSuitToColor(suit);
	}

	/**
	 * Check if the selected players are feasible
	 * @param {Player[]} selected
	 * @param {Player} source
	 * @return {boolean}
	 */
	targetFeasible(selected, source) {
		return true;
	}

	/**
	 * Check if toSelect is a valid target
	 * @param {Player[]} selected
	 * @param {Player} toSelect
	 * @param {Player} source
	 * @return {boolean}
	 */
	targetFilter(selected, toSelect, source) {
		return !!toSelect;
	}

	/**
	 * Check if this card is available
	 * @param {Player} source
	 * @return {boolean}
	 */
    isAvailable(source) {
		return true;
	}

	/**
	 * The first procedure of using a card
	 * @param {GameDriver} driver
	 * @param {CardUseStruct} use
	 */
	onUse(driver, use) {
	}

	/**
	 * The second procedure of using a card
	 * @param {GameDriver} driver
	 * @param {CardUseStruct} use
	 */
	use(driver, use) {
	}

	/**
	 * This function will be called on every target before effect()
	 * @param {GameDriver} driver
	 * @param {CardEffectStruct} effect
	 */
	onEffect(driver, effect) {
	}

	/**
	 * This function will be called on every target after use()
	 * @param {GameDriver} driver
	 * @param {CardEffectStruct} effect
	 */
	effect(driver, effect) {
	}

	/**
	 * This function will be called after effect() has been executed on every target
	 * @param {GameDriver} driver
	 */
	complete(driver) {
	}

}

Card.Suit = Suit;
Card.Color = Color;
Card.Type = Type;

module.exports = Card;
<commit_msg>Add more getter function to class Card<commit_after>
const Suit = require('./Suit');
const Color = require('./Color');
const Type = require('./Type');

function convertSuitToColor(suit) {
	if (suit === Suit.Spade || suit === Suit.Club) {
		return Color.Black;
	} else if (suit === Suit.Heart || suit === Suit.Diamond) {
		return Color.Red;
	} else {
		return Color.None;
	}
}

class Card {

	constructor(name, suit, number) {
		this._id = 0;
		this._name = name;
		this._suit = suit;
		this._number = number;
		this._color = convertSuitToColor(suit);
	}

	/**
	 * Card id
	 * @return {number}
	 */
	id() {
		return this._id;
	}

	/**
	 * Card name
	 * @return {string}
	 */
	name() {
		return this._name;
	}

	/**
	 * Card suit
	 * @return {Card.Suit}
	 */
	suit() {
		return this._suit;
	}

	/**
	 * Card number
	 * @return {number}
	 */
	number() {
		return this._number;
	}

	/**
	 * Card color
	 * @return {Card.Color}
	 */
	color() {
		return this._color;
	}


	/**
	 * Check if the selected players are feasible
	 * @param {Player[]} selected
	 * @param {Player} source
	 * @return {boolean}
	 */
	targetFeasible(selected, source) {
		return true;
	}

	/**
	 * Check if toSelect is a valid target
	 * @param {Player[]} selected
	 * @param {Player} toSelect
	 * @param {Player} source
	 * @return {boolean}
	 */
	targetFilter(selected, toSelect, source) {
		return !!toSelect;
	}

	/**
	 * Check if this card is available
	 * @param {Player} source
	 * @return {boolean}
	 */
    isAvailable(source) {
		return true;
	}

	/**
	 * The first procedure of using a card
	 * @param {GameDriver} driver
	 * @param {CardUseStruct} use
	 */
	onUse(driver, use) {
	}

	/**
	 * The second procedure of using a card
	 * @param {GameDriver} driver
	 * @param {CardUseStruct} use
	 */
	use(driver, use) {
	}

	/**
	 * This function will be called on every target before effect()
	 * @param {GameDriver} driver
	 * @param {CardEffectStruct} effect
	 */
	onEffect(driver, effect) {
	}

	/**
	 * This function will be called on every target after use()
	 * @param {GameDriver} driver
	 * @param {CardEffectStruct} effect
	 */
	effect(driver, effect) {
	}

	/**
	 * This function will be called after effect() has been executed on every target
	 * @param {GameDriver} driver
	 */
	complete(driver) {
	}

	/**
	 * Convert this card to JSON
	 * @return {object}
	 */
	toJSON() {
		return {
			id: this._id,
			name: this._name,
			suit: this._suit,
			number: this._number,
		};
	}

}

Card.Suit = Suit;
Card.Color = Color;
Card.Type = Type;

module.exports = Card;

{'fraction_non_alphanumeric': 0.14851926074370964, 'fraction_numerical': 0.00044533511467379205, 'mean_word_length': 3.0214861235452104, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '7513111', 'n_tokens_mistral': 1639, 'n_tokens_neox': 1468, 'n_words': 442}