Ejemplo n.º 1
0
	/// <summary>
	/// get the deck path
	/// enemy decks are stored in the resource folder so they are added to build
	/// </summary>
	/// <returns></returns>
	private string getDeckPath() {
		if(playerDeck) {
			return SaveAndLoadJson.getBaseFilePath(Deck.playerDecks);
		} else {
			return SaveAndLoadJson.getResourcePath(Deck.baddyDecks,"");
		}
	}
Ejemplo n.º 2
0
    private bool loadDeckFromMemory(string deckName)
    {
        JsonDeck deck;
        bool     loadSuccess = false;

        if (playerDeck)
        {
            loadSuccess = SaveAndLoadJson.loadStruct(SaveAndLoadJson.getBaseFilePath(playerDecks, deckName), out deck);
        }
        else
        {
            loadSuccess = SaveAndLoadJson.loadStruct(SaveAndLoadJson.getResourcePath(baddyDecks, deckName), out deck);
        }
        if (!loadSuccess)
        {
            if (!SaveAndLoadJson.loadStruct(SaveAndLoadJson.getResourcePath(baddyDecks, "errorDeck"), out deck))
            {
                return(false);
            }
        }
        //get card class types from names
        Type[] cardClasses = new Type[deck.cardTypeName.Length];
        for (int i = 0; i < deck.cardTypeName.Length; i++)
        {
            cardClasses[i] = Type.GetType(deck.cardTypeName[i]);
        }

        addCardsToDeck(cardClasses);


        return(loadSuccess);
    }
Ejemplo n.º 3
0
 //TODO abstract which type is loaded at start
 public void loadDeckType(Toggle deckType)
 {
     if (deckType.isOn)
     {
         loadDeckFolder(SaveAndLoadJson.getBaseFilePath(Deck.playerDecks));
     }
     else
     {
         loadDeckFolder(SaveAndLoadJson.getResourcePath(Deck.baddyDecks));
     }
 }
Ejemplo n.º 4
0
 // Use this for initialization
 void Start()
 {
     loadDeckFolder(SaveAndLoadJson.getBaseFilePath(Deck.playerDecks));
 }
Ejemplo n.º 5
0
 private string soundFilePath()
 {
     return(SaveAndLoadJson.getBaseFilePath() + folderName + "/" + fileName);
 }