Skip to content

Commit a0a16da

Browse files
committed
Updated readme and added which specific chapter the factory is from
1 parent 6ceeed7 commit a0a16da

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

Assets/Patterns/21. Factory/Sound Factory/SoundFactoryController.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
using Factory.SoundFactory;
55

66

7-
//Example of Factory programming pattern from "Game Programming Gems 2"
7+
//Example of Factory programming pattern from "Game Programming Gems 2:" 1.3 Programming with abstract interfaces
88
public class SoundFactoryController : MonoBehaviour
99
{
1010
private void Start()

README.md

+2
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,8 @@ You could use an enum that keeps track of each state and then a switch statement
198198

199199
- Enemy AI is often using the State pattern. The creepers in Minecraft have three states: move randomly when you are far away, move towards you if you are closer, blow up when you are very close.
200200

201+
- The game itself can be a number of states: intro video, main menu, main game, mini game, etc.
202+
201203
**Related patterns**
202204

203205
- **[Type Object](#12-type-object).** In both cases you have a main object and then you add another object to define something. The difference is that in State you switch the other object, while in Type Object that object remains the same. So if the object in Type Object can be switched you get the State pattern.

0 commit comments

Comments
 (0)