{"action":"closed","number":1659,"pull_request":{"url":"https://api.github.com/repos/HaxeFlixel/flixel/pulls/1659","id":50862948,"html_url":"https://github.com/HaxeFlixel/flixel/pull/1659","diff_url":"https://github.com/HaxeFlixel/flixel/pull/1659.diff","patch_url":"https://github.com/HaxeFlixel/flixel/pull/1659.patch","issue_url":"https://api.github.com/repos/HaxeFlixel/flixel/issues/1659","number":1659,"state":"closed","locked":false,"title":"Tilemap DiagonalPolicy","user":{"login":"larsiusprime","id":739064,"avatar_url":"https://avatars.githubusercontent.com/u/739064?v=3","gravatar_id":"","url":"https://api.github.com/users/larsiusprime","html_url":"https://github.com/larsiusprime","followers_url":"https://api.github.com/users/larsiusprime/followers","following_url":"https://api.github.com/users/larsiusprime/following{/other_user}","gists_url":"https://api.github.com/users/larsiusprime/gists{/gist_id}","starred_url":"https://api.github.com/users/larsiusprime/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/larsiusprime/subscriptions","organizations_url":"https://api.github.com/users/larsiusprime/orgs","repos_url":"https://api.github.com/users/larsiusprime/repos","events_url":"https://api.github.com/users/larsiusprime/events{/privacy}","received_events_url":"https://api.github.com/users/larsiusprime/received_events","type":"User","site_admin":false},"body":"I was debugging some pathfinding issues and noticed that FlxTilemap seems to always assume that diagonal movement is possible when it's calculating the distances during the A* / Dijkstra's algorithm step.\r\n\r\nThere was a parameter to modify this, but only to specify whether the diagonal was \"wide\" or not, ie, whether it would take an additional point to take the diagonal, or whether it was the same as an orthogonal step. There was no way I could see to disallow diagonals entirely.\r\n\r\nSo, this change swaps out the `WideDiagonal:Bool` for `DiagonalPolicy:FlxTilemapDiagonalPolicy`, which is an abstract enum.\r\n\r\nWhy an abstract enum and not a regular enum? Because the previous behavior is to set a default value of Wide Diagonals, and [you can't assign an enum as a default parameter because it's technically not a constant and the compiler complains](http://stackoverflow.com/questions/31307992/haxe-enum-default-parameters).\r\n\r\nFlxTilemapDiagonalPolicy has three values -- NONE, NORMAL, and WIDE.\r\n\r\nWIDE has the same behavior as previously setting the `WideDiagonal` value to true, and NORMAL has the same behavior as previously setting the `WideDiagonal` value to false.\r\n\r\nNONE will make the calculator skip the `up && right`, `down && left`, etc, steps, and only consider orthogonal movement.","created_at":"2015-11-16T20:42:29Z","updated_at":"2015-11-16T21:10:24Z","closed_at":"2015-11-16T21:10:24Z","merged_at":"2015-11-16T21:10:24Z","merge_commit_sha":"e23b160cea1cbcc5af330a61df516bcce2a1b622","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/HaxeFlixel/flixel/pulls/1659/commits","review_comments_url":"https://api.github.com/repos/HaxeFlixel/flixel/pulls/1659/comments","review_comment_url":"https://api.github.com/repos/HaxeFlixel/flixel/pulls/comments{/number}","comments_url":"https://api.github.com/repos/HaxeFlixel/flixel/issues/1659/comments","statuses_url":"https://api.github.com/repos/HaxeFlixel/flixel/statuses/883df2fed73e3c0f7ba77566b2d077cd8c5c18a5","head":{"label":"larsiusprime:tilemap_diagonal","ref":"tilemap_diagonal","sha":"883df2fed73e3c0f7ba77566b2d077cd8c5c18a5","user":{"login":"larsiusprime","id":739064,"avatar_url":"https://avatars.githubusercontent.com/u/739064?v=3","gravatar_id":"","url":"https://api.github.com/users/larsiusprime","html_url":"https://github.com/larsiusprime","followers_url":"https://api.github.com/users/larsiusprime/followers","following_url":"https://api.github.com/users/larsiusprime/following{/other_user}","gists_url":"https://api.github.com/users/larsiusprime/gists{/gist_id}","starred_url":"https://api.github.com/users/larsiusprime/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/larsiusprime/subscriptions","organizations_url":"https://api.github.com/users/larsiusprime/orgs","repos_url":"https://api.github.com/users/larsiusprime/repos","events_url":"https://api.github.com/users/larsiusprime/events{/privacy}","received_events_url":"https://api.github.com/users/larsiusprime/received_events","type":"User","site_admin":false},"repo":{"id":33733461,"name":"haxeflixel","full_name":"larsiusprime/haxeflixel","owner":{"login":"larsiusprime","id":739064,"avatar_url":"https://avatars.githubusercontent.com/u/739064?v=3","gravatar_id":"","url":"https://api.github.com/users/larsiusprime","html_url":"https://github.com/larsiusprime","followers_url":"https://api.github.com/users/larsiusprime/followers","following_url":"https://api.github.com/users/larsiusprime/following{/other_user}","gists_url":"https://api.github.com/users/larsiusprime/gists{/gist_id}","starred_url":"https://api.github.com/users/larsiusprime/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/larsiusprime/subscriptions","organizations_url":"https://api.github.com/users/larsiusprime/orgs","repos_url":"https://api.github.com/users/larsiusprime/repos","events_url":"https://api.github.com/users/larsiusprime/events{/privacy}","received_events_url":"https://api.github.com/users/larsiusprime/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/larsiusprime/haxeflixel","description":"Free, cross-platform 2D game engine powered by Haxe and OpenFL","fork":true,"url":"https://api.github.com/repos/larsiusprime/haxeflixel","forks_url":"https://api.github.com/repos/larsiusprime/haxeflixel/forks","keys_url":"https://api.github.com/repos/larsiusprime/haxeflixel/keys{/key_id}","collaborators_url":"https://api.github.com/repos/larsiusprime/haxeflixel/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/larsiusprime/haxeflixel/teams","hooks_url":"https://api.github.com/repos/larsiusprime/haxeflixel/hooks","issue_events_url":"https://api.github.com/repos/larsiusprime/haxeflixel/issues/events{/number}","events_url":"https://api.github.com/repos/larsiusprime/haxeflixel/events","assignees_url":"https://api.github.com/repos/larsiusprime/haxeflixel/assignees{/user}","branches_url":"https://api.github.com/repos/larsiusprime/haxeflixel/branches{/branch}","tags_url":"https://api.github.com/repos/larsiusprime/haxeflixel/tags","blobs_url":"https://api.github.com/repos/larsiusprime/haxeflixel/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/larsiusprime/haxeflixel/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/larsiusprime/haxeflixel/git/refs{/sha}","trees_url":"https://api.github.com/repos/larsiusprime/haxeflixel/git/trees{/sha}","statuses_url":"https://api.github.com/repos/larsiusprime/haxeflixel/statuses/{sha}","languages_url":"https://api.github.com/repos/larsiusprime/haxeflixel/languages","stargazers_url":"https://api.github.com/repos/larsiusprime/haxeflixel/stargazers","contributors_url":"https://api.github.com/repos/larsiusprime/haxeflixel/contributors","subscribers_url":"https://api.github.com/repos/larsiusprime/haxeflixel/subscribers","subscription_url":"https://api.github.com/repos/larsiusprime/haxeflixel/subscription","commits_url":"https://api.github.com/repos/larsiusprime/haxeflixel/commits{/sha}","git_commits_url":"https://api.github.com/repos/larsiusprime/haxeflixel/git/commits{/sha}","comments_url":"https://api.github.com/repos/larsiusprime/haxeflixel/comments{/number}","issue_comment_url":"https://api.github.com/repos/larsiusprime/haxeflixel/issues/comments{/number}","contents_url":"https://api.github.com/repos/larsiusprime/haxeflixel/contents/{+path}","compare_url":"https://api.github.com/repos/larsiusprime/haxeflixel/compare/{base}...{head}","merges_url":"https://api.github.com/repos/larsiusprime/haxeflixel/merges","archive_url":"https://api.github.com/repos/larsiusprime/haxeflixel/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/larsiusprime/haxeflixel/downloads","issues_url":"https://api.github.com/repos/larsiusprime/haxeflixel/issues{/number}","pulls_url":"https://api.github.com/repos/larsiusprime/haxeflixel/pulls{/number}","milestones_url":"https://api.github.com/repos/larsiusprime/haxeflixel/milestones{/number}","notifications_url":"https://api.github.com/repos/larsiusprime/haxeflixel/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/larsiusprime/haxeflixel/labels{/name}","releases_url":"https://api.github.com/repos/larsiusprime/haxeflixel/releases{/id}","created_at":"2015-04-10T14:41:26Z","updated_at":"2015-05-01T21:55:57Z","pushed_at":"2015-11-16T21:07:11Z","git_url":"git://github.com/larsiusprime/haxeflixel.git","ssh_url":"git@github.com:larsiusprime/haxeflixel.git","clone_url":"https://github.com/larsiusprime/haxeflixel.git","svn_url":"https://github.com/larsiusprime/haxeflixel","homepage":"http://www.haxeflixel.com/","size":17860,"stargazers_count":0,"watchers_count":0,"language":"Haxe","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"dev"}},"base":{"label":"HaxeFlixel:dev","ref":"dev","sha":"7d6017b4f6c84010adcc15f59a2aa97bac7e7d76","user":{"login":"HaxeFlixel","id":4309553,"avatar_url":"https://avatars.githubusercontent.com/u/4309553?v=3","gravatar_id":"","url":"https://api.github.com/users/HaxeFlixel","html_url":"https://github.com/HaxeFlixel","followers_url":"https://api.github.com/users/HaxeFlixel/followers","following_url":"https://api.github.com/users/HaxeFlixel/following{/other_user}","gists_url":"https://api.github.com/users/HaxeFlixel/gists{/gist_id}","starred_url":"https://api.github.com/users/HaxeFlixel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HaxeFlixel/subscriptions","organizations_url":"https://api.github.com/users/HaxeFlixel/orgs","repos_url":"https://api.github.com/users/HaxeFlixel/repos","events_url":"https://api.github.com/users/HaxeFlixel/events{/privacy}","received_events_url":"https://api.github.com/users/HaxeFlixel/received_events","type":"Organization","site_admin":false},"repo":{"id":2101031,"name":"flixel","full_name":"HaxeFlixel/flixel","owner":{"login":"HaxeFlixel","id":4309553,"avatar_url":"https://avatars.githubusercontent.com/u/4309553?v=3","gravatar_id":"","url":"https://api.github.com/users/HaxeFlixel","html_url":"https://github.com/HaxeFlixel","followers_url":"https://api.github.com/users/HaxeFlixel/followers","following_url":"https://api.github.com/users/HaxeFlixel/following{/other_user}","gists_url":"https://api.github.com/users/HaxeFlixel/gists{/gist_id}","starred_url":"https://api.github.com/users/HaxeFlixel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HaxeFlixel/subscriptions","organizations_url":"https://api.github.com/users/HaxeFlixel/orgs","repos_url":"https://api.github.com/users/HaxeFlixel/repos","events_url":"https://api.github.com/users/HaxeFlixel/events{/privacy}","received_events_url":"https://api.github.com/users/HaxeFlixel/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/HaxeFlixel/flixel","description":"Free, cross-platform 2D game engine powered by Haxe and OpenFL","fork":false,"url":"https://api.github.com/repos/HaxeFlixel/flixel","forks_url":"https://api.github.com/repos/HaxeFlixel/flixel/forks","keys_url":"https://api.github.com/repos/HaxeFlixel/flixel/keys{/key_id}","collaborators_url":"https://api.github.com/repos/HaxeFlixel/flixel/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/HaxeFlixel/flixel/teams","hooks_url":"https://api.github.com/repos/HaxeFlixel/flixel/hooks","issue_events_url":"https://api.github.com/repos/HaxeFlixel/flixel/issues/events{/number}","events_url":"https://api.github.com/repos/HaxeFlixel/flixel/events","assignees_url":"https://api.github.com/repos/HaxeFlixel/flixel/assignees{/user}","branches_url":"https://api.github.com/repos/HaxeFlixel/flixel/branches{/branch}","tags_url":"https://api.github.com/repos/HaxeFlixel/flixel/tags","blobs_url":"https://api.github.com/repos/HaxeFlixel/flixel/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/HaxeFlixel/flixel/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/HaxeFlixel/flixel/git/refs{/sha}","trees_url":"https://api.github.com/repos/HaxeFlixel/flixel/git/trees{/sha}","statuses_url":"https://api.github.com/repos/HaxeFlixel/flixel/statuses/{sha}","languages_url":"https://api.github.com/repos/HaxeFlixel/flixel/languages","stargazers_url":"https://api.github.com/repos/HaxeFlixel/flixel/stargazers","contributors_url":"https://api.github.com/repos/HaxeFlixel/flixel/contributors","subscribers_url":"https://api.github.com/repos/HaxeFlixel/flixel/subscribers","subscription_url":"https://api.github.com/repos/HaxeFlixel/flixel/subscription","commits_url":"https://api.github.com/repos/HaxeFlixel/flixel/commits{/sha}","git_commits_url":"https://api.github.com/repos/HaxeFlixel/flixel/git/commits{/sha}","comments_url":"https://api.github.com/repos/HaxeFlixel/flixel/comments{/number}","issue_comment_url":"https://api.github.com/repos/HaxeFlixel/flixel/issues/comments{/number}","contents_url":"https://api.github.com/repos/HaxeFlixel/flixel/contents/{+path}","compare_url":"https://api.github.com/repos/HaxeFlixel/flixel/compare/{base}...{head}","merges_url":"https://api.github.com/repos/HaxeFlixel/flixel/merges","archive_url":"https://api.github.com/repos/HaxeFlixel/flixel/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/HaxeFlixel/flixel/downloads","issues_url":"https://api.github.com/repos/HaxeFlixel/flixel/issues{/number}","pulls_url":"https://api.github.com/repos/HaxeFlixel/flixel/pulls{/number}","milestones_url":"https://api.github.com/repos/HaxeFlixel/flixel/milestones{/number}","notifications_url":"https://api.github.com/repos/HaxeFlixel/flixel/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/HaxeFlixel/flixel/labels{/name}","releases_url":"https://api.github.com/repos/HaxeFlixel/flixel/releases{/id}","created_at":"2011-07-25T13:12:48Z","updated_at":"2015-11-14T14:21:55Z","pushed_at":"2015-11-16T21:10:24Z","git_url":"git://github.com/HaxeFlixel/flixel.git","ssh_url":"git@github.com:HaxeFlixel/flixel.git","clone_url":"https://github.com/HaxeFlixel/flixel.git","svn_url":"https://github.com/HaxeFlixel/flixel","homepage":"http://www.haxeflixel.com/","size":36959,"stargazers_count":784,"watchers_count":784,"language":"Haxe","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":200,"mirror_url":null,"open_issues_count":129,"forks":200,"open_issues":129,"watchers":784,"default_branch":"dev"}},"_links":{"self":{"href":"https://api.github.com/repos/HaxeFlixel/flixel/pulls/1659"},"html":{"href":"https://github.com/HaxeFlixel/flixel/pull/1659"},"issue":{"href":"https://api.github.com/repos/HaxeFlixel/flixel/issues/1659"},"comments":{"href":"https://api.github.com/repos/HaxeFlixel/flixel/issues/1659/comments"},"review_comments":{"href":"https://api.github.com/repos/HaxeFlixel/flixel/pulls/1659/comments"},"review_comment":{"href":"https://api.github.com/repos/HaxeFlixel/flixel/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/HaxeFlixel/flixel/pulls/1659/commits"},"statuses":{"href":"https://api.github.com/repos/HaxeFlixel/flixel/statuses/883df2fed73e3c0f7ba77566b2d077cd8c5c18a5"}},"merged":true,"mergeable":null,"mergeable_state":"unknown","merged_by":{"login":"Gama11","id":2620907,"avatar_url":"https://avatars.githubusercontent.com/u/2620907?v=3","gravatar_id":"","url":"https://api.github.com/users/Gama11","html_url":"https://github.com/Gama11","followers_url":"https://api.github.com/users/Gama11/followers","following_url":"https://api.github.com/users/Gama11/following{/other_user}","gists_url":"https://api.github.com/users/Gama11/gists{/gist_id}","starred_url":"https://api.github.com/users/Gama11/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Gama11/subscriptions","organizations_url":"https://api.github.com/users/Gama11/orgs","repos_url":"https://api.github.com/users/Gama11/repos","events_url":"https://api.github.com/users/Gama11/events{/privacy}","received_events_url":"https://api.github.com/users/Gama11/received_events","type":"User","site_admin":false},"comments":1,"review_comments":0,"commits":8,"additions":77,"deletions":55,"changed_files":1}}