<commit_before>/*
 * Copyright (C) 2012 <NAME>, <NAME>, <NAME>, <NAME>
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package edu.chalmers.dat255.group09.Alarmed.modules.memoryModule.model;

import edu.chalmers.dat255.group09.Alarmed.R;

/**
 * 
 * @author <NAME>
 * 
 */
public final class Card {

	public enum CardStatus {
		Hidden, Visable;
	}

	private CardStatus currentStatus;
	private int visableImageResource;
	private final static int hiddenImageResorce = R.drawable.ic_launcher;

	public Card(int imageResource) {
		this.currentStatus = CardStatus.Hidden;
		this.visableImageResource = imageResource;
	}

	public Card(Card card) {
		this(card.visableImageResource);
	}

	public void toggleStatus() {

		if (currentStatus == CardStatus.Hidden) {
			currentStatus = CardStatus.Visable;
		} else {
			currentStatus = CardStatus.Hidden;
		}

	}

	public int getImageResource() {
		if (currentStatus == CardStatus.Hidden) {
			return hiddenImageResorce;
		} else {
			return visableImageResource;
		}
	}

	public CardStatus getStatus() {
		return currentStatus;
	}

	@Override
	public boolean equals(Object obj) {<commit_msg>MemoryModule: Added javadoc and renamed constant in the Card class<commit_after>/*
 * Copyright (C) 2012 <NAME>, <NAME>, <NAME>, <NAME>
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package edu.chalmers.dat255.group09.Alarmed.modules.memoryModule.model;

import edu.chalmers.dat255.group09.Alarmed.R;

/**
 * A class representing the logic code for a card in an memory game.
 * 
 * @author <NAME>
 * 
 */
public final class Card {

	/**
	 * An simple enum representing the two states of an card in a memory game.
	 * 
	 */
	public enum CardStatus {
		Hidden, Visable;
	}

	private static final int HIDDEN_IMAGE = R.drawable.ic_launcher;
	private CardStatus currentStatus;
	private int visableImageResource;

	/**
	 * Create a new instance of the card class.
	 * 
	 * @param imageResource
	 *            The image resource to be used by the card
	 */
	public Card(int imageResource) {
		this.currentStatus = CardStatus.Hidden;
		this.visableImageResource = imageResource;
	}

	/**
	 * Create a new card by copying a previous card.
	 * 
	 * @param card
	 *            The card to copy.
	 */
	public Card(Card card) {
		this(card.visableImageResource);
	}

	/**
	 * Toggle the card:s current status.
	 */
	public void toggleStatus() {

		if (currentStatus == CardStatus.Hidden) {
			currentStatus = CardStatus.Visable;
		} else {
			currentStatus = CardStatus.Hidden;
		}

	}

	/**
	 * 
	 * @return The image resource
	 */
	public int getImageResource() {
		if (currentStatus == CardStatus.Hidden) {
			return HIDDEN_IMAGE;
		} else {
			return visableImageResource;
		}
	}

	/**
	 * 
	 * @return The cards current status
	 */
	public CardStatus getStatus() {
		return currentStatus;
	}

	@Override
	public boolean equals(Object obj) {
{'fraction_non_alphanumeric': 0.0944801026957638, 'fraction_numerical': 0.009242618741976894, 'mean_word_length': 3.5040462427745664, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '1697062', 'n_tokens_mistral': 1244, 'n_tokens_neox': 1117, 'n_words': 396}