Class Match

java.lang.Object
rs.ac.bg.etf.engine.Match

public class Match
extends java.lang.Object
Class representing a single match between two players.
Author:
Vladimir, Adrian
  • Constructor Summary

    Constructors 
    Constructor Description
    Match​(int roundsCount, Player player1, Player player2, int errorRate)  
  • Method Summary

    Modifier and Type Method Description
    int[] playMatch()
    Simulation of a single match between two players.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Match

      public Match​(int roundsCount, Player player1, Player player2, int errorRate)
      Parameters:
      roundsCount - number of rounds in a single match
      player1 - player one
      player2 - player two
      errorRate - [0-100] chance of a player making a mistake
  • Method Details

    • playMatch

      public int[] playMatch()
      Simulation of a single match between two players.
      Returns:
      returns a 2-element 1d-array of players' gains