Skip to content

Commit 843b431

Browse files
committed
add some en chapter.
1 parent 7ef1a13 commit 843b431

8 files changed

+4059
-1
lines changed

02.3-Observer.md

+732
Large diffs are not rendered by default.

02.4-Prototype.md

+609
Large diffs are not rendered by default.

02.5-Singleton.md

+568
Large diffs are not rendered by default.

05-Decoupling Patterns.md

+24
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,26 @@
11
Decoupling Patterns
22
============================
3+
4+
^title Decoupling Patterns
5+
6+
Once you get the hang of a programming language, writing code to do what you
7+
want is actually pretty easy. What's hard is writing code that's easy to adapt
8+
when your requirements *change*. Rarely do we have the luxury of a perfect
9+
feature set before we've fired up our editor.
10+
11+
A powerful tool we have for making change easier is *decoupling*. When we say
12+
two pieces of code are "decoupled", we mean a change in one usually doesn't
13+
require a change in the other. When you change some feature in your game, the
14+
fewer places in code you have to touch, the easier it is.
15+
16+
[Components](component.html) decouple different domains in your game from each
17+
other within a single entity that has aspects of all of them. [Event
18+
Queues](event-queue.html) decouple two objects communicating with each other,
19+
both statically and *in time*. [Service Locators](service-locator.html) let
20+
code access a facility without being bound to the code that provides it.
21+
22+
## The Patterns
23+
24+
* [Component](component.html)
25+
* [Event Queue](event-queue.html)
26+
* [Service Locator](service-locator.html)

05.1-Component.md

+696
Large diffs are not rendered by default.

05.2-Event Queue.md

+843
Large diffs are not rendered by default.

05.3-Service Locator.md

+586
Large diffs are not rendered by default.

06.2-Dirty Flag.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -914,7 +914,7 @@ on the ship this modification occurred.
914914
dirty flag to note which objects have had forces applied and need to have
915915
their physics resolved.
916916

917-
* 物理引擎跟踪着那些物理在运动那些空闲。应为一个空闲的物理知道收到力的作用才会移动,他在受力
917+
* 物理引擎跟踪着那些物理在运动那些空闲。应为一个空闲的物理知道收到力的作用才会移动,他在受力
918918
之前不需要处理。这个“是否在移动”是一个赃位,来标记那些物体收到了力的作用并需要计算他们的
919919
物理状态。
920920

0 commit comments

Comments
 (0)