public void SetDeckFolderPath(string path) { if (!path.EndsWith("/")) { path += "/"; } PackedDeck.SetDeckFolder(path); }
public void SetDeckFolderPath() { string path = input.text; if (!path.EndsWith("/")) { path += "/"; } PackedDeck.SetDeckFolder(path); }
public override void ExecuteAiCommand(AiPlayer aiPlayer, ClientConnectionManager aiConnection) { // @TODO: AI implementation // Sending the same deck that the player loaded for now string deckFileName = m_visualManager.GetDeckFileName(); PackedDeck deck = new PackedDeck(); deck.LoadFromJSON(PackedDeck.deckPath + deckFileName); SGC_SendDeck command = new SGC_SendDeck(deck); m_visualManager.TransmitStream(command.PackCommand()); }
public void AssignDeck(PackedDeck deck, int playerID) { m_players[playerID].AssignDeck(deck); if (m_players[0].m_hasDeck && m_players[1].m_hasDeck) { // Both players have decks - start the game! if (m_turnState == CGTurnState.WAITING_FOR_PLAYER_DECKS) { m_turnState = CGTurnState.DEFAULT; RunGameLogic(); } } }
public override void ExecuteCommand() { // @TODO: Open deck picker interface // For now, send the deck that was picked in the connect menu string deckFileName = m_visualManager.GetDeckFileName(); PackedDeck deck = new PackedDeck(); deck.LoadFromJSON(PackedDeck.deckPath + deckFileName); SGC_SendDeck command = new SGC_SendDeck(deck); m_visualManager.TransmitStream(command.PackCommand()); FinishCommand(); }
public void AssignDeck(PackedDeck packedDeck) { // TODO: A CardProvider class to load and cache CardData instead of loading here every time. // That way it can correctly sort into IDs instead of sorting by whatever order they load in. // Load all the cards (eyeroll) List <CardData> cards = new List <CardData>(); string[] fileList = Directory.GetFiles(CardData.cardJSONPath, "*.json"); foreach (string path in fileList) { cards.Add(CardData.LoadCardData(path)); } // Build the deck from the card IDs in the PackedDeck CardData[] deck = new CardData[30]; for (int i = 0; i < packedDeck.cardIDs.Count; ++i) { deck[i] = cards[packedDeck.cardIDs[i]]; } m_deck.Populate(deck); m_hasDeck = true; }
public SGC_SendDeck(PackedDeck deck) { m_deck = deck; }