File tree 12 files changed +36
-22
lines changed
12 files changed +36
-22
lines changed Original file line number Diff line number Diff line change @@ -477,6 +477,10 @@ footer {
477
477
.codehilite .nl { color : $primary ; } // keyword label (private: etc.)
478
478
.codehilite .nt { color : $primary ; } // json key
479
479
480
+ // Hack: Pygments isn't recognizing preprocessor directives, so just color the
481
+ // error like a keyword.
482
+ .codehilite .err { color : $primary ; }
483
+
480
484
// On phone-size screens, shrink all of the text a bit.
481
485
@media only screen and (max-width : 479px ) {
482
486
.content {
Original file line number Diff line number Diff line change @@ -119,12 +119,12 @@ Now the input handling just delegates to those:
119
119
120
120
<aside name =" null " >
121
121
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
123
123
* some* command wired up to it.
124
124
125
125
If 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.
128
128
This is a pattern called [ Null
129
129
Object] ( http://en.wikipedia.org/wiki/Null_Object_pattern ) .
130
130
Original file line number Diff line number Diff line change @@ -339,7 +339,7 @@ starts making the speaker wiggle.
339
339
We want to defer that work until later so that ` playSound() ` can return quickly.
340
340
To do that, we need to * reify* the request to play a sound. We need a little
341
341
structure that stores the details of a pending request so we can keep it around
342
- until later.
342
+ until later:
343
343
344
344
^code play-message
345
345
Original file line number Diff line number Diff line change @@ -630,7 +630,7 @@ require much knowledge of the other.
630
630
631
631
## Observers Today
632
632
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,
634
634
object-oriented programming was * the* hot paradigm. Every programmer on Earth
635
635
wanted to "Learn OOP in 30 Days," and middle managers paid them based on the
636
636
number 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
78
78
wrapped_.stopAllSounds ();
79
79
}
80
80
81
-
82
81
private:
83
82
void log (const char * message)
84
83
{
Original file line number Diff line number Diff line change @@ -102,7 +102,7 @@ namespace UpdateMethod
102
102
// ^statues
103
103
}
104
104
}
105
-
105
+
106
106
namespace KeepInMind
107
107
{
108
108
struct Entity
@@ -113,7 +113,7 @@ namespace UpdateMethod
113
113
};
114
114
115
115
static const int MAX_ENTITIES = 10 ;
116
-
116
+
117
117
void refreshGame () {}
118
118
119
119
void skipAdded ()
@@ -146,7 +146,7 @@ namespace UpdateMethod
146
146
namespace SampleCode
147
147
{
148
148
static const int MAX_ENTITIES = 10 ;
149
-
149
+
150
150
// ^entity-class
151
151
class Entity
152
152
{
@@ -179,7 +179,7 @@ namespace UpdateMethod
179
179
{}
180
180
181
181
void gameLoop ();
182
-
182
+
183
183
private:
184
184
Entity* entities_[MAX_ENTITIES];
185
185
int numEntities_;
@@ -192,7 +192,7 @@ namespace UpdateMethod
192
192
while (true )
193
193
{
194
194
// Handle user input...
195
-
195
+
196
196
// Update each entity.
197
197
// ^update-component-entities
198
198
for (int i = 0 ; i < numEntities_; i++)
@@ -213,7 +213,7 @@ namespace UpdateMethod
213
213
Skeleton ()
214
214
: patrollingLeft_(false )
215
215
{}
216
-
216
+
217
217
virtual void update ()
218
218
{
219
219
if (patrollingLeft_)
@@ -247,7 +247,7 @@ namespace UpdateMethod
247
247
if (++frames_ == delay_)
248
248
{
249
249
shootLightning ();
250
-
250
+
251
251
// Reset the timer.
252
252
frames_ = 0 ;
253
253
}
@@ -256,7 +256,7 @@ namespace UpdateMethod
256
256
private:
257
257
int frames_;
258
258
int delay_;
259
-
259
+
260
260
void shootLightning ()
261
261
{
262
262
// Shoot the lightning...
@@ -310,7 +310,8 @@ namespace UpdateMethod
310
310
else
311
311
{
312
312
x += elapsed;
313
- if (x >= 100 ) {
313
+ if (x >= 100 )
314
+ {
314
315
patrollingLeft_ = true ;
315
316
x = 100 - (x - 100 );
316
317
}
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><
177
177
178
178
< aside name ="null ">
179
179
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
181
181
< em > some</ em > command wired up to it.</ p >
182
182
< 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.
185
185
This is a pattern called < a href ="http://en.wikipedia.org/wiki/Null_Object_pattern "> Null
186
186
Object</ a > .</ p >
187
187
</ 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>
338
338
< p > We want to defer that work until later so that < code > playSound()</ code > can return quickly.
339
339
To do that, we need to < em > reify</ em > the request to play a sound. We need a little
340
340
structure that stores the details of a pending request so we can keep it around
341
- until later. </ p >
341
+ until later: </ p >
342
342
< div class ="codehilite "> < pre > < span class ="k "> struct</ span > < span class ="n "> PlayMessage</ span >
343
343
< span class ="p "> {</ span >
344
344
< 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>
687
687
minimum of communication between them so that working on either one doesn’t
688
688
require much knowledge of the other.</ p >
689
689
< 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,
691
691
object-oriented programming was < em > the</ em > hot paradigm. Every programmer on Earth
692
692
wanted to “Learn OOP in 30 Days,” and middle managers paid them based on the
693
693
number 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><
368
368
< span class ="n "> wrapped_</ span > < span class ="p "> .</ span > < span class ="n "> stopAllSounds</ span > < span class ="p "> ();</ span >
369
369
< span class ="p "> }</ span >
370
370
371
-
372
371
< span class ="nl "> private:</ span >
373
372
< 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 >
374
373
< span class ="p "> {</ span >
Original file line number Diff line number Diff line change @@ -597,7 +597,8 @@ <h3><a href="#passing-time" name="passing-time">Passing time</a></h3>
597
597
< span class ="k "> else</ span >
598
598
< span class ="p "> {</ span >
599
599
< span class ="n "> x</ span > < span class ="o "> +=</ span > < span class ="n "> elapsed</ span > < span class ="p "> ;</ span >
600
- < span class ="k "> if</ span > < span class ="p "> (</ span > < span class ="n "> x</ span > < span class ="o "> >=</ span > < span class ="mi "> 100</ span > < span class ="p "> )</ span > < span class ="p "> {</ span >
600
+ < span class ="k "> if</ span > < span class ="p "> (</ span > < span class ="n "> x</ span > < span class ="o "> >=</ span > < span class ="mi "> 100</ span > < span class ="p "> )</ span >
601
+ < span class ="p "> {</ span >
601
602
< span class ="n "> patrollingLeft_</ span > < span class ="o "> =</ span > < span class ="nb "> true</ span > < span class ="p "> ;</ span >
602
603
< span class ="n "> x</ span > < span class ="o "> =</ span > < span class ="mi "> 100</ span > < span class ="o "> -</ span > < span class ="p "> (</ span > < span class ="n "> x</ span > < span class ="o "> -</ span > < span class ="mi "> 100</ span > < span class ="p "> );</ span >
603
604
< span class ="p "> }</ span >
Original file line number Diff line number Diff line change
1
+ 2014-10-08 - finish layout, proofread, re-upload to createspace for review
2
+ 2014-10-07 - layout through data locality
3
+ 2014-10-06 - layout through event queue
4
+ 2014-10-05 - layout through subclass sandbox
5
+ 2014-10-04 - layout through behavioral patterns
6
+ 2014-10-03 - layout through singleton (!)
7
+ 2014-10-02 - decimal inches page layout
8
+ 2014-10-01 - work on new page layout
9
+ 2014-09-30 - work on new page layout
10
+ 2014-09-29 - cover and other epub front matter
1
11
2014-09-28 - email
2
12
2014-09-27 - go through bugs and pull requests
3
13
2014-09-26 - finish applying proofreading, tweak other web stuff
You can’t perform that action at this time.
0 commit comments