{"action":"created","issue":{"url":"https://api.github.com/repos/magefree/mage/issues/2724","repository_url":"https://api.github.com/repos/magefree/mage","labels_url":"https://api.github.com/repos/magefree/mage/issues/2724/labels{/name}","comments_url":"https://api.github.com/repos/magefree/mage/issues/2724/comments","events_url":"https://api.github.com/repos/magefree/mage/issues/2724/events","html_url":"https://github.com/magefree/mage/pull/2724","id":197787758,"number":2724,"title":"Beginning steps for banding.","user":{"login":"MTGfan","id":23157485,"avatar_url":"https://avatars.githubusercontent.com/u/23157485?v=3","gravatar_id":"","url":"https://api.github.com/users/MTGfan","html_url":"https://github.com/MTGfan","followers_url":"https://api.github.com/users/MTGfan/followers","following_url":"https://api.github.com/users/MTGfan/following{/other_user}","gists_url":"https://api.github.com/users/MTGfan/gists{/gist_id}","starred_url":"https://api.github.com/users/MTGfan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MTGfan/subscriptions","organizations_url":"https://api.github.com/users/MTGfan/orgs","repos_url":"https://api.github.com/users/MTGfan/repos","events_url":"https://api.github.com/users/MTGfan/events{/privacy}","received_events_url":"https://api.github.com/users/MTGfan/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-12-28T02:54:50Z","updated_at":"2016-12-28T07:24:45Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/magefree/mage/pulls/2724","html_url":"https://github.com/magefree/mage/pull/2724","diff_url":"https://github.com/magefree/mage/pull/2724.diff","patch_url":"https://github.com/magefree/mage/pull/2724.patch"},"body":"Ok I'm going to tackle banding next. This will allow for 41 cards to be added that are not in xmage yet since banding is not completely implemented. It appears that someone previously added some code as there are notations of TODO .....banding..... This is my understanding of the following code:\r\n\r\n\r\n\r\n`    public void addBlockingGroup(UUID blockerId, UUID attackerId, UUID playerId, Game game) {`\r\n\r\nIdentify the blocker\r\n`        Permanent blocker = game.getPermanent(blockerId);`\r\n\r\nCheck for null pointers and that the blocker is blocking a group of attackers (aka band).\r\n`        if (blockerId != null && blocker != null && blocker.getBlocking() > 1) {`\r\n\r\nIf blocker is not already assigned to block something other blockers were assigned to then create a new group where this blocker is the first in the group\r\n```\r\n            if (!blockingGroups.containsKey(blockerId)) {\r\n                CombatGroup newGroup = new CombatGroup(playerId, false, playerId);\r\n                newGroup.blockers.add(blockerId);\r\n```\r\nthen make sure all creatures in the attacking band are added as creatures blocked by this new group. And add the new group to the list of groups of blockers.\r\n```\r\n                // add all blocked attackers\r\n                for (CombatGroup group : groups) {\r\n                    if (group.getBlockers().contains(blockerId)) {\r\n                        // take into account banding\r\n                        for (UUID attacker : group.attackers) {\r\n                            newGroup.attackers.add(attacker);\r\n                        }\r\n                    }\r\n                }\r\n                blockingGroups.put(blockerId, newGroup);\r\n```\r\nOtherwise a group already exists with this blocker and all creatures in the attacking band need to be added as blocked by the group the blocker is already in.\r\n```\r\n            } else {\r\n                //TODO: handle banding\r\n                //blockingGroups.get(blockerId).attackers.add(attackerId);\r\n                for (CombatGroup group : groups) {\r\n                    if (group.getBlockers().contains(blockerId)) {\r\n                        for (UUID attacker : group.attackers) {\r\n                            blockingGroups.get(blockerId).attackers.add(attacker);\r\n                        }\r\n                    }\r\n                }\r\n            }\r\n        }\r\n    }\r\n```\r\n\r\nDoes this look correct for how this method is supposed to work? Oh and there are the bands with others cards that should go hand in hand once this is done."},"comment":{"url":"https://api.github.com/repos/magefree/mage/issues/comments/269437707","html_url":"https://github.com/magefree/mage/pull/2724#issuecomment-269437707","issue_url":"https://api.github.com/repos/magefree/mage/issues/2724","id":269437707,"user":{"login":"LevelX2","id":2066790,"avatar_url":"https://avatars.githubusercontent.com/u/2066790?v=3","gravatar_id":"","url":"https://api.github.com/users/LevelX2","html_url":"https://github.com/LevelX2","followers_url":"https://api.github.com/users/LevelX2/followers","following_url":"https://api.github.com/users/LevelX2/following{/other_user}","gists_url":"https://api.github.com/users/LevelX2/gists{/gist_id}","starred_url":"https://api.github.com/users/LevelX2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LevelX2/subscriptions","organizations_url":"https://api.github.com/users/LevelX2/orgs","repos_url":"https://api.github.com/users/LevelX2/repos","events_url":"https://api.github.com/users/LevelX2/events{/privacy}","received_events_url":"https://api.github.com/users/LevelX2/received_events","type":"User","site_admin":false},"created_at":"2016-12-28T07:24:45Z","updated_at":"2016-12-28T07:24:45Z","body":"This will need probably a lot of UI changes/additions so I don't recommend to do it.\r\n\r\nFirst thing to do (you don't mention) the attacker has to be able to form bands and it has to be shown, which creatures are banded to all players."}}
{"actor":{"display_login":"LevelX2"}}