I think uploading packs is more or less working. I nutted out a few bugs in a lot...
[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 $_packId;
26 private $_steps;
27
28 //override parent
29 public function __construct(ISimfileFactory $simfileFactory) {
30 $this->_simfileFactory = $simfileFactory;
31 }
32
33 public function With_Title($title)
34 {
35 $this->_title = $title;
36 return $this;
37 }
38
39 public function With_Artist(IArtist $artist) {
40 $this->_artist = $artist;
41 return $this;
42 }
43
44 public function With_Uploader(IUser $uploader) {
45 $this->_uploader = $uploader;
46 return $this;
47 }
48
49 public function With_BPM(IBPM $bpm) {
50 $this->_bpm = $bpm;
51 return $this;
52 }
53
54 public function With_BpmChanges($const) {
55 $this->_bpmChanges = $const;
56 return $this;
57 }
58
59 public function With_Stops($const) {
60 $this->_stops = $const;
61 return $this;
62 }
63
64 public function With_FgChanges($const) {
65 $this->_fgChanges = $const;
66 return $this;
67 }
68
69 public function With_BgChanges($const) {
70 $this->_bgChanges = $const;
71 return $this;
72 }
73
74 public function With_Banner(IFile $banner = null) {
75 $this->_banner = $banner;
76 return $this;
77 }
78
79 public function With_Simfile(IFile $simfile = null) {
80 $this->_simfile = $simfile;
81 return $this;
82 }
83
84 public function With_PackId($packId = null)
85 {
86 $this->_packId = $packId;
87 return $this;
88 }
89
90 public function With_Steps(array $steps) {
91 $this->_steps = $steps;
92 return $this;
93 }
94
95 public function build() {
96 return $this->_simfileFactory
97 ->createInstance($this->_title,
98 $this->_artist,
99 $this->_uploader,
100 $this->_bpm,
101 $this->_bpmChanges,
102 $this->_stops,
103 $this->_fgChanges,
104 $this->_bgChanges,
105 $this->_banner,
106 $this->_simfile,
107 $this->_packId,
108 $this->_steps);
109 }
110 }
111