{"action":"created","comment":{"url":"https://api.github.com/repos/triplea-game/triplea/pulls/comments/47580549","id":47580549,"diff_hunk":"@@ -48,147 +46,95 @@\n  */\n public class ProCombatMoveAI {\n \n-  // Utilities\n   private final ProAI ai;\n-  private final ProTransportUtils transportUtils;\n-  private final ProMoveOptionsUtils attackOptionsUtils;\n-  private final ProTerritoryValueUtils territoryValueUtils;\n-\n-  // Current data\n   private GameData data;\n   private PlayerID player;\n-  private Territory myCapital;\n+  private ProTerritoryManager territoryManager;\n   private boolean isDefensive;\n-  private double minCostPerHitPoint;\n \n-  public ProCombatMoveAI(final ProAI ai, final ProTransportUtils transportUtils,\n-      final ProMoveOptionsUtils attackOptionsUtils, final ProTerritoryValueUtils territoryValueUtils) {\n+  public ProCombatMoveAI(final ProAI ai) {\n     this.ai = ai;\n-    this.transportUtils = transportUtils;\n-    this.attackOptionsUtils = attackOptionsUtils;\n-    this.territoryValueUtils = territoryValueUtils;\n   }\n \n-  public Map<Territory, ProTerritory> doCombatMove(final IMoveDelegate moveDel, final GameData data,\n-      final PlayerID player, final boolean isSimulation) {\n+  public Map<Territory, ProTerritory> doCombatMove(final IMoveDelegate moveDel, final boolean isSimulation) {\n     ProLogger.info(\"Starting combat move phase\");\n \n     // Current data at the start of combat move\n-    this.data = data;\n-    this.player = player;\n-\n-    myCapital = TerritoryAttachment.getFirstOwnedCapitalOrFirstUnownedCapital(player, data);\n-\n-    // Initialize data containers\n-    final Map<Territory, ProTerritory> attackMap = new HashMap<Territory, ProTerritory>();\n-    final Map<Unit, Set<Territory>> unitAttackMap = new HashMap<Unit, Set<Territory>>();\n-    final Map<Unit, Set<Territory>> transportAttackMap = new HashMap<Unit, Set<Territory>>();\n-    final Map<Unit, Set<Territory>> bombardMap = new HashMap<Unit, Set<Territory>>();\n-    final List<ProTransport> transportMapList = new ArrayList<ProTransport>();\n+    data = ProData.getData();\n+    player = ProData.getPlayer();\n+    territoryManager = new ProTerritoryManager();\n \n     // Determine whether capital is threatened and I should be in a defensive stance\n-    isDefensive = !ProBattleUtils.territoryHasLocalLandSuperiority(myCapital, 3, player);\n+    isDefensive = !ProBattleUtils.territoryHasLocalLandSuperiority(ProData.myCapital, 3, player);","path":"src/games/strategy/triplea/ai/proAI/ProCombatMoveAI.java","position":84,"original_position":84,"commit_id":"11c407a33c7b980c28c82ef18a8abc5bad88684a","original_commit_id":"aef98baa040a01412ea6302ec1f7ce18125b2d96","user":{"login":"ron-murhammer","id":1427689,"avatar_url":"https://avatars.githubusercontent.com/u/1427689?v=3","gravatar_id":"","url":"https://api.github.com/users/ron-murhammer","html_url":"https://github.com/ron-murhammer","followers_url":"https://api.github.com/users/ron-murhammer/followers","following_url":"https://api.github.com/users/ron-murhammer/following{/other_user}","gists_url":"https://api.github.com/users/ron-murhammer/gists{/gist_id}","starred_url":"https://api.github.com/users/ron-murhammer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ron-murhammer/subscriptions","organizations_url":"https://api.github.com/users/ron-murhammer/orgs","repos_url":"https://api.github.com/users/ron-murhammer/repos","events_url":"https://api.github.com/users/ron-murhammer/events{/privacy}","received_events_url":"https://api.github.com/users/ron-murhammer/received_events","type":"User","site_admin":false},"body":"Yep. Created some static constants to reference.","created_at":"2015-12-15T00:20:02Z","updated_at":"2015-12-15T00:20:02Z","html_url":"https://github.com/triplea-game/triplea/pull/291#discussion_r47580549","pull_request_url":"https://api.github.com/repos/triplea-game/triplea/pulls/291","_links":{"self":{"href":"https://api.github.com/repos/triplea-game/triplea/pulls/comments/47580549"},"html":{"href":"https://github.com/triplea-game/triplea/pull/291#discussion_r47580549"},"pull_request":{"href":"https://api.github.com/repos/triplea-game/triplea/pulls/291"}}},"pull_request":{"url":"https://api.github.com/repos/triplea-game/triplea/pulls/291","id":53524351,"html_url":"https://github.com/triplea-game/triplea/pull/291","diff_url":"https://github.com/triplea-game/triplea/pull/291.diff","patch_url":"https://github.com/triplea-game/triplea/pull/291.patch","issue_url":"https://api.github.com/repos/triplea-game/triplea/issues/291","number":291,"state":"open","locked":false,"title":"Ai refactor territory manager","user":{"login":"ron-murhammer","id":1427689,"avatar_url":"https://avatars.githubusercontent.com/u/1427689?v=3","gravatar_id":"","url":"https://api.github.com/users/ron-murhammer","html_url":"https://github.com/ron-murhammer","followers_url":"https://api.github.com/users/ron-murhammer/followers","following_url":"https://api.github.com/users/ron-murhammer/following{/other_user}","gists_url":"https://api.github.com/users/ron-murhammer/gists{/gist_id}","starred_url":"https://api.github.com/users/ron-murhammer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ron-murhammer/subscriptions","organizations_url":"https://api.github.com/users/ron-murhammer/orgs","repos_url":"https://api.github.com/users/ron-murhammer/repos","events_url":"https://api.github.com/users/ron-murhammer/events{/privacy}","received_events_url":"https://api.github.com/users/ron-murhammer/received_events","type":"User","site_admin":false},"body":"Refactored AI to use TerritoryManager to centralize data around territories and units.\n\n<!-- Reviewable:start -->\n[<img src=\"https://reviewable.io/review_button.png\" height=40 alt=\"Review on Reviewable\"/>](https://reviewable.io/reviews/triplea-game/triplea/291)\n<!-- Reviewable:end -->\n","created_at":"2015-12-14T04:44:55Z","updated_at":"2015-12-15T00:20:02Z","closed_at":null,"merged_at":null,"merge_commit_sha":"207d440a0726d7ec8bb01ebdcd084924f682cdee","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/triplea-game/triplea/pulls/291/commits","review_comments_url":"https://api.github.com/repos/triplea-game/triplea/pulls/291/comments","review_comment_url":"https://api.github.com/repos/triplea-game/triplea/pulls/comments{/number}","comments_url":"https://api.github.com/repos/triplea-game/triplea/issues/291/comments","statuses_url":"https://api.github.com/repos/triplea-game/triplea/statuses/11c407a33c7b980c28c82ef18a8abc5bad88684a","head":{"label":"triplea-game:AI_Refactor_TerritoryManager","ref":"AI_Refactor_TerritoryManager","sha":"11c407a33c7b980c28c82ef18a8abc5bad88684a","user":{"login":"triplea-game","id":13318615,"avatar_url":"https://avatars.githubusercontent.com/u/13318615?v=3","gravatar_id":"","url":"https://api.github.com/users/triplea-game","html_url":"https://github.com/triplea-game","followers_url":"https://api.github.com/users/triplea-game/followers","following_url":"https://api.github.com/users/triplea-game/following{/other_user}","gists_url":"https://api.github.com/users/triplea-game/gists{/gist_id}","starred_url":"https://api.github.com/users/triplea-game/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/triplea-game/subscriptions","organizations_url":"https://api.github.com/users/triplea-game/orgs","repos_url":"https://api.github.com/users/triplea-game/repos","events_url":"https://api.github.com/users/triplea-game/events{/privacy}","received_events_url":"https://api.github.com/users/triplea-game/received_events","type":"Organization","site_admin":false},"repo":{"id":39766308,"name":"triplea","full_name":"triplea-game/triplea","owner":{"login":"triplea-game","id":13318615,"avatar_url":"https://avatars.githubusercontent.com/u/13318615?v=3","gravatar_id":"","url":"https://api.github.com/users/triplea-game","html_url":"https://github.com/triplea-game","followers_url":"https://api.github.com/users/triplea-game/followers","following_url":"https://api.github.com/users/triplea-game/following{/other_user}","gists_url":"https://api.github.com/users/triplea-game/gists{/gist_id}","starred_url":"https://api.github.com/users/triplea-game/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/triplea-game/subscriptions","organizations_url":"https://api.github.com/users/triplea-game/orgs","repos_url":"https://api.github.com/users/triplea-game/repos","events_url":"https://api.github.com/users/triplea-game/events{/privacy}","received_events_url":"https://api.github.com/users/triplea-game/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/triplea-game/triplea","description":"TripleA is a turn based strategy game and board game engine, similar to Axis & Allies or Risk.","fork":false,"url":"https://api.github.com/repos/triplea-game/triplea","forks_url":"https://api.github.com/repos/triplea-game/triplea/forks","keys_url":"https://api.github.com/repos/triplea-game/triplea/keys{/key_id}","collaborators_url":"https://api.github.com/repos/triplea-game/triplea/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/triplea-game/triplea/teams","hooks_url":"https://api.github.com/repos/triplea-game/triplea/hooks","issue_events_url":"https://api.github.com/repos/triplea-game/triplea/issues/events{/number}","events_url":"https://api.github.com/repos/triplea-game/triplea/events","assignees_url":"https://api.github.com/repos/triplea-game/triplea/assignees{/user}","branches_url":"https://api.github.com/repos/triplea-game/triplea/branches{/branch}","tags_url":"https://api.github.com/repos/triplea-game/triplea/tags","blobs_url":"https://api.github.com/repos/triplea-game/triplea/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/triplea-game/triplea/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/triplea-game/triplea/git/refs{/sha}","trees_url":"https://api.github.com/repos/triplea-game/triplea/git/trees{/sha}","statuses_url":"https://api.github.com/repos/triplea-game/triplea/statuses/{sha}","languages_url":"https://api.github.com/repos/triplea-game/triplea/languages","stargazers_url":"https://api.github.com/repos/triplea-game/triplea/stargazers","contributors_url":"https://api.github.com/repos/triplea-game/triplea/contributors","subscribers_url":"https://api.github.com/repos/triplea-game/triplea/subscribers","subscription_url":"https://api.github.com/repos/triplea-game/triplea/subscription","commits_url":"https://api.github.com/repos/triplea-game/triplea/commits{/sha}","git_commits_url":"https://api.github.com/repos/triplea-game/triplea/git/commits{/sha}","comments_url":"https://api.github.com/repos/triplea-game/triplea/comments{/number}","issue_comment_url":"https://api.github.com/repos/triplea-game/triplea/issues/comments{/number}","contents_url":"https://api.github.com/repos/triplea-game/triplea/contents/{+path}","compare_url":"https://api.github.com/repos/triplea-game/triplea/compare/{base}...{head}","merges_url":"https://api.github.com/repos/triplea-game/triplea/merges","archive_url":"https://api.github.com/repos/triplea-game/triplea/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/triplea-game/triplea/downloads","issues_url":"https://api.github.com/repos/triplea-game/triplea/issues{/number}","pulls_url":"https://api.github.com/repos/triplea-game/triplea/pulls{/number}","milestones_url":"https://api.github.com/repos/triplea-game/triplea/milestones{/number}","notifications_url":"https://api.github.com/repos/triplea-game/triplea/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/triplea-game/triplea/labels{/name}","releases_url":"https://api.github.com/repos/triplea-game/triplea/releases{/id}","created_at":"2015-07-27T09:32:58Z","updated_at":"2015-12-12T01:06:13Z","pushed_at":"2015-12-14T23:35:48Z","git_url":"git://github.com/triplea-game/triplea.git","ssh_url":"git@github.com:triplea-game/triplea.git","clone_url":"https://github.com/triplea-game/triplea.git","svn_url":"https://github.com/triplea-game/triplea","homepage":null,"size":686561,"stargazers_count":14,"watchers_count":14,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":29,"forks":4,"open_issues":29,"watchers":14,"default_branch":"master"}},"base":{"label":"triplea-game:master","ref":"master","sha":"9984dc6c6eb3f135066100946b1fb9715d609084","user":{"login":"triplea-game","id":13318615,"avatar_url":"https://avatars.githubusercontent.com/u/13318615?v=3","gravatar_id":"","url":"https://api.github.com/users/triplea-game","html_url":"https://github.com/triplea-game","followers_url":"https://api.github.com/users/triplea-game/followers","following_url":"https://api.github.com/users/triplea-game/following{/other_user}","gists_url":"https://api.github.com/users/triplea-game/gists{/gist_id}","starred_url":"https://api.github.com/users/triplea-game/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/triplea-game/subscriptions","organizations_url":"https://api.github.com/users/triplea-game/orgs","repos_url":"https://api.github.com/users/triplea-game/repos","events_url":"https://api.github.com/users/triplea-game/events{/privacy}","received_events_url":"https://api.github.com/users/triplea-game/received_events","type":"Organization","site_admin":false},"repo":{"id":39766308,"name":"triplea","full_name":"triplea-game/triplea","owner":{"login":"triplea-game","id":13318615,"avatar_url":"https://avatars.githubusercontent.com/u/13318615?v=3","gravatar_id":"","url":"https://api.github.com/users/triplea-game","html_url":"https://github.com/triplea-game","followers_url":"https://api.github.com/users/triplea-game/followers","following_url":"https://api.github.com/users/triplea-game/following{/other_user}","gists_url":"https://api.github.com/users/triplea-game/gists{/gist_id}","starred_url":"https://api.github.com/users/triplea-game/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/triplea-game/subscriptions","organizations_url":"https://api.github.com/users/triplea-game/orgs","repos_url":"https://api.github.com/users/triplea-game/repos","events_url":"https://api.github.com/users/triplea-game/events{/privacy}","received_events_url":"https://api.github.com/users/triplea-game/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/triplea-game/triplea","description":"TripleA is a turn based strategy game and board game engine, similar to Axis & Allies or Risk.","fork":false,"url":"https://api.github.com/repos/triplea-game/triplea","forks_url":"https://api.github.com/repos/triplea-game/triplea/forks","keys_url":"https://api.github.com/repos/triplea-game/triplea/keys{/key_id}","collaborators_url":"https://api.github.com/repos/triplea-game/triplea/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/triplea-game/triplea/teams","hooks_url":"https://api.github.com/repos/triplea-game/triplea/hooks","issue_events_url":"https://api.github.com/repos/triplea-game/triplea/issues/events{/number}","events_url":"https://api.github.com/repos/triplea-game/triplea/events","assignees_url":"https://api.github.com/repos/triplea-game/triplea/assignees{/user}","branches_url":"https://api.github.com/repos/triplea-game/triplea/branches{/branch}","tags_url":"https://api.github.com/repos/triplea-game/triplea/tags","blobs_url":"https://api.github.com/repos/triplea-game/triplea/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/triplea-game/triplea/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/triplea-game/triplea/git/refs{/sha}","trees_url":"https://api.github.com/repos/triplea-game/triplea/git/trees{/sha}","statuses_url":"https://api.github.com/repos/triplea-game/triplea/statuses/{sha}","languages_url":"https://api.github.com/repos/triplea-game/triplea/languages","stargazers_url":"https://api.github.com/repos/triplea-game/triplea/stargazers","contributors_url":"https://api.github.com/repos/triplea-game/triplea/contributors","subscribers_url":"https://api.github.com/repos/triplea-game/triplea/subscribers","subscription_url":"https://api.github.com/repos/triplea-game/triplea/subscription","commits_url":"https://api.github.com/repos/triplea-game/triplea/commits{/sha}","git_commits_url":"https://api.github.com/repos/triplea-game/triplea/git/commits{/sha}","comments_url":"https://api.github.com/repos/triplea-game/triplea/comments{/number}","issue_comment_url":"https://api.github.com/repos/triplea-game/triplea/issues/comments{/number}","contents_url":"https://api.github.com/repos/triplea-game/triplea/contents/{+path}","compare_url":"https://api.github.com/repos/triplea-game/triplea/compare/{base}...{head}","merges_url":"https://api.github.com/repos/triplea-game/triplea/merges","archive_url":"https://api.github.com/repos/triplea-game/triplea/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/triplea-game/triplea/downloads","issues_url":"https://api.github.com/repos/triplea-game/triplea/issues{/number}","pulls_url":"https://api.github.com/repos/triplea-game/triplea/pulls{/number}","milestones_url":"https://api.github.com/repos/triplea-game/triplea/milestones{/number}","notifications_url":"https://api.github.com/repos/triplea-game/triplea/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/triplea-game/triplea/labels{/name}","releases_url":"https://api.github.com/repos/triplea-game/triplea/releases{/id}","created_at":"2015-07-27T09:32:58Z","updated_at":"2015-12-12T01:06:13Z","pushed_at":"2015-12-14T23:35:48Z","git_url":"git://github.com/triplea-game/triplea.git","ssh_url":"git@github.com:triplea-game/triplea.git","clone_url":"https://github.com/triplea-game/triplea.git","svn_url":"https://github.com/triplea-game/triplea","homepage":null,"size":686561,"stargazers_count":14,"watchers_count":14,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":29,"forks":4,"open_issues":29,"watchers":14,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/triplea-game/triplea/pulls/291"},"html":{"href":"https://github.com/triplea-game/triplea/pull/291"},"issue":{"href":"https://api.github.com/repos/triplea-game/triplea/issues/291"},"comments":{"href":"https://api.github.com/repos/triplea-game/triplea/issues/291/comments"},"review_comments":{"href":"https://api.github.com/repos/triplea-game/triplea/pulls/291/comments"},"review_comment":{"href":"https://api.github.com/repos/triplea-game/triplea/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/triplea-game/triplea/pulls/291/commits"},"statuses":{"href":"https://api.github.com/repos/triplea-game/triplea/statuses/11c407a33c7b980c28c82ef18a8abc5bad88684a"}}}}