Pack entity builder stuff. Not tested yet.
[rock.divinelegy.git] / Domain / Entities / StepMania / SimfileBuilder.php
1 <?php
2
3 namespace Domain\Entities\StepMania;
4
5 use Domain\VOs\StepMania\IArtist;
6 use Domain\VOs\StepMania\IBPM;
7 use Domain\Entities\IUser;
8 use Domain\Entities\IFile;
9 use Domain\Entities\StepMania\ISimfileFactory;
10 use Domain\Entities\StepMania\ISimfileBuilder;
11
12 class SimfileBuilder implements ISimfileBuilder
13 {
14 private $_simfileFactory;
15 private $_title;
16 private $_artist;
17 private $_uploader;
18 private $_bpm;
19 private $_bpmChanges;
20 private $_stops;
21 private $_fgChanges;
22 private $_bgChanges;
23 private $_banner;
24 private $_simfile;
25 private $_steps;
26
27 //override parent
28 public function __construct(ISimfileFactory $simfileFactory) {
29 $this->_simfileFactory = $simfileFactory;
30 }
31
32 public function With_Title($title)
33 {
34 $this->_title = $title;
35 return $this;
36 }
37
38 public function With_Artist(IArtist $artist) {
39 $this->_artist = $artist;
40 return $this;
41 }
42
43 public function With_Uploader(IUser $uploader) {
44 $this->_uploader = $uploader;
45 return $this;
46 }
47
48 public function With_BPM(IBPM $bpm) {
49 $this->_bpm = $bpm;
50 return $this;
51 }
52
53 public function With_BpmChanges($const) {
54 $this->_bpmChanges = $const;
55 return $this;
56 }
57
58 public function With_Stops($const) {
59 $this->_stops = $const;
60 return $this;
61 }
62
63 public function With_FgChanges($const) {
64 $this->_fgChanges = $const;
65 return $this;
66 }
67
68 public function With_BgChanges($const) {
69 $this->_bgChanges = $const;
70 return $this;
71 }
72
73 public function With_Banner(IFile $banner) {
74 $this->_banner = $banner;
75 return $this;
76 }
77
78 public function With_Simfile(IFile $simfile) {
79 $this->_simfile = $simfile;
80 return $this;
81 }
82
83 public function With_Steps(array $steps) {
84 $this->_steps = $steps;
85 return $this;
86 }
87
88 public function build() {
89 return $this->_simfileFactory
90 ->createInstance($this->_title,
91 $this->_artist,
92 $this->_uploader,
93 $this->_bpm,
94 $this->_bpmChanges,
95 $this->_stops,
96 $this->_fgChanges,
97 $this->_bgChanges,
98 $this->_banner,
99 $this->_simfile,
100 $this->_steps);
101 }
102 }
103