-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPlayerAbstract.php
More file actions
52 lines (40 loc) · 898 Bytes
/
Copy pathPlayerAbstract.php
File metadata and controls
52 lines (40 loc) · 898 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<?php
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
/**
* Description of PlayerAbstract
*
* @author texai
*/
abstract class PlayerAbstract {
public $name;
/**
*
* @var Deck
*/
protected $_deck;
/**
*
* @var Cluedo
*/
protected $_cluedo;
public function __construct($name) {
$this->name = $name;
$this->_deck = new Deck();
}
public function setCluedo(Cluedo $cluedo){
$this->_cluedo = $cluedo;
}
public function dealCard(Card $card){
$this->_deck->addCard($card);
}
public function __toString() {
$t = " Player Name: ". $this->name . PHP_EOL;
$t .= " Deck: ". PHP_EOL;
$t .= $this->_deck;
return $t;
}
public abstract function play();
}