c54efe173b150def08fbab29b4a44e4a582121ad
[rock.divinelegy.git] / Domain / VOs / StepMania / DanceMode.php
1 <?php
2
3 namespace Domain\VOs\StepMania;
4
5 use Domain\Exception\InvalidDanceModeException;
6
7 class DanceMode implements IDanceMode
8 {
9 protected $stepManiaName;
10 protected $prettyName;
11
12 private $_nameMap = array(
13 'dance-single' => 'Single',
14 'dance-double' => 'Double'
15 );
16
17 public function __construct($stepManiaName)
18 {
19 if(array_key_exists($stepManiaName, $this->_nameMap)) {
20 $this->stepManiaName = $stepManiaName;
21 $this->prettyName = $this->_nameMap[$stepManiaName];
22 } else {
23 throw new InvalidDanceModeException(sprintf('Invalid dance mode %s', $stepManiaName));
24 }
25 }
26
27 public function getStepManiaName() {
28 return $this->stepManiaName;
29 }
30
31 public function getPrettyName() {
32 return $this->prettyName;
33 }
34 }