42 lines
1.0 KiB
Java
Raw Normal View History

package Match;
import input.InputBuffer;
2021-05-27 01:17:41 +02:00
import Entities.*;
/**
* Main class that describes the base structure of the match, with characters, timer and such
* @author Victor Azra
*
*/
public class match {
/**
* the number of inputs read for each character, a.k.a. for how many frames the inputs are saved in memory.
*/
private static final int inputBufferSize = 120;
private int timer;
private InputBuffer inputsP1, inputsP2;
private int hpP1, hpP2;
private int roundsWonP1, roundsWonP2;
2021-05-27 01:17:41 +02:00
private Entities.Character p1, p2; //characters of player 1 and 2
2021-05-27 00:54:28 +02:00
/**
2021-05-27 01:17:41 +02:00
* base constructor of the match class.
* Initiates a new match with with two given characters
2021-05-27 00:54:28 +02:00
*/
2021-05-27 01:17:41 +02:00
public match(Entities.Character p1, Entities.Character p2) {
this.timer = 99;
this.inputsP1 = new input.InputBuffer(inputBufferSize);
this.inputsP2 = new input.InputBuffer(inputBufferSize);
2021-05-27 01:17:41 +02:00
this.p1 = p1;
this.p2 = p2;
this.hpP1 = p1.getMaxHP();
this.hpP2 = p2.getMaxHP();
this.roundsWonP1 = 0;
this.roundsWonP2 = 0;
}
}