I'm creating a card game based on a Client Server communication, where the server (TV) shuffles and deals cards to players - clients (Android phones).
I'm struggling with exactly how to set the source image for my cards, client-side.
As the client I'm receiving the cards in a string array (eg. [C1,C2,C3,C4,C5]), note that in resources the image files are named exactly as they appear in that string (C = Clubs, D = Diamonds .. from 1 to 13). how should I do this ? I want to use the String Array in such a way that I can extract a single string and by using know which of the images I need to set as a source.
P.S I know I can use a switch with 52 cases for each source, but I'm sure there's a better way of doing things.
CardHelper.getCardFromString('...')would return an instance of aCard. OOP possibilities are endless and that's the fun part :)