strategy pattern: 행동하는 알고리즘을 클래스로 만들어 행동 하는 방식을 여러개로 제시
state pattern: 상태를 클래스로 만들고 클래스 내에 행동을 넣어 상태에 따른 행동 방식을 제시
사용처
state pattern에는 게임쪽에서 사용처를 찾을 수 있었다. state pattern은 캐릭터가 상태에 따른 움직임을 다르게 만들 수 있다. 캐릭터가 물속에 있으면 수영 모션을 취하거나 땅에 있으면 걷기 모션을 취하는 방식으로 만들어서 같은 행동을 하더라도 상태나 환경에 따라 다르게 움직일 수 있다
요약
사용처
state pattern에는 게임쪽에서 사용처를 찾을 수 있었다. state pattern은 캐릭터가 상태에 따른 움직임을 다르게 만들 수 있다. 캐릭터가 물속에 있으면 수영 모션을 취하거나 땅에 있으면 걷기 모션을 취하는 방식으로 만들어서 같은 행동을 하더라도 상태나 환경에 따라 다르게 움직일 수 있다