i am busy creating a simple blackjack game in C#.
Now for my cards i want to use an Entity Class "Kaart" because when i want to create other cardgames then Blackjack i can use this again.
So my Objects would consist of : kleur (aces,spades,..) , naam (A,K,J,10,...) and bjvalue (blackjackvalue).
I use this code for this :
class Kaart
{
public Kaart()
{
}
public Kaart(string kleur, string naam, int bjwaarde)
{
this.Kleur = kleur;
this.Naam = naam;
this.Bjwaarde = bjwaarde;
}
public string Kleur { get; set; } // AutoProperty
public string Naam { get; set; } // AutoProperty
public int Bjwaarde { get; set; } // AutoProperty
Now my question is :
For use in my game i want to create an array which contains 52 items (0-51), all cards , which represent a full stack of cards. How should my method be to fill the array with all these objects .. i started like this :
public Kaart[] Vulstapel(Kaart[] Stapel) {
now the fastest way to add all these values to this array would be?
(the reason why i put them in an array is simple : because i want to be able to copy the array and than delete each card after its already thrown in game)