{"action":"created","comment":{"url":"https://api.github.com/repos/island-troll-tribes/island-troll-tribes/pulls/comments/183253124","pull_request_review_id":114216000,"id":183253124,"diff_hunk":"@@ -0,0 +1,527 @@\n+/*\n+*  ItemRecipe v1.1.0.0\n+*     by Bannar\n+*\n+*  Powerful item recipe creator.\n+*/\n+package ItemRecipe\n+import HashMap\n+import LinkedList\n+import RegisterEvents\n+import ItemRestriction\n+import InventoryEvent\n+import SmoothItemPickup\n+import StackNSplit\n+\n+// Global containers for associated recipe list retrieval\n+let recipeMap = new HashMap<int, LinkedList<ItemRecipe>>()\n+Table resultToRecipe = new Table()\n+\n+// Event related globals\n+ItemRecipe eventRecipe = null\n+unit eventUnit = null\n+item eventItem = null\n+HashMap<int, ItemData> eventRecipeData = null\n+trigger eventAssemblingTrigger = CreateTrigger()\n+trigger eventAssembledTrigger = CreateTrigger()\n+boolean eventHandled = false\n+\n+public constant int EVENT_ITEM_RECIPE_ASSEMBLING = 0\n+public constant int EVENT_ITEM_RECIPE_ASSEMBLED = 1\n+\n+/** Returns triggering item recipe. */\n+public function getEventItemRecipe() returns ItemRecipe\n+    return eventRecipe\n+\n+/** Returns recipe triggering unit. */\n+public function getEventItemRecipeUnit() returns unit\n+    return eventUnit\n+\n+/** Returns event reward item. */\n+public function getEventItemRecipeItem() returns item\n+    return eventItem\n+\n+/** Returns unit item slots mapped with respective ingredients chosen for assembly. */\n+public function getEventItemRecipeData() returns HashMap<int, ItemData>\n+    return eventRecipeData\n+\n+/** Sets value indicating if event should be propagated. */\n+public function setEventItemRecipeHandled(boolean handled)\n+    eventHandled = handled\n+\n+/** Registers new event handler for specified item recipe event. */\n+public function registerItemRecipeEvent(int whichEvent, code c)\n+    if whichEvent == EVENT_ITEM_RECIPE_ASSEMBLING\n+        eventAssemblingTrigger.addCondition(Condition(c))\n+    else if whichEvent == EVENT_ITEM_RECIPE_ASSEMBLED\n+        eventAssembledTrigger.addCondition(Condition(c))\n+\n+/** Returns trigger handle associated with specified recipe event. */\n+public function getInventoryEventTrigger(int whichEvent) returns trigger\n+    if whichEvent == EVENT_ITEM_RECIPE_ASSEMBLING\n+        return eventAssemblingTrigger\n+    else if whichEvent == EVENT_ITEM_RECIPE_ASSEMBLED\n+        return eventAssembledTrigger\n+    return null\n+\n+function fireEvent(trigger evt, ItemRecipe recipe, unit u, item itm, HashMap<int, ItemData> recipeData)\n+    ItemRecipe prevRecipe = eventRecipe\n+    unit prevUnit = eventUnit\n+    item prevItem = eventItem\n+    let prevRecipeData = eventRecipeData\n+\n+    eventRecipe = recipe\n+    eventUnit = u\n+    eventItem = itm\n+    eventRecipeData = recipeData\n+\n+    evt.evaluate()\n+\n+    eventRecipe = prevRecipe\n+    eventUnit = prevUnit\n+    eventItem = prevItem\n+    eventRecipeData = prevRecipeData\n+\n+/** Stores information about item required for recipe assembly. */\n+public class ItemData\n+    int itemTypeId\n+    boolean remove\n+    int charges\n+    int index\n+\n+    construct(int itemTypeId, boolean remove, int charges, int index)\n+        this.itemTypeId = itemTypeId\n+        this.remove = remove\n+        this.charges = charges\n+        this.index = index\n+    \n+    construct(thistype base)\n+        this.itemTypeId = base.itemTypeId\n+        this.remove = base.remove\n+        this.charges = base.charges\n+        this.index = base.index\n+\n+/** Item recipe, collection of items that can be combined for powerful rewards. */\n+public class ItemRecipe\n+    private LinkedList<ItemData> ingredients\n+    private int reward\n+    int charges\n+    boolean ordered\n+    boolean permanent","path":"wurst/lib/ItemRecipe.wurst","position":110,"original_position":110,"commit_id":"7585d05ea56355f6e1e5d7d62b56de126a3db6f0","original_commit_id":"7585d05ea56355f6e1e5d7d62b56de126a3db6f0","user":{"login":"jonathanmclaus","id":5731591,"avatar_url":"https://avatars0.githubusercontent.com/u/5731591?v=4","gravatar_id":"","url":"https://api.github.com/users/jonathanmclaus","html_url":"https://github.com/jonathanmclaus","followers_url":"https://api.github.com/users/jonathanmclaus/followers","following_url":"https://api.github.com/users/jonathanmclaus/following{/other_user}","gists_url":"https://api.github.com/users/jonathanmclaus/gists{/gist_id}","starred_url":"https://api.github.com/users/jonathanmclaus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jonathanmclaus/subscriptions","organizations_url":"https://api.github.com/users/jonathanmclaus/orgs","repos_url":"https://api.github.com/users/jonathanmclaus/repos","events_url":"https://api.github.com/users/jonathanmclaus/events{/privacy}","received_events_url":"https://api.github.com/users/jonathanmclaus/received_events","type":"User","site_admin":false},"body":"I think that we should collectively decide on a convention for booleans. I prefer `is` as a prefix, e.g. `isOrdered` and `isPermanent`, although `should` fits better in some cases.","created_at":"2018-04-22T21:57:15Z","updated_at":"2018-04-22T22:04:30Z","html_url":"https://github.com/island-troll-tribes/island-troll-tribes/pull/72#discussion_r183253124","pull_request_url":"https://api.github.com/repos/island-troll-tribes/island-troll-tribes/pulls/72","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/island-troll-tribes/island-troll-tribes/pulls/comments/183253124"},"html":{"href":"https://github.com/island-troll-tribes/island-troll-tribes/pull/72#discussion_r183253124"},"pull_request":{"href":"https://api.github.com/repos/island-troll-tribes/island-troll-tribes/pulls/72"}}},"pull_request":{"url":"https://api.github.com/repos/island-troll-tribes/island-troll-tribes/pulls/72","id":183140222,"html_url":"https://github.com/island-troll-tribes/island-troll-tribes/pull/72","diff_url":"https://github.com/island-troll-tribes/island-troll-tribes/pull/72.diff","patch_url":"https://github.com/island-troll-tribes/island-troll-tribes/pull/72.patch","issue_url":"https://api.github.com/repos/island-troll-tribes/island-troll-tribes/issues/72","number":72,"state":"open","locked":false,"title":"Addition of new item-related packages.","user":{"login":"crojewsk","id":14059588,"avatar_url":"https://avatars2.githubusercontent.com/u/14059588?v=4","gravatar_id":"","url":"https://api.github.com/users/crojewsk","html_url":"https://github.com/crojewsk","followers_url":"https://api.github.com/users/crojewsk/followers","following_url":"https://api.github.com/users/crojewsk/following{/other_user}","gists_url":"https://api.github.com/users/crojewsk/gists{/gist_id}","starred_url":"https://api.github.com/users/crojewsk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/crojewsk/subscriptions","organizations_url":"https://api.github.com/users/crojewsk/orgs","repos_url":"https://api.github.com/users/crojewsk/repos","events_url":"https://api.github.com/users/crojewsk/events{/privacy}","received_events_url":"https://api.github.com/users/crojewsk/received_events","type":"User","site_admin":false},"body":"Listed packages are added to replace existing ITT item handling.\r\nFurther patches will introduce usage of new and removal of obsolete\r\ncode.\r\n\r\n- InventoryEvent, for intuivite inventory event handling\r\n- ItemRecipe, powerful item recipe creator\r\n- ItemRestriction, for restricting or limiting items from being equipped\r\n- SmoothItemPickup, allows for item pickup during certain conditions\r\neven when unit inventory is full\r\n- StackNSplit, easy item charges stacking and splitting","created_at":"2018-04-20T18:41:22Z","updated_at":"2018-04-22T22:04:30Z","closed_at":null,"merged_at":null,"merge_commit_sha":"49c8e9e76042f1695d2ddea55c6dfaa9b3f642d8","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/island-troll-tribes/island-troll-tribes/pulls/72/commits","review_comments_url":"https://api.github.com/repos/island-troll-tribes/island-troll-tribes/pulls/72/comments","review_comment_url":"https://api.github.com/repos/island-troll-tribes/island-troll-tribes/pulls/comments{/number}","comments_url":"https://api.github.com/repos/island-troll-tribes/island-troll-tribes/issues/72/comments","statuses_url":"https://api.github.com/repos/island-troll-tribes/island-troll-tribes/statuses/7585d05ea56355f6e1e5d7d62b56de126a3db6f0","head":{"label":"crojewsk:master","ref":"master","sha":"7585d05ea56355f6e1e5d7d62b56de126a3db6f0","user":{"login":"crojewsk","id":14059588,"avatar_url":"https://avatars2.githubusercontent.com/u/14059588?v=4","gravatar_id":"","url":"https://api.github.com/users/crojewsk","html_url":"https://github.com/crojewsk","followers_url":"https://api.github.com/users/crojewsk/followers","following_url":"https://api.github.com/users/crojewsk/following{/other_user}","gists_url":"https://api.github.com/users/crojewsk/gists{/gist_id}","starred_url":"https://api.github.com/users/crojewsk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/crojewsk/subscriptions","organizations_url":"https://api.github.com/users/crojewsk/orgs","repos_url":"https://api.github.com/users/crojewsk/repos","events_url":"https://api.github.com/users/crojewsk/events{/privacy}","received_events_url":"https://api.github.com/users/crojewsk/received_events","type":"User","site_admin":false},"repo":{"id":42274161,"name":"island-troll-tribes","full_name":"crojewsk/island-troll-tribes","owner":{"login":"crojewsk","id":14059588,"avatar_url":"https://avatars2.githubusercontent.com/u/14059588?v=4","gravatar_id":"","url":"https://api.github.com/users/crojewsk","html_url":"https://github.com/crojewsk","followers_url":"https://api.github.com/users/crojewsk/followers","following_url":"https://api.github.com/users/crojewsk/following{/other_user}","gists_url":"https://api.github.com/users/crojewsk/gists{/gist_id}","starred_url":"https://api.github.com/users/crojewsk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/crojewsk/subscriptions","organizations_url":"https://api.github.com/users/crojewsk/orgs","repos_url":"https://api.github.com/users/crojewsk/repos","events_url":"https://api.github.com/users/crojewsk/events{/privacy}","received_events_url":"https://api.github.com/users/crojewsk/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/crojewsk/island-troll-tribes","description":"Island Troll Tribes, a Warcraft III Custom Game","fork":true,"url":"https://api.github.com/repos/crojewsk/island-troll-tribes","forks_url":"https://api.github.com/repos/crojewsk/island-troll-tribes/forks","keys_url":"https://api.github.com/repos/crojewsk/island-troll-tribes/keys{/key_id}","collaborators_url":"https://api.github.com/repos/crojewsk/island-troll-tribes/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/crojewsk/island-troll-tribes/teams","hooks_url":"https://api.github.com/repos/crojewsk/island-troll-tribes/hooks","issue_events_url":"https://api.github.com/repos/crojewsk/island-troll-tribes/issues/events{/number}","events_url":"https://api.github.com/repos/crojewsk/island-troll-tribes/events","assignees_url":"https://api.github.com/repos/crojewsk/island-troll-tribes/assignees{/user}","branches_url":"https://api.github.com/repos/crojewsk/island-troll-tribes/branches{/branch}","tags_url":"https://api.github.com/repos/crojewsk/island-troll-tribes/tags","blobs_url":"https://api.github.com/repos/crojewsk/island-troll-tribes/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/crojewsk/island-troll-tribes/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/crojewsk/island-troll-tribes/git/refs{/sha}","trees_url":"https://api.github.com/repos/crojewsk/island-troll-tribes/git/trees{/sha}","statuses_url":"https://api.github.com/repos/crojewsk/island-troll-tribes/statuses/{sha}","languages_url":"https://api.github.com/repos/crojewsk/island-troll-tribes/languages","stargazers_url":"https://api.github.com/repos/crojewsk/island-troll-tribes/stargazers","contributors_url":"https://api.github.com/repos/crojewsk/island-troll-tribes/contributors","subscribers_url":"https://api.github.com/repos/crojewsk/island-troll-tribes/subscribers","subscription_url":"https://api.github.com/repos/crojewsk/island-troll-tribes/subscription","commits_url":"https://api.github.com/repos/crojewsk/island-troll-tribes/commits{/sha}","git_commits_url":"https://api.github.com/repos/crojewsk/island-troll-tribes/git/commits{/sha}","comments_url":"https://api.github.com/repos/crojewsk/island-troll-tribes/comments{/number}","issue_comment_url":"https://api.github.com/repos/crojewsk/island-troll-tribes/issues/comments{/number}","contents_url":"https://api.github.com/repos/crojewsk/island-troll-tribes/contents/{+path}","compare_url":"https://api.github.com/repos/crojewsk/island-troll-tribes/compare/{base}...{head}","merges_url":"https://api.github.com/repos/crojewsk/island-troll-tribes/merges","archive_url":"https://api.github.com/repos/crojewsk/island-troll-tribes/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/crojewsk/island-troll-tribes/downloads","issues_url":"https://api.github.com/repos/crojewsk/island-troll-tribes/issues{/number}","pulls_url":"https://api.github.com/repos/crojewsk/island-troll-tribes/pulls{/number}","milestones_url":"https://api.github.com/repos/crojewsk/island-troll-tribes/milestones{/number}","notifications_url":"https://api.github.com/repos/crojewsk/island-troll-tribes/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/crojewsk/island-troll-tribes/labels{/name}","releases_url":"https://api.github.com/repos/crojewsk/island-troll-tribes/releases{/id}","deployments_url":"https://api.github.com/repos/crojewsk/island-troll-tribes/deployments","created_at":"2015-09-10T22:31:18Z","updated_at":"2018-04-20T18:40:42Z","pushed_at":"2018-04-20T18:40:41Z","git_url":"git://github.com/crojewsk/island-troll-tribes.git","ssh_url":"git@github.com:crojewsk/island-troll-tribes.git","clone_url":"https://github.com/crojewsk/island-troll-tribes.git","svn_url":"https://github.com/crojewsk/island-troll-tribes","homepage":"","size":44826,"stargazers_count":0,"watchers_count":0,"language":"Objective-J","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"island-troll-tribes:master","ref":"master","sha":"c38db94d141954d6a4c41290427082c456296624","user":{"login":"island-troll-tribes","id":6307062,"avatar_url":"https://avatars3.githubusercontent.com/u/6307062?v=4","gravatar_id":"","url":"https://api.github.com/users/island-troll-tribes","html_url":"https://github.com/island-troll-tribes","followers_url":"https://api.github.com/users/island-troll-tribes/followers","following_url":"https://api.github.com/users/island-troll-tribes/following{/other_user}","gists_url":"https://api.github.com/users/island-troll-tribes/gists{/gist_id}","starred_url":"https://api.github.com/users/island-troll-tribes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/island-troll-tribes/subscriptions","organizations_url":"https://api.github.com/users/island-troll-tribes/orgs","repos_url":"https://api.github.com/users/island-troll-tribes/repos","events_url":"https://api.github.com/users/island-troll-tribes/events{/privacy}","received_events_url":"https://api.github.com/users/island-troll-tribes/received_events","type":"Organization","site_admin":false},"repo":{"id":8150412,"name":"island-troll-tribes","full_name":"island-troll-tribes/island-troll-tribes","owner":{"login":"island-troll-tribes","id":6307062,"avatar_url":"https://avatars3.githubusercontent.com/u/6307062?v=4","gravatar_id":"","url":"https://api.github.com/users/island-troll-tribes","html_url":"https://github.com/island-troll-tribes","followers_url":"https://api.github.com/users/island-troll-tribes/followers","following_url":"https://api.github.com/users/island-troll-tribes/following{/other_user}","gists_url":"https://api.github.com/users/island-troll-tribes/gists{/gist_id}","starred_url":"https://api.github.com/users/island-troll-tribes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/island-troll-tribes/subscriptions","organizations_url":"https://api.github.com/users/island-troll-tribes/orgs","repos_url":"https://api.github.com/users/island-troll-tribes/repos","events_url":"https://api.github.com/users/island-troll-tribes/events{/privacy}","received_events_url":"https://api.github.com/users/island-troll-tribes/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/island-troll-tribes/island-troll-tribes","description":"Island Troll Tribes, a Warcraft III Custom Game","fork":false,"url":"https://api.github.com/repos/island-troll-tribes/island-troll-tribes","forks_url":"https://api.github.com/repos/island-troll-tribes/island-troll-tribes/forks","keys_url":"https://api.github.com/repos/island-troll-tribes/island-troll-tribes/keys{/key_id}","collaborators_url":"https://api.github.com/repos/island-troll-tribes/island-troll-tribes/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/island-troll-tribes/island-troll-tribes/teams","hooks_url":"https://api.github.com/repos/island-troll-tribes/island-troll-tribes/hooks","issue_events_url":"https://api.github.com/repos/island-troll-tribes/island-troll-tribes/issues/events{/number}","events_url":"https://api.github.com/repos/island-troll-tribes/island-troll-tribes/events","assignees_url":"https://api.github.com/repos/island-troll-tribes/island-troll-tribes/assignees{/user}","branches_url":"https://api.github.com/repos/island-troll-tribes/island-troll-tribes/branches{/branch}","tags_url":"https://api.github.com/repos/island-troll-tribes/island-troll-tribes/tags","blobs_url":"https://api.github.com/repos/island-troll-tribes/island-troll-tribes/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/island-troll-tribes/island-troll-tribes/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/island-troll-tribes/island-troll-tribes/git/refs{/sha}","trees_url":"https://api.github.com/repos/island-troll-tribes/island-troll-tribes/git/trees{/sha}","statuses_url":"https://api.github.com/repos/island-troll-tribes/island-troll-tribes/statuses/{sha}","languages_url":"https://api.github.com/repos/island-troll-tribes/island-troll-tribes/languages","stargazers_url":"https://api.github.com/repos/island-troll-tribes/island-troll-tribes/stargazers","contributors_url":"https://api.github.com/repos/island-troll-tribes/island-troll-tribes/contributors","subscribers_url":"https://api.github.com/repos/island-troll-tribes/island-troll-tribes/subscribers","subscription_url":"https://api.github.com/repos/island-troll-tribes/island-troll-tribes/subscription","commits_url":"https://api.github.com/repos/island-troll-tribes/island-troll-tribes/commits{/sha}","git_commits_url":"https://api.github.com/repos/island-troll-tribes/island-troll-tribes/git/commits{/sha}","comments_url":"https://api.github.com/repos/island-troll-tribes/island-troll-tribes/comments{/number}","issue_comment_url":"https://api.github.com/repos/island-troll-tribes/island-troll-tribes/issues/comments{/number}","contents_url":"https://api.github.com/repos/island-troll-tribes/island-troll-tribes/contents/{+path}","compare_url":"https://api.github.com/repos/island-troll-tribes/island-troll-tribes/compare/{base}...{head}","merges_url":"https://api.github.com/repos/island-troll-tribes/island-troll-tribes/merges","archive_url":"https://api.github.com/repos/island-troll-tribes/island-troll-tribes/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/island-troll-tribes/island-troll-tribes/downloads","issues_url":"https://api.github.com/repos/island-troll-tribes/island-troll-tribes/issues{/number}","pulls_url":"https://api.github.com/repos/island-troll-tribes/island-troll-tribes/pulls{/number}","milestones_url":"https://api.github.com/repos/island-troll-tribes/island-troll-tribes/milestones{/number}","notifications_url":"https://api.github.com/repos/island-troll-tribes/island-troll-tribes/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/island-troll-tribes/island-troll-tribes/labels{/name}","releases_url":"https://api.github.com/repos/island-troll-tribes/island-troll-tribes/releases{/id}","deployments_url":"https://api.github.com/repos/island-troll-tribes/island-troll-tribes/deployments","created_at":"2013-02-12T00:57:11Z","updated_at":"2018-04-12T00:05:28Z","pushed_at":"2018-04-20T18:41:23Z","git_url":"git://github.com/island-troll-tribes/island-troll-tribes.git","ssh_url":"git@github.com:island-troll-tribes/island-troll-tribes.git","clone_url":"https://github.com/island-troll-tribes/island-troll-tribes.git","svn_url":"https://github.com/island-troll-tribes/island-troll-tribes","homepage":"","size":44734,"stargazers_count":7,"watchers_count":7,"language":"Objective-J","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":8,"mirror_url":null,"archived":false,"open_issues_count":5,"license":null,"forks":8,"open_issues":5,"watchers":7,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/island-troll-tribes/island-troll-tribes/pulls/72"},"html":{"href":"https://github.com/island-troll-tribes/island-troll-tribes/pull/72"},"issue":{"href":"https://api.github.com/repos/island-troll-tribes/island-troll-tribes/issues/72"},"comments":{"href":"https://api.github.com/repos/island-troll-tribes/island-troll-tribes/issues/72/comments"},"review_comments":{"href":"https://api.github.com/repos/island-troll-tribes/island-troll-tribes/pulls/72/comments"},"review_comment":{"href":"https://api.github.com/repos/island-troll-tribes/island-troll-tribes/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/island-troll-tribes/island-troll-tribes/pulls/72/commits"},"statuses":{"href":"https://api.github.com/repos/island-troll-tribes/island-troll-tribes/statuses/7585d05ea56355f6e1e5d7d62b56de126a3db6f0"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"jonathanmclaus"}}