Skip to content

Commit 4b7dc60

Browse files
committed
Type Object fixes
When I did my "git pull upstream master", these two changes to Type Object were not included for some reason, so I am committing them so that my files match up with the current versions.
1 parent eff99db commit 4b7dc60

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

book/type-object.markdown

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ from".
127127
Each instance of a monster in the game will be of one of the derived monster
128128
types. The more breeds we have, the bigger the class hierarchy. That's the
129129
problem of course: adding new breeds means adding new code, and each breed has
130-
to be compiled as its own type.
130+
to be compiled in as its own type.
131131

132132
This works, but it isn't the only option. We could also architect our code so
133133
that each monster *has* a breed. Instead of subclassing `Monster` for each
@@ -305,7 +305,7 @@ health and the attack string. Let's see how monsters use it:
305305
When we construct a monster, we give it a reference to a breed object. This
306306
defines the monster's breed instead of the subclasses we were previously using.
307307
In the constructor, `Monster` uses the breed to determine its starting health.
308-
To get the attack string, the monster forwards the call to its breed.
308+
To get the attack string, the monster simply forwards the call to its breed.
309309

310310
This very simple chunk of code is the core idea of the pattern. Everything from
311311
here on out is bonus.

0 commit comments

Comments
 (0)