The Code-Bin
Links
Home
Add your code!
All Listings
About
Latest Entry
Featured Scripts
Author's Website
Latest Entries
FFMPEG Thumbnail Scr...
PHP, 0.8KB
Jul. 29, 10:24pm
John
Z80 Assembler, 190 bytes
Feb. 17, 3:36am
John
Z80 Assembler, 176 bytes
Sep. 13, 2:19am
John
Z80 Assembler, 77 bytes
Sep. 13, 2:18am
John
Z80 Assembler, 209 bytes
Sep. 13, 2:17am
untitled PHP Code
Posted by: match object | April 10, 2011 @ 8:17am
PHP Code
[
Download
]
<? 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++) { if(isset($maps[0])) $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; } } ?>
Syntax Highlighting
[
Open in new window
]
Author Comments
none
Rating
4.51 / 8
201 Votes
http://codebin.yi.org/1214
page generated in 0.01 seconds