So I have this function remoteDrawCards, which takes an array of cards that is supposed to come from a remote computer, draw the same number of cards, and if they're the same allocate those cards to the remote player. I've taken out code that doesn't pertain to my issue and left a comment in it's place:
func remoteDrawCards(player: GKPlayer, remoteCards : [Card]) {
//guard to check if the card count is the same remote and locally
remoteCards.enumerated().map({(i, card) in
// guard to check if each card is the same remote and locally
let playerStruct = players![player.playerID!]!
// give the cards to the player
})
undoHistory.append(play: Play(action: .Draw(cards: remoteCards, player: player)))
}
Anyhow, I get an error on the remoteCards variable in the undoHistory.append line of code that says:
Expression type '[Card]' is ambiguous without more context
I don't understand why swift thinks this is ambiguous, and I'm not seeing any of the other times this has been asked that it occurs when a parameter is used.