You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"Define a type object class and a typed object class. Each type object instance represents a different logical type. Each typed object stores a reference to the type object that describes its type."
7
+
8
+
## When use it
9
+
10
+
1. You don’t know what types you will need up front
11
+
2. You want to be able to modify or add new types without having to recompile or change code.
12
+
13
+
### Notes
14
+
- You move the Type from Code to Data. The flexibility is good, but you lose some things by hoisting your types into data.
15
+
- We need to make sure the Types are loaded in memory because they are now objects, and not part of the language done in compilation time.
16
+
- It is much more complex to add new behaviors to specific Types because we don't have code (this point not valid for Scriptable Objects).
4
17
5
18
References:
6
-
1. Book [Game Programmings Patterns](https://gameprogrammingpatterns.com/subclass-sandbox.html)
0 commit comments