c# - How to make a card deck in XNA -


i want make game card game , thinking make cards int can make game rules if ifelse , else condition's don't know how take int , put texture , rectangle together. make research , people make card deck array. i'm asking best way , if give me code example i'm beginner in xna?

i start thinking if way make cards number int don't know if gonna work this.

int card0 =1; int card1 =2; int card3 =3; int card4 =4; int card5 =5; int card6 =6; int card7 =7; int card8 =8; int card9 =9; int card10 =10; int card11 =11; int card12 =12;  ///class passplayerturn passturn; unloadcard unloadcard; 

if can can put rule this.

if(card4 >= 4)    passturn; else    unloadcard; 

but don't know how put texture made in in variable. seen people in java language use array make deck don't know how array works. searched tutorials of array cant understand it.

if i'd make card class

public class card {     int number;     int suit;  // or better yet, enum of sort     texture2d sprite;     ... } 

and deck collection of cards

public class deck {     list<card> cards;     ... } 

Comments

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -