{"action":"opened","number":57,"pull_request":{"url":"https://api.github.com/repos/Utopia1138/Design-Patterns-Training/pulls/57","id":72081189,"html_url":"https://github.com/Utopia1138/Design-Patterns-Training/pull/57","diff_url":"https://github.com/Utopia1138/Design-Patterns-Training/pull/57.diff","patch_url":"https://github.com/Utopia1138/Design-Patterns-Training/pull/57.patch","issue_url":"https://api.github.com/repos/Utopia1138/Design-Patterns-Training/issues/57","number":57,"state":"open","locked":false,"title":"Ch. 10: State Pattern","user":{"login":"jpappe","id":7421391,"avatar_url":"https://avatars.githubusercontent.com/u/7421391?v=3","gravatar_id":"","url":"https://api.github.com/users/jpappe","html_url":"https://github.com/jpappe","followers_url":"https://api.github.com/users/jpappe/followers","following_url":"https://api.github.com/users/jpappe/following{/other_user}","gists_url":"https://api.github.com/users/jpappe/gists{/gist_id}","starred_url":"https://api.github.com/users/jpappe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jpappe/subscriptions","organizations_url":"https://api.github.com/users/jpappe/orgs","repos_url":"https://api.github.com/users/jpappe/repos","events_url":"https://api.github.com/users/jpappe/events{/privacy}","received_events_url":"https://api.github.com/users/jpappe/received_events","type":"User","site_admin":false},"body":"An implementation of the State Pattern based around the health of a game character.\r\n\r\nA character's health puts them in one of the following states that has an impact on their \"effectiveness\" (placeholder for strength, speed, etc.):\r\n\r\n   * Healthy: full health (or mostly so) gives the character a 10% increase in effectiveness\r\n   * Injured: The character has taken some damage and they are at 75% effectiveness\r\n   * Gravely Injured: The character has taken a real beating and is at 50% effectiveness\r\n   * Unconscious: The character is rendered unconscious and is at 0% effectiveness (but can be healed)\r\n   * Dead: dead dead dead; 0% effectiveness and must be \"revived\"\r\n\r\nThere are a few actions that can change the character's health, and the actual logic around how this changes the character's health state is where the State Pattern is really used:\r\n\r\n   * Take damage: can move the character \"down\" the health states from Healthy to Dead\r\n   * Heal: can move the character \"up\" the health states so long as they are not Dead\r\n   * Revive: Allows a character that is Dead to move \"up\" the health states.\r\n\r\nTo see this in action, see `CharacterEntityTest`.","created_at":"2016-05-31T20:34:33Z","updated_at":"2016-05-31T20:34:33Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Utopia1138/Design-Patterns-Training/pulls/57/commits","review_comments_url":"https://api.github.com/repos/Utopia1138/Design-Patterns-Training/pulls/57/comments","review_comment_url":"https://api.github.com/repos/Utopia1138/Design-Patterns-Training/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Utopia1138/Design-Patterns-Training/issues/57/comments","statuses_url":"https://api.github.com/repos/Utopia1138/Design-Patterns-Training/statuses/56655bd358ea1db07dd81dcba19775ea09ad6a80","head":{"label":"jpappe:ch10-state","ref":"ch10-state","sha":"56655bd358ea1db07dd81dcba19775ea09ad6a80","user":{"login":"jpappe","id":7421391,"avatar_url":"https://avatars.githubusercontent.com/u/7421391?v=3","gravatar_id":"","url":"https://api.github.com/users/jpappe","html_url":"https://github.com/jpappe","followers_url":"https://api.github.com/users/jpappe/followers","following_url":"https://api.github.com/users/jpappe/following{/other_user}","gists_url":"https://api.github.com/users/jpappe/gists{/gist_id}","starred_url":"https://api.github.com/users/jpappe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jpappe/subscriptions","organizations_url":"https://api.github.com/users/jpappe/orgs","repos_url":"https://api.github.com/users/jpappe/repos","events_url":"https://api.github.com/users/jpappe/events{/privacy}","received_events_url":"https://api.github.com/users/jpappe/received_events","type":"User","site_admin":false},"repo":{"id":46444033,"name":"Design-Patterns-Training","full_name":"jpappe/Design-Patterns-Training","owner":{"login":"jpappe","id":7421391,"avatar_url":"https://avatars.githubusercontent.com/u/7421391?v=3","gravatar_id":"","url":"https://api.github.com/users/jpappe","html_url":"https://github.com/jpappe","followers_url":"https://api.github.com/users/jpappe/followers","following_url":"https://api.github.com/users/jpappe/following{/other_user}","gists_url":"https://api.github.com/users/jpappe/gists{/gist_id}","starred_url":"https://api.github.com/users/jpappe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jpappe/subscriptions","organizations_url":"https://api.github.com/users/jpappe/orgs","repos_url":"https://api.github.com/users/jpappe/repos","events_url":"https://api.github.com/users/jpappe/events{/privacy}","received_events_url":"https://api.github.com/users/jpappe/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jpappe/Design-Patterns-Training","description":"Training group for the Head First Design Patterns book","fork":true,"url":"https://api.github.com/repos/jpappe/Design-Patterns-Training","forks_url":"https://api.github.com/repos/jpappe/Design-Patterns-Training/forks","keys_url":"https://api.github.com/repos/jpappe/Design-Patterns-Training/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jpappe/Design-Patterns-Training/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jpappe/Design-Patterns-Training/teams","hooks_url":"https://api.github.com/repos/jpappe/Design-Patterns-Training/hooks","issue_events_url":"https://api.github.com/repos/jpappe/Design-Patterns-Training/issues/events{/number}","events_url":"https://api.github.com/repos/jpappe/Design-Patterns-Training/events","assignees_url":"https://api.github.com/repos/jpappe/Design-Patterns-Training/assignees{/user}","branches_url":"https://api.github.com/repos/jpappe/Design-Patterns-Training/branches{/branch}","tags_url":"https://api.github.com/repos/jpappe/Design-Patterns-Training/tags","blobs_url":"https://api.github.com/repos/jpappe/Design-Patterns-Training/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jpappe/Design-Patterns-Training/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jpappe/Design-Patterns-Training/git/refs{/sha}","trees_url":"https://api.github.com/repos/jpappe/Design-Patterns-Training/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jpappe/Design-Patterns-Training/statuses/{sha}","languages_url":"https://api.github.com/repos/jpappe/Design-Patterns-Training/languages","stargazers_url":"https://api.github.com/repos/jpappe/Design-Patterns-Training/stargazers","contributors_url":"https://api.github.com/repos/jpappe/Design-Patterns-Training/contributors","subscribers_url":"https://api.github.com/repos/jpappe/Design-Patterns-Training/subscribers","subscription_url":"https://api.github.com/repos/jpappe/Design-Patterns-Training/subscription","commits_url":"https://api.github.com/repos/jpappe/Design-Patterns-Training/commits{/sha}","git_commits_url":"https://api.github.com/repos/jpappe/Design-Patterns-Training/git/commits{/sha}","comments_url":"https://api.github.com/repos/jpappe/Design-Patterns-Training/comments{/number}","issue_comment_url":"https://api.github.com/repos/jpappe/Design-Patterns-Training/issues/comments{/number}","contents_url":"https://api.github.com/repos/jpappe/Design-Patterns-Training/contents/{+path}","compare_url":"https://api.github.com/repos/jpappe/Design-Patterns-Training/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jpappe/Design-Patterns-Training/merges","archive_url":"https://api.github.com/repos/jpappe/Design-Patterns-Training/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jpappe/Design-Patterns-Training/downloads","issues_url":"https://api.github.com/repos/jpappe/Design-Patterns-Training/issues{/number}","pulls_url":"https://api.github.com/repos/jpappe/Design-Patterns-Training/pulls{/number}","milestones_url":"https://api.github.com/repos/jpappe/Design-Patterns-Training/milestones{/number}","notifications_url":"https://api.github.com/repos/jpappe/Design-Patterns-Training/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jpappe/Design-Patterns-Training/labels{/name}","releases_url":"https://api.github.com/repos/jpappe/Design-Patterns-Training/releases{/id}","deployments_url":"https://api.github.com/repos/jpappe/Design-Patterns-Training/deployments","created_at":"2015-11-18T20:03:08Z","updated_at":"2016-02-19T20:06:47Z","pushed_at":"2016-05-31T20:27:14Z","git_url":"git://github.com/jpappe/Design-Patterns-Training.git","ssh_url":"git@github.com:jpappe/Design-Patterns-Training.git","clone_url":"https://github.com/jpappe/Design-Patterns-Training.git","svn_url":"https://github.com/jpappe/Design-Patterns-Training","homepage":null,"size":3996,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"Utopia1138:master","ref":"master","sha":"15d77044825e85b999eddc19bbb39724574231dd","user":{"login":"Utopia1138","id":2646781,"avatar_url":"https://avatars.githubusercontent.com/u/2646781?v=3","gravatar_id":"","url":"https://api.github.com/users/Utopia1138","html_url":"https://github.com/Utopia1138","followers_url":"https://api.github.com/users/Utopia1138/followers","following_url":"https://api.github.com/users/Utopia1138/following{/other_user}","gists_url":"https://api.github.com/users/Utopia1138/gists{/gist_id}","starred_url":"https://api.github.com/users/Utopia1138/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Utopia1138/subscriptions","organizations_url":"https://api.github.com/users/Utopia1138/orgs","repos_url":"https://api.github.com/users/Utopia1138/repos","events_url":"https://api.github.com/users/Utopia1138/events{/privacy}","received_events_url":"https://api.github.com/users/Utopia1138/received_events","type":"User","site_admin":false},"repo":{"id":45832227,"name":"Design-Patterns-Training","full_name":"Utopia1138/Design-Patterns-Training","owner":{"login":"Utopia1138","id":2646781,"avatar_url":"https://avatars.githubusercontent.com/u/2646781?v=3","gravatar_id":"","url":"https://api.github.com/users/Utopia1138","html_url":"https://github.com/Utopia1138","followers_url":"https://api.github.com/users/Utopia1138/followers","following_url":"https://api.github.com/users/Utopia1138/following{/other_user}","gists_url":"https://api.github.com/users/Utopia1138/gists{/gist_id}","starred_url":"https://api.github.com/users/Utopia1138/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Utopia1138/subscriptions","organizations_url":"https://api.github.com/users/Utopia1138/orgs","repos_url":"https://api.github.com/users/Utopia1138/repos","events_url":"https://api.github.com/users/Utopia1138/events{/privacy}","received_events_url":"https://api.github.com/users/Utopia1138/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Utopia1138/Design-Patterns-Training","description":"Training group for the Head First Design Patterns book","fork":false,"url":"https://api.github.com/repos/Utopia1138/Design-Patterns-Training","forks_url":"https://api.github.com/repos/Utopia1138/Design-Patterns-Training/forks","keys_url":"https://api.github.com/repos/Utopia1138/Design-Patterns-Training/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Utopia1138/Design-Patterns-Training/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Utopia1138/Design-Patterns-Training/teams","hooks_url":"https://api.github.com/repos/Utopia1138/Design-Patterns-Training/hooks","issue_events_url":"https://api.github.com/repos/Utopia1138/Design-Patterns-Training/issues/events{/number}","events_url":"https://api.github.com/repos/Utopia1138/Design-Patterns-Training/events","assignees_url":"https://api.github.com/repos/Utopia1138/Design-Patterns-Training/assignees{/user}","branches_url":"https://api.github.com/repos/Utopia1138/Design-Patterns-Training/branches{/branch}","tags_url":"https://api.github.com/repos/Utopia1138/Design-Patterns-Training/tags","blobs_url":"https://api.github.com/repos/Utopia1138/Design-Patterns-Training/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Utopia1138/Design-Patterns-Training/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Utopia1138/Design-Patterns-Training/git/refs{/sha}","trees_url":"https://api.github.com/repos/Utopia1138/Design-Patterns-Training/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Utopia1138/Design-Patterns-Training/statuses/{sha}","languages_url":"https://api.github.com/repos/Utopia1138/Design-Patterns-Training/languages","stargazers_url":"https://api.github.com/repos/Utopia1138/Design-Patterns-Training/stargazers","contributors_url":"https://api.github.com/repos/Utopia1138/Design-Patterns-Training/contributors","subscribers_url":"https://api.github.com/repos/Utopia1138/Design-Patterns-Training/subscribers","subscription_url":"https://api.github.com/repos/Utopia1138/Design-Patterns-Training/subscription","commits_url":"https://api.github.com/repos/Utopia1138/Design-Patterns-Training/commits{/sha}","git_commits_url":"https://api.github.com/repos/Utopia1138/Design-Patterns-Training/git/commits{/sha}","comments_url":"https://api.github.com/repos/Utopia1138/Design-Patterns-Training/comments{/number}","issue_comment_url":"https://api.github.com/repos/Utopia1138/Design-Patterns-Training/issues/comments{/number}","contents_url":"https://api.github.com/repos/Utopia1138/Design-Patterns-Training/contents/{+path}","compare_url":"https://api.github.com/repos/Utopia1138/Design-Patterns-Training/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Utopia1138/Design-Patterns-Training/merges","archive_url":"https://api.github.com/repos/Utopia1138/Design-Patterns-Training/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Utopia1138/Design-Patterns-Training/downloads","issues_url":"https://api.github.com/repos/Utopia1138/Design-Patterns-Training/issues{/number}","pulls_url":"https://api.github.com/repos/Utopia1138/Design-Patterns-Training/pulls{/number}","milestones_url":"https://api.github.com/repos/Utopia1138/Design-Patterns-Training/milestones{/number}","notifications_url":"https://api.github.com/repos/Utopia1138/Design-Patterns-Training/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Utopia1138/Design-Patterns-Training/labels{/name}","releases_url":"https://api.github.com/repos/Utopia1138/Design-Patterns-Training/releases{/id}","deployments_url":"https://api.github.com/repos/Utopia1138/Design-Patterns-Training/deployments","created_at":"2015-11-09T10:50:44Z","updated_at":"2016-05-04T12:50:48Z","pushed_at":"2016-05-31T15:42:28Z","git_url":"git://github.com/Utopia1138/Design-Patterns-Training.git","ssh_url":"git@github.com:Utopia1138/Design-Patterns-Training.git","clone_url":"https://github.com/Utopia1138/Design-Patterns-Training.git","svn_url":"https://github.com/Utopia1138/Design-Patterns-Training","homepage":null,"size":4335,"stargazers_count":0,"watchers_count":0,"language":"HTML","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":4,"forks":2,"open_issues":4,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Utopia1138/Design-Patterns-Training/pulls/57"},"html":{"href":"https://github.com/Utopia1138/Design-Patterns-Training/pull/57"},"issue":{"href":"https://api.github.com/repos/Utopia1138/Design-Patterns-Training/issues/57"},"comments":{"href":"https://api.github.com/repos/Utopia1138/Design-Patterns-Training/issues/57/comments"},"review_comments":{"href":"https://api.github.com/repos/Utopia1138/Design-Patterns-Training/pulls/57/comments"},"review_comment":{"href":"https://api.github.com/repos/Utopia1138/Design-Patterns-Training/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Utopia1138/Design-Patterns-Training/pulls/57/commits"},"statuses":{"href":"https://api.github.com/repos/Utopia1138/Design-Patterns-Training/statuses/56655bd358ea1db07dd81dcba19775ea09ad6a80"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":2,"additions":672,"deletions":0,"changed_files":17}}
{"actor":{"display_login":"jpappe"}}