File tree Expand file tree Collapse file tree 12 files changed +36
-22
lines changed Expand file tree Collapse file tree 12 files changed +36
-22
lines changed Original file line number Diff line number Diff line change @@ -477,6 +477,10 @@ footer {
477477.codehilite .nl { color : $primary ; } // keyword label (private: etc.)
478478.codehilite .nt { color : $primary ; } // json key
479479
480+ // Hack: Pygments isn't recognizing preprocessor directives, so just color the
481+ // error like a keyword.
482+ .codehilite .err { color : $primary ; }
483+
480484// On phone-size screens, shrink all of the text a bit.
481485@media only screen and (max-width : 479px ) {
482486 .content {
Original file line number Diff line number Diff line change @@ -119,12 +119,12 @@ Now the input handling just delegates to those:
119119
120120<aside name =" null " >
121121
122- Notice how we don't check for ` null ` here? This assumes each button will have
122+ Notice how we don't check for ` NULL ` here? This assumes each button will have
123123* some* command wired up to it.
124124
125125If we want to support buttons that do nothing without having to explicitly check
126- for ` null ` , we can define a command class whose ` execute() ` method does nothing.
127- Then, instead of setting a button handler to ` null ` , we point it to that object.
126+ for ` NULL ` , we can define a command class whose ` execute() ` method does nothing.
127+ Then, instead of setting a button handler to ` NULL ` , we point it to that object.
128128This is a pattern called [ Null
129129Object] ( http://en.wikipedia.org/wiki/Null_Object_pattern ) .
130130
Original file line number Diff line number Diff line change @@ -339,7 +339,7 @@ starts making the speaker wiggle.
339339We want to defer that work until later so that ` playSound() ` can return quickly.
340340To do that, we need to * reify* the request to play a sound. We need a little
341341structure that stores the details of a pending request so we can keep it around
342- until later.
342+ until later:
343343
344344^code play-message
345345
Original file line number Diff line number Diff line change @@ -630,7 +630,7 @@ require much knowledge of the other.
630630
631631## Observers Today
632632
633- * Design Patterns* came out in the <span name =" 90s " >90s </span >. Back then,
633+ * Design Patterns* came out in <span name =" 90s " >1994 </span >. Back then,
634634object-oriented programming was * the* hot paradigm. Every programmer on Earth
635635wanted to "Learn OOP in 30 Days," and middle managers paid them based on the
636636number of classes they created. Engineers judged their mettle by the depth of
Original file line number Diff line number Diff line change @@ -78,7 +78,6 @@ class LoggedAudio : public Audio
7878 wrapped_.stopAllSounds ();
7979 }
8080
81-
8281private:
8382 void log (const char * message)
8483 {
Original file line number Diff line number Diff line change @@ -102,7 +102,7 @@ namespace UpdateMethod
102102 // ^statues
103103 }
104104 }
105-
105+
106106 namespace KeepInMind
107107 {
108108 struct Entity
@@ -113,7 +113,7 @@ namespace UpdateMethod
113113 };
114114
115115 static const int MAX_ENTITIES = 10 ;
116-
116+
117117 void refreshGame () {}
118118
119119 void skipAdded ()
@@ -146,7 +146,7 @@ namespace UpdateMethod
146146 namespace SampleCode
147147 {
148148 static const int MAX_ENTITIES = 10 ;
149-
149+
150150 // ^entity-class
151151 class Entity
152152 {
@@ -179,7 +179,7 @@ namespace UpdateMethod
179179 {}
180180
181181 void gameLoop ();
182-
182+
183183 private:
184184 Entity* entities_[MAX_ENTITIES];
185185 int numEntities_;
@@ -192,7 +192,7 @@ namespace UpdateMethod
192192 while (true )
193193 {
194194 // Handle user input...
195-
195+
196196 // Update each entity.
197197 // ^update-component-entities
198198 for (int i = 0 ; i < numEntities_; i++)
@@ -213,7 +213,7 @@ namespace UpdateMethod
213213 Skeleton ()
214214 : patrollingLeft_(false )
215215 {}
216-
216+
217217 virtual void update ()
218218 {
219219 if (patrollingLeft_)
@@ -247,7 +247,7 @@ namespace UpdateMethod
247247 if (++frames_ == delay_)
248248 {
249249 shootLightning ();
250-
250+
251251 // Reset the timer.
252252 frames_ = 0 ;
253253 }
@@ -256,7 +256,7 @@ namespace UpdateMethod
256256 private:
257257 int frames_;
258258 int delay_;
259-
259+
260260 void shootLightning ()
261261 {
262262 // Shoot the lightning...
@@ -310,7 +310,8 @@ namespace UpdateMethod
310310 else
311311 {
312312 x += elapsed;
313- if (x >= 100 ) {
313+ if (x >= 100 )
314+ {
314315 patrollingLeft_ = true ;
315316 x = 100 - (x - 100 );
316317 }
Original file line number Diff line number Diff line change @@ -177,11 +177,11 @@ <h2><a href="#configuring-input" name="configuring-input">Configuring Input</a><
177177
178178< aside name ="null ">
179179
180- < p > Notice how we don’t check for < code > null </ code > here? This assumes each button will have
180+ < p > Notice how we don’t check for < code > NULL </ code > here? This assumes each button will have
181181< em > some</ em > command wired up to it.</ p >
182182< p > If we want to support buttons that do nothing without having to explicitly check
183- for < code > null </ code > , we can define a command class whose < code > execute()</ code > method does nothing.
184- Then, instead of setting a button handler to < code > null </ code > , we point it to that object.
183+ for < code > NULL </ code > , we can define a command class whose < code > execute()</ code > method does nothing.
184+ Then, instead of setting a button handler to < code > NULL </ code > , we point it to that object.
185185This is a pattern called < a href ="http://en.wikipedia.org/wiki/Null_Object_pattern "> Null
186186Object</ a > .</ p >
187187</ aside >
Original file line number Diff line number Diff line change @@ -338,7 +338,7 @@ <h2><a href="#sample-code" name="sample-code">Sample Code</a></h2>
338338< p > We want to defer that work until later so that < code > playSound()</ code > can return quickly.
339339To do that, we need to < em > reify</ em > the request to play a sound. We need a little
340340structure that stores the details of a pending request so we can keep it around
341- until later. </ p >
341+ until later: </ p >
342342< div class ="codehilite "> < pre > < span class ="k "> struct</ span > < span class ="n "> PlayMessage</ span >
343343< span class ="p "> {</ span >
344344 < span class ="n "> SoundId</ span > < span class ="n "> id</ span > < span class ="p "> ;</ span >
Original file line number Diff line number Diff line change @@ -687,7 +687,7 @@ <h3><a href="#what's-going-on" name="what's-going-on">What’s going on?</a>
687687minimum of communication between them so that working on either one doesn’t
688688require much knowledge of the other.</ p >
689689< h2 > < a href ="#observers-today " name ="observers-today "> Observers Today</ a > </ h2 >
690- < p > < em > Design Patterns</ em > came out in the < span name ="90s "> 90s </ span > . Back then,
690+ < p > < em > Design Patterns</ em > came out in < span name ="90s "> 1994 </ span > . Back then,
691691object-oriented programming was < em > the</ em > hot paradigm. Every programmer on Earth
692692wanted to “Learn OOP in 30 Days,” and middle managers paid them based on the
693693number of classes they created. Engineers judged their mettle by the depth of
Original file line number Diff line number Diff line change @@ -368,7 +368,6 @@ <h3><a href="#logging-decorator" name="logging-decorator">Logging decorator</a><
368368 < span class ="n "> wrapped_</ span > < span class ="p "> .</ span > < span class ="n "> stopAllSounds</ span > < span class ="p "> ();</ span >
369369 < span class ="p "> }</ span >
370370
371-
372371< span class ="nl "> private:</ span >
373372 < span class ="kt "> void</ span > < span class ="n "> log</ span > < span class ="p "> (</ span > < span class ="k "> const</ span > < span class ="kt "> char</ span > < span class ="o "> *</ span > < span class ="n "> message</ span > < span class ="p "> )</ span >
374373 < span class ="p "> {</ span >
You can’t perform that action at this time.
0 commit comments