// Path: app/src/main/java/org/secuso/privacyfriendlymemory/common/MemoGamePlayerFactory.java
// public class MemoGamePlayerFactory {
// 
//     public static List<MemoGamePlayer> createPlayers(MemoGameMode memoryMode){
//         List<MemoGamePlayer> players = new LinkedList<>();
//         int playerCount = memoryMode.getPlayerCount();
//         MemoGamePlayer player;
//         for(int i = 1; i <= playerCount; i++){
//             player = new MemoGamePlayer(String.valueOf(i));
//             players.add(player);
//         }
//         return players;
//     }
// }


import android.net.Uri;
import org.secuso.privacyfriendlymemory.common.MemoGamePlayerFactory;
import org.secuso.privacyfriendlymemory.ui.R;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
package org.secuso.privacyfriendlymemory.model;




/**
 * Created by Hannes on 20.05.2016.
 */
public class MemoGame {

    private final MemoGameDifficulty memoryDifficulty;
    private final MemoGameMode memoryMode;
    private final CardDesign cardDesign;

    private final Map<Integer, MemoGameCard> deck;
    private final int notFoundImageResID;

    private Integer[] falseSelectedCards = new Integer[2];
    private boolean falseSelected = false;

    private MemoGamePlayer currentPlayer;
    private MemoGameCard selectedCard = null;
    private MemoGameTimer timer;

    private MemoGameCard[] temporarySelectedCards = new MemoGameCard[2];
    private List<MemoGameCard> foundCards = new LinkedList<>();
    private List<MemoGamePlayer> players = new LinkedList<>();

    private int selectedCardsCount = 0;


    public MemoGame(CardDesign cardDesign, MemoGameMode memoryMode, MemoGameDifficulty memoryDifficulty) {
        this.memoryDifficulty = memoryDifficulty;
        this.memoryMode = memoryMode;
        this.cardDesign = cardDesign;
        if(cardDesign == CardDesign.CUSTOM){
            this.deck = new MemoGameDeck(MemoGameCustomImages.getUris(memoryDifficulty)).getDeck();
        }else{
            this.deck = new MemoGameDeck(MemoGameDefaultImages.getResIDs(cardDesign, memoryDifficulty, true)).getDeck();
        }
        this.notFoundImageResID = MemoGameDefaultImages.getNotFoundImageResID();
// Path: app/src/main/java/org/secuso/privacyfriendlymemory/common/MemoGamePlayerFactory.java
// public class MemoGamePlayerFactory {
// 
//     public static List<MemoGamePlayer> createPlayers(MemoGameMode memoryMode){
//         List<MemoGamePlayer> players = new LinkedList<>();
//         int playerCount = memoryMode.getPlayerCount();
//         MemoGamePlayer player;
//         for(int i = 1; i <= playerCount; i++){
//             player = new MemoGamePlayer(String.valueOf(i));
//             players.add(player);
//         }
//         return players;
//     }
// }


// Path: app/src/main/java/org/secuso/privacyfriendlymemory/model/MemoGame.java
import android.net.Uri;
import org.secuso.privacyfriendlymemory.common.MemoGamePlayerFactory;
import org.secuso.privacyfriendlymemory.ui.R;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;

package org.secuso.privacyfriendlymemory.model;




/**
 * Created by Hannes on 20.05.2016.
 */
public class MemoGame {

    private final MemoGameDifficulty memoryDifficulty;
    private final MemoGameMode memoryMode;
    private final CardDesign cardDesign;

    private final Map<Integer, MemoGameCard> deck;
    private final int notFoundImageResID;

    private Integer[] falseSelectedCards = new Integer[2];
    private boolean falseSelected = false;

    private MemoGamePlayer currentPlayer;
    private MemoGameCard selectedCard = null;
    private MemoGameTimer timer;

    private MemoGameCard[] temporarySelectedCards = new MemoGameCard[2];
    private List<MemoGameCard> foundCards = new LinkedList<>();
    private List<MemoGamePlayer> players = new LinkedList<>();

    private int selectedCardsCount = 0;


    public MemoGame(CardDesign cardDesign, MemoGameMode memoryMode, MemoGameDifficulty memoryDifficulty) {
        this.memoryDifficulty = memoryDifficulty;
        this.memoryMode = memoryMode;
        this.cardDesign = cardDesign;
        if(cardDesign == CardDesign.CUSTOM){
            this.deck = new MemoGameDeck(MemoGameCustomImages.getUris(memoryDifficulty)).getDeck();
        }else{
            this.deck = new MemoGameDeck(MemoGameDefaultImages.getResIDs(cardDesign, memoryDifficulty, true)).getDeck();
        }
        this.notFoundImageResID = MemoGameDefaultImages.getNotFoundImageResID();
        this.players = MemoGamePlayerFactory.createPlayers(memoryMode);