Skip to content

Commit

Permalink
add - doc - Card generator now can be limited
Browse files Browse the repository at this point in the history
---

We've added two extra parameters that allow you to generate a specified number of cards.

---

Type: add
Breaking: False
Doc Required: True
Backport Required: False
Part: 1/1
  • Loading branch information
AptiviCEO committed Oct 3, 2024
1 parent 3475617 commit 3bd824c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions VisualCard.Extras/Misc/CardGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,12 @@ public static class CardGenerator
/// <param name="surnamePrefix">Prefix of the last name</param>
/// <param name="surnameSuffix">Suffix of the last name</param>
/// <param name="nameGender">Name gender type</param>
/// <param name="min">Minimum number of cards</param>
/// <param name="max">Maximum number of cards</param>
/// <returns>A list of generated cards (by default, it generates up to 100 cards.)</returns>
public static Card[] GenerateCards(string namePrefix = "", string nameSuffix = "", string surnamePrefix = "", string surnameSuffix = "", NameGenderType nameGender = NameGenderType.Unified)
public static Card[] GenerateCards(string namePrefix = "", string nameSuffix = "", string surnamePrefix = "", string surnameSuffix = "", NameGenderType nameGender = NameGenderType.Unified, int min = 1, int max = 100)
{
int cardNumbers = rng.Next(1, 101);
int cardNumbers = rng.Next(min, max + 1);
return GenerateCards(cardNumbers, namePrefix, nameSuffix, surnamePrefix, surnameSuffix, nameGender);
}

Expand Down

0 comments on commit 3bd824c

Please sign in to comment.