예제 #1
0
    public static IEnumerator InitializeGame()
    {
        //Making query
        PlayerDao    playerDao    = new PlayerDao();
        StoreDeckDao storeDeckDao = new StoreDeckDao();
        MatchDao     matchDao     = new MatchDao();

        List <Dao> daoList = new List <Dao>()
        {
            playerDao, storeDeckDao, matchDao
        };

        yield return(makeQuerry(daoList));

        if (!succsesfull)
        {
            yield break;
        }

        //Getting results
        Player player = playerDao.getQueryResultPlayer();

        Player.setInstance(player);

        List <StoreDeck> storeDeckList = storeDeckDao.getQueryResultStoreDeckList();


        bool          change = false;
        DeckBuilder   deckBuilder;
        Deck          deck;
        List <string> playerStoreDecks = player.StoreDeckNameList.getList();

        foreach (StoreDeck storeDeck in storeDeckList)
        {
            if (!playerStoreDecks.Contains(storeDeck.DeckName))
            {
                if (player.IsPremium)
                {
                    deckBuilder = new DeckBuilder(storeDeck);
                    deck        = deckBuilder.getDeck();
                    player.addDeck(deck);
                    player.addToStoreDeckNameList(deck.DeckName);
                    change = true;
                }
                else
                {
                    Store.addDeck(storeDeck);
                }
            }
        }

        if (change)
        {
            playerDao.savePlayer(player);
        }
    }
예제 #2
0
    public static IEnumerator InitializeGame()
    {
        //Making query
        PlayerDao playerDao = new PlayerDao();
        StoreDeckDao storeDeckDao = new StoreDeckDao();
        MatchDao matchDao = new MatchDao();

        List<Dao> daoList = new List<Dao>() { playerDao, storeDeckDao,  matchDao };
        yield return makeQuerry(daoList);

        if (!succsesfull)
            yield break;

        //Getting results
        Player player = playerDao.getQueryResultPlayer();
        Player.setInstance(player);

        List<StoreDeck> storeDeckList = storeDeckDao.getQueryResultStoreDeckList();


        bool change = false;
        DeckBuilder deckBuilder;
        Deck deck;
        List<string> playerStoreDecks = player.StoreDeckNameList.getList();
        foreach (StoreDeck storeDeck in storeDeckList)
        {
            if (!playerStoreDecks.Contains(storeDeck.DeckName))
            {
                if (player.IsPremium)
                {
                    deckBuilder = new DeckBuilder(storeDeck);
                    deck = deckBuilder.getDeck();
                    player.addDeck(deck);
                    player.addToStoreDeckNameList(deck.DeckName);
                    change = true;
                }
                else
                {
                    Store.addDeck(storeDeck);
                }
            }
        }

        if (change)
        {
            playerDao.savePlayer(player);
        }

    }
예제 #3
0
    private IEnumerator storeDeckDaoTeste()
    {
        yield return(makeConnection());

        StoreDeckDao stDao = new StoreDeckDao();

        //yield return stDao.MakeQueryGetDeckList();

        Debug.Log("Escrevendo resultado");
        List <StoreDeck> l = stDao.getQueryResultStoreDeckList();

        foreach (StoreDeck deck in l)
        {
            Debug.Log(deck.DeckName);
        }
    }
예제 #4
0
파일: Test.cs 프로젝트: gabrielamboss/Ulkoa
    private IEnumerator storeDeckDaoTeste()
    {

        yield return makeConnection();

        StoreDeckDao stDao = new StoreDeckDao();
        //yield return stDao.MakeQueryGetDeckList();

        Debug.Log("Escrevendo resultado");
        List<StoreDeck> l = stDao.getQueryResultStoreDeckList();
        foreach(StoreDeck deck in l)
        {
            Debug.Log(deck.DeckName);
        }

    }