<?
class Match {
public $id; //unique match ID in database
public $tourney_id; //tourney's ID in database
public $p1_id; //player1's ID in database
public $p2_id; //player2's ID in database
public $status; //array with keywords: "open", "closed" and "conflict"
public $type; //1 = bo1, 3 = b03 etc.
public $score; //array with keywords: "p1" and "p2"
public $maps; //array filled with the maps
public function __construct($p1_id, $p2_id, $tourney_id, $maps, $type = 3) {
$last_id = ""; //database query which checks for the last match ID
$this->id = $last_id + 1;
$this->p1_id = $p1_id;
$this->p2_id = $p2_id;
$this->tourney_id = $tourney_id;
$this->type = $type;
for ($i = 0; $i <= $type - 1; $i++) {
$this->maps[0] = $maps[0];
else
$this->maps[0] = ""; //hier een random map kiezen uit de mappool van de tourney
}
$this->status["open"] = true;
$this->score[0] = 0;
$this->score[1] = 0;
}
}
?>