{"action":"created","issue":{"url":"https://api.github.com/repos/garretthogan/DesignPatterns/issues/2","labels_url":"https://api.github.com/repos/garretthogan/DesignPatterns/issues/2/labels{/name}","comments_url":"https://api.github.com/repos/garretthogan/DesignPatterns/issues/2/comments","events_url":"https://api.github.com/repos/garretthogan/DesignPatterns/issues/2/events","html_url":"https://github.com/garretthogan/DesignPatterns/pull/2","id":120113519,"number":2,"title":"Changed command subclasses into nested classes.","user":{"login":"Glinkis","id":8037927,"avatar_url":"https://avatars.githubusercontent.com/u/8037927?v=3","gravatar_id":"","url":"https://api.github.com/users/Glinkis","html_url":"https://github.com/Glinkis","followers_url":"https://api.github.com/users/Glinkis/followers","following_url":"https://api.github.com/users/Glinkis/following{/other_user}","gists_url":"https://api.github.com/users/Glinkis/gists{/gist_id}","starred_url":"https://api.github.com/users/Glinkis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Glinkis/subscriptions","organizations_url":"https://api.github.com/users/Glinkis/orgs","repos_url":"https://api.github.com/users/Glinkis/repos","events_url":"https://api.github.com/users/Glinkis/events{/privacy}","received_events_url":"https://api.github.com/users/Glinkis/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-12-03T07:56:50Z","updated_at":"2015-12-03T17:32:40Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/garretthogan/DesignPatterns/pulls/2","html_url":"https://github.com/garretthogan/DesignPatterns/pull/2","diff_url":"https://github.com/garretthogan/DesignPatterns/pull/2.diff","patch_url":"https://github.com/garretthogan/DesignPatterns/pull/2.patch"},"body":""},"comment":{"url":"https://api.github.com/repos/garretthogan/DesignPatterns/issues/comments/161724990","html_url":"https://github.com/garretthogan/DesignPatterns/pull/2#issuecomment-161724990","issue_url":"https://api.github.com/repos/garretthogan/DesignPatterns/issues/2","id":161724990,"user":{"login":"garretthogan","id":13322847,"avatar_url":"https://avatars.githubusercontent.com/u/13322847?v=3","gravatar_id":"","url":"https://api.github.com/users/garretthogan","html_url":"https://github.com/garretthogan","followers_url":"https://api.github.com/users/garretthogan/followers","following_url":"https://api.github.com/users/garretthogan/following{/other_user}","gists_url":"https://api.github.com/users/garretthogan/gists{/gist_id}","starred_url":"https://api.github.com/users/garretthogan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/garretthogan/subscriptions","organizations_url":"https://api.github.com/users/garretthogan/orgs","repos_url":"https://api.github.com/users/garretthogan/repos","events_url":"https://api.github.com/users/garretthogan/events{/privacy}","received_events_url":"https://api.github.com/users/garretthogan/received_events","type":"User","site_admin":false},"created_at":"2015-12-03T17:32:40Z","updated_at":"2015-12-03T17:32:40Z","body":"this change would sacrifice the layer of abstraction found from using the command pattern, if you have to call each command explicitly such as ```Command.Jump()``` and ```Command.Fire()``` then the InputHandler would be tightly coupled to those commands, as opposed to now, you can hook in any commands you want, and because each command is abstracted with an ```Execute()``` method then the specific command is irrelevant, that way you can store a list of type ```Command``` and iterate over that list and call the respective execute method regargless of what the command actually does. Here is an example from the InputHandler: \r\n\r\n\tvoid Update () \r\n\t{\r\n\t\tcurrentCommand = HandleInput();\r\n\t\tif(currentCommand != null)\r\n\t\t{\r\n\t\t\tcurrentCommand.Execute(player);\r\n\t\t}\r\n\t}\r\n\tCommand HandleInput()\r\n\t{\r\n\t\tif(Input.GetMouseButton(0)) { return MOUSE_BUTTON0; }\r\n\t\tif(Input.GetKeyDown(KeyCode.Space)) { return SPACE_BAR; }\r\n\r\n\t\treturn null;\r\n\t}\r\n\r\nif each command were a function then we wouldn't have this abstraction."}}