Advertisement
ewalkowka

fsdfs

Mar 31st, 2023
874
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.80 KB | None | 0 0
  1. public class GeneratorPostaci
  2. {
  3. private Random LiczbyLosowe;
  4. private List<string> Imiona;
  5. public GeneratorPostaci()
  6.  
  7. {
  8. LiczbyLosowe = new Random();
  9. Imiona = new List<string>();
  10. Imiona.Add("Vladimir");
  11. Imiona.Add("Nieznajomy");
  12. Imiona.Add("Max");
  13. Imiona.Add("Veigar");
  14. Imiona.Add("Gerard");
  15. }
  16. public Mag GenerujMaga()
  17. {
  18. int hp = LiczbyLosowe.Next(150, 300);
  19. int atak = LiczbyLosowe.Next(5, 15);
  20. string imie = Imiona[LiczbyLosowe.Next(0, Imiona.Count)];
  21. Imiona.Remove(imie);
  22. Mag mag = new Mag(imie, hp, atak, 10);
  23. return mag;
  24. }
  25. public Wojownik GenerujWojownika()
  26. {
  27. int hp = LiczbyLosowe.Next(150, 300);
  28. int atak = LiczbyLosowe.Next(5, 15);
  29. string imie = Imiona[LiczbyLosowe.Next(0, Imiona.Count)];
  30. Imiona.Remove(imie);
  31. Wojownik wojownik = new Wojownik(imie, hp, atak, 5);
  32. return wojownik;
  33. }
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement