I think uploading packs is more or less working. I nutted out a few bugs in a lot...
[rock.divinelegy.git] / Domain / Entities / StepMania / SimfileStepByStepBuilder.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\StepMania\ISimfileBuilder;
8 use Domain\Entities\IUser;
9 use Domain\Entities\IFile;
10
11 interface ISimfileStepByStepBuilder
12 {
13 public function With_Title($title);
14 }
15
16 interface ISimfileStepByStepBuilder_With_Title
17 {
18 public function With_Artist(IArtist $artist);
19 }
20
21 interface ISimfileStepByStepBuilder_With_Artist
22 {
23 public function With_Uploader(IUser $uploader);
24 }
25
26 interface ISimfileStepByStepBuilder_With_Uploader
27 {
28 public function With_BPM(IBPM $bpm);
29 }
30
31 interface ISimfileStepByStepBuilder_With_BPM
32 {
33 public function With_BpmChanges($const);
34 }
35
36 interface ISimfileStepByStepBuilder_With_BpmChanges
37 {
38 public function With_Stops($const);
39 }
40
41 interface ISimfileStepByStepBuilder_With_Stops
42 {
43 public function With_FgChanges($const);
44 }
45
46 interface ISimfileStepByStepBuilder_With_FgChanges
47 {
48 public function With_BgChanges($const);
49 }
50
51 interface ISimfileStepByStepBuilder_With_BgChanges
52 {
53 public function With_Steps(array $steps);
54 }
55
56 interface ISimfileStepByStepBuilder_With_Steps
57 {
58 public function With_Banner(IFile $banner = null);
59 public function With_Simfile(IFile $simfile = null);
60 public function With_PackId($packId = null);
61 public function build();
62 }
63
64
65 abstract class AbstractSimfileStepByStepBuilder
66 {
67 /* @var $_simfileBuilder Domain\Entities\StepMania\ISimfileBuilder */
68 protected $_simfileBuilder;
69
70 public function __construct(ISimfileBuilder $builder)
71 {
72 $this->_simfileBuilder = $builder;
73 }
74 }
75
76
77 class SimfileStepByStepBuilder extends AbstractSimfileStepByStepBuilder implements ISimfileStepByStepBuilder
78 {
79 public function With_Title($title)
80 {
81 $this->_simfileBuilder->With_Title($title);
82 return new SimfileStepByStepBuilder_With_Title($this->_simfileBuilder);
83 }
84 }
85
86 class SimfileStepByStepBuilder_With_Title extends AbstractSimfileStepByStepBuilder implements ISimfileStepByStepBuilder_With_Title
87 {
88 public function With_Artist(IArtist $artist)
89 {
90 $this->_simfileBuilder->With_Artist($artist);
91 return new SimfileStepByStepBuilder_With_Artist($this->_simfileBuilder);
92 }
93 }
94
95 class SimfileStepByStepBuilder_With_Artist extends AbstractSimfileStepByStepBuilder implements ISimfileStepByStepBuilder_With_Artist
96 {
97 public function With_Uploader(IUser $uploader)
98 {
99 $this->_simfileBuilder->With_Uploader($uploader);
100 return new SimfileStepByStepBuilder_With_Uploader($this->_simfileBuilder);
101 }
102 }
103
104 class SimfileStepByStepBuilder_With_Uploader extends AbstractSimfileStepByStepBuilder implements ISimfileStepByStepBuilder_With_Uploader
105 {
106 public function With_BPM(IBPM $bpm)
107 {
108 $this->_simfileBuilder->With_BPM($bpm);
109 return new SimfileStepByStepBuilder_With_BPM($this->_simfileBuilder);
110 }
111 }
112
113 class SimfileStepByStepBuilder_With_BPM extends AbstractSimfileStepByStepBuilder implements ISimfileStepByStepBuilder_With_BPM
114 {
115 public function With_BpmChanges($const)
116 {
117 $this->_simfileBuilder->With_BpmChanges($const);
118 return new SimfileStepByStepBuilder_With_BpmChanges($this->_simfileBuilder);
119 }
120 }
121
122 class SimfileStepByStepBuilder_With_BpmChanges extends AbstractSimfileStepByStepBuilder implements ISimfileStepByStepBuilder_With_BpmChanges
123 {
124 public function With_Stops($const) {
125 $this->_simfileBuilder->With_Stops($const);
126 return new SimfileStepByStepBuilder_With_Stops($this->_simfileBuilder);
127 }
128 }
129
130 class SimfileStepByStepBuilder_With_Stops extends AbstractSimfileStepByStepBuilder implements ISimfileStepByStepBuilder_With_Stops
131 {
132 public function With_FgChanges($const)
133 {
134 $this->_simfileBuilder->With_FgChanges($const);
135 return new SimfileStepByStepBuilder_With_FgChanges($this->_simfileBuilder);
136 }
137 }
138
139 class SimfileStepByStepBuilder_With_FgChanges extends AbstractSimfileStepByStepBuilder implements ISimfileStepByStepBuilder_With_FgChanges
140 {
141 public function With_BgChanges($const)
142 {
143 $this->_simfileBuilder->With_BgChanges($const);
144 return new SimfileStepByStepBuilder_With_BgChanges($this->_simfileBuilder);
145 }
146 }
147
148 class SimfileStepByStepBuilder_With_BgChanges extends AbstractSimfileStepByStepBuilder implements ISimfileStepByStepBuilder_With_BgChanges
149 {
150 public function With_Steps(array $steps)
151 {
152 $this->_simfileBuilder->With_Steps($steps);
153 return new SimfileStepByStepBuilder_With_Steps($this->_simfileBuilder);
154 }
155 }
156
157 class SimfileStepByStepBuilder_With_Steps extends AbstractSimfileStepByStepBuilder implements ISimfileStepByStepBuilder_With_Steps
158 {
159 public function With_Banner(IFile $banner = null)
160 {
161 $this->_simfileBuilder->With_Banner($banner);
162 return new SimfileStepByStepBuilder_With_Steps($this->_simfileBuilder); //TODO: Pretty sure return $this will be OK
163 }
164
165 public function With_Simfile(IFile $simfile = null)
166 {
167 $this->_simfileBuilder->With_Simfile($simfile);
168 return new SimfileStepByStepBuilder_With_Steps($this->_simfileBuilder);
169 }
170
171 public function With_PackId($packId = null)
172 {
173 $this->_simfileBuilder->With_PackId($packId);
174 return new SimfileStepByStepBuilder_With_Steps($this->_simfileBuilder);
175 }
176
177 public function build()
178 {
179 return $this->_simfileBuilder
180 ->build();
181 }
182 }