Player.java 841 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. package com.company;
  2. /**
  3. * Игрок
  4. */
  5. public class Player {
  6. public final Card[] cards = new Card[7];
  7. private String name;
  8. public int SumDenomination = 0;
  9. public Combination combination;
  10. public Player(String name) {
  11. this.name = name;
  12. this.combination = new Combination();
  13. }
  14. public void Calc() {
  15. SumDenomination = 0;
  16. for (int i = 0; i < cards.length; i++) {
  17. SumDenomination += cards[i].getDenomination();
  18. }
  19. }
  20. public String getName() {
  21. return name;
  22. }
  23. /**
  24. * Установить карту в указанный слот
  25. * @param slot
  26. * @param card
  27. */
  28. public void setCards(int slot, Card card) {
  29. cards[slot] = card;
  30. }
  31. public Card getCards(int slot) {
  32. return cards[slot];
  33. }
  34. }