public void makeColoredFigureType1() { var rand = new Random(); //ColoredFigure1 int randInt = rand.Next(0, 5); Color col1 = (Color)randInt; Figure fig1 = (Figure)randInt; ColoredFigure colFig1 = new ColoredFigure(col1, fig1); //ColoredFigure2 int randFig; int randCol; while (true) { randFig = rand.Next(0, 5); if (randFig != randInt) { break; } } while (true) { randCol = rand.Next(0, 5); if (randCol != randInt && randCol!= randFig) { break; } } Color col2 = (Color)randCol; Figure fig2 = (Figure)randFig; ColoredFigure colFig2 = new ColoredFigure(col2, fig2); deck.Add(new Card(colFig1, colFig2,0)); }
public int type; //0 OR 1 public Card(ColoredFigure x, ColoredFigure y, int i) { ColFig1 = x; ColFig2 = y; type = i; }