2023-02-14 18:09:02 +00:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Text;
|
|
|
|
|
|
|
|
|
|
namespace KartyaOszto
|
|
|
|
|
{
|
|
|
|
|
class KartyaCsomag
|
|
|
|
|
{
|
2023-02-22 18:14:07 +00:00
|
|
|
|
public Kartyalap[] lapok;
|
|
|
|
|
private int levett;
|
2023-02-14 18:09:02 +00:00
|
|
|
|
|
|
|
|
|
public KartyaCsomag()
|
|
|
|
|
{
|
|
|
|
|
//Az 52 elemű tömb létrehozása
|
|
|
|
|
lapok = new Kartyalap[52];
|
|
|
|
|
//Kártyalap objektumok elkészítése
|
|
|
|
|
string[] szinek = {"pikk","kőr","káró","treff" };
|
|
|
|
|
string[] ertekek = {"2","3","4","5","6","7","8","9","10","J","D","K","A"};
|
|
|
|
|
int laphely = 0;
|
|
|
|
|
foreach (string szin in szinek)
|
|
|
|
|
{
|
|
|
|
|
foreach (string ertek in ertekek)
|
|
|
|
|
{
|
|
|
|
|
Kartyalap lap = new Kartyalap();
|
|
|
|
|
lap.szin = szin;
|
|
|
|
|
lap.ertek = ertek;
|
|
|
|
|
lapok[laphely] = lap;
|
|
|
|
|
laphely++;
|
|
|
|
|
}
|
|
|
|
|
}
|
2023-02-22 18:14:07 +00:00
|
|
|
|
levett = 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public List<Kartyalap> levesz(int lapdb)
|
|
|
|
|
{
|
|
|
|
|
List<Kartyalap> laplista = new List<Kartyalap>();
|
|
|
|
|
for (int i = 0; i < lapdb; i++)
|
|
|
|
|
{
|
|
|
|
|
laplista.Add(lapok[levett]);
|
|
|
|
|
levett++;
|
|
|
|
|
}
|
|
|
|
|
return laplista;
|
2023-02-14 18:09:02 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|