30.06.2013 Aufrufe

Softwareentwicklung in C++ - ASC

Softwareentwicklung in C++ - ASC

Softwareentwicklung in C++ - ASC

MEHR ANZEIGEN
WENIGER ANZEIGEN

Sie wollen auch ein ePaper? Erhöhen Sie die Reichweite Ihrer Titel.

YUMPU macht aus Druck-PDFs automatisch weboptimierte ePaper, die Google liebt.

57 }<br />

B.1 Implementationen der e<strong>in</strong>zelnen Klassen 547<br />

B.1.4 Implementation von SimpleOutputHandl<strong>in</strong>g<br />

1 // simple output handl<strong>in</strong>g . cpp − implementation o f the<br />

2 // simple output handl<strong>in</strong>g c l a s s<br />

3<br />

4 #<strong>in</strong>clude <br />

5<br />

6 #<strong>in</strong>clude ” simple output handl<strong>in</strong>g . h”<br />

7<br />

8 us<strong>in</strong>g std : : cout ;<br />

9<br />

10 //−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−<br />

11 void SimpleOutputHandl<strong>in</strong>g : : addDisplayable (<br />

12 Displayable & d i s p l a y a b l e )<br />

13 {<br />

14 i f ( ( num displayables >= d i s p l a y a b l e s . getMaxNumElements ( ) ) )<br />

15 return ;<br />

16 d i s p l a y a b l e s . setElementAt ( num displayables ++,&d i s p l a y a b l e ) ;<br />

17 d i s p l a y a b l e . d i s p l a y a b l e R e g i s t e r e d (∗ this ) ;<br />

18 }<br />

19<br />

20 //−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−<br />

21 void SimpleOutputHandl<strong>in</strong>g : : writeOutput ( )<br />

22 {<br />

23 for ( u<strong>in</strong>t32 current = 0 ; current < num displayables ;<br />

24 current++)<br />

25 {<br />

26 static cast(<br />

27 d i s p l a y a b l e s . getElementAt ( current))−><br />

28 writeDisplayRep ( output context ) ;<br />

29 }<br />

30 }<br />

B.1.5 Implementation von GameCard<br />

1 // game card v3 . cpp − implementation o f GameCard<br />

2<br />

3 #<strong>in</strong>clude ”game card v3 . h”<br />

4<br />

5 const u<strong>in</strong>t8 GameCard : : FRONT SIDE;<br />

6 const u<strong>in</strong>t8 GameCard : : BACK SIDE;<br />

B.1.6 Implementation von MemoryGameCard<br />

1 // memory game card v5 . cpp − implementation o f MemoryGameCard<br />

2<br />

3 #<strong>in</strong>clude < c s t r i n g><br />

4 #<strong>in</strong>clude <br />

5<br />

6 #<strong>in</strong>clude ”memory game card v5 . h”<br />

7<br />

8 //−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−<br />

9 /∗

Hurra! Ihre Datei wurde hochgeladen und ist bereit für die Veröffentlichung.

Erfolgreich gespeichert!

Leider ist etwas schief gelaufen!