{"action":"created","issue":{"url":"https://api.github.com/repos/utilForever/Hearthstonepp/issues/61","repository_url":"https://api.github.com/repos/utilForever/Hearthstonepp","labels_url":"https://api.github.com/repos/utilForever/Hearthstonepp/issues/61/labels{/name}","comments_url":"https://api.github.com/repos/utilForever/Hearthstonepp/issues/61/comments","events_url":"https://api.github.com/repos/utilForever/Hearthstonepp/issues/61/events","html_url":"https://github.com/utilForever/Hearthstonepp/pull/61","id":322556851,"number":61,"title":"Improve enum to string, string to enum structure using better-enums (#55)","user":{"login":"utilForever","id":5622661,"avatar_url":"https://avatars2.githubusercontent.com/u/5622661?v=4","gravatar_id":"","url":"https://api.github.com/users/utilForever","html_url":"https://github.com/utilForever","followers_url":"https://api.github.com/users/utilForever/followers","following_url":"https://api.github.com/users/utilForever/following{/other_user}","gists_url":"https://api.github.com/users/utilForever/gists{/gist_id}","starred_url":"https://api.github.com/users/utilForever/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/utilForever/subscriptions","organizations_url":"https://api.github.com/users/utilForever/orgs","repos_url":"https://api.github.com/users/utilForever/repos","events_url":"https://api.github.com/users/utilForever/events{/privacy}","received_events_url":"https://api.github.com/users/utilForever/received_events","type":"User","site_admin":false},"labels":[{"id":701097690,"url":"https://api.github.com/repos/utilForever/Hearthstonepp/labels/Improvement","name":"Improvement","color":"1d76db","default":false},{"id":673184411,"url":"https://api.github.com/repos/utilForever/Hearthstonepp/labels/Review","name":"Review","color":"b19cd9","default":false}],"state":"open","locked":false,"assignee":{"login":"utilForever","id":5622661,"avatar_url":"https://avatars2.githubusercontent.com/u/5622661?v=4","gravatar_id":"","url":"https://api.github.com/users/utilForever","html_url":"https://github.com/utilForever","followers_url":"https://api.github.com/users/utilForever/followers","following_url":"https://api.github.com/users/utilForever/following{/other_user}","gists_url":"https://api.github.com/users/utilForever/gists{/gist_id}","starred_url":"https://api.github.com/users/utilForever/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/utilForever/subscriptions","organizations_url":"https://api.github.com/users/utilForever/orgs","repos_url":"https://api.github.com/users/utilForever/repos","events_url":"https://api.github.com/users/utilForever/events{/privacy}","received_events_url":"https://api.github.com/users/utilForever/received_events","type":"User","site_admin":false},"assignees":[{"login":"utilForever","id":5622661,"avatar_url":"https://avatars2.githubusercontent.com/u/5622661?v=4","gravatar_id":"","url":"https://api.github.com/users/utilForever","html_url":"https://github.com/utilForever","followers_url":"https://api.github.com/users/utilForever/followers","following_url":"https://api.github.com/users/utilForever/following{/other_user}","gists_url":"https://api.github.com/users/utilForever/gists{/gist_id}","starred_url":"https://api.github.com/users/utilForever/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/utilForever/subscriptions","organizations_url":"https://api.github.com/users/utilForever/orgs","repos_url":"https://api.github.com/users/utilForever/repos","events_url":"https://api.github.com/users/utilForever/events{/privacy}","received_events_url":"https://api.github.com/users/utilForever/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/utilForever/Hearthstonepp/milestones/2","html_url":"https://github.com/utilForever/Hearthstonepp/milestone/2","labels_url":"https://api.github.com/repos/utilForever/Hearthstonepp/milestones/2/labels","id":2899045,"number":2,"title":"Ver 0.2","description":"Implement basic card logic (aura, enchantment, hero power, weapon, battlecry, deathrattle and so on), separate console program code from Hearthstone++ library code, add simple GUI program and unit tests.","creator":{"login":"utilForever","id":5622661,"avatar_url":"https://avatars2.githubusercontent.com/u/5622661?v=4","gravatar_id":"","url":"https://api.github.com/users/utilForever","html_url":"https://github.com/utilForever","followers_url":"https://api.github.com/users/utilForever/followers","following_url":"https://api.github.com/users/utilForever/following{/other_user}","gists_url":"https://api.github.com/users/utilForever/gists{/gist_id}","starred_url":"https://api.github.com/users/utilForever/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/utilForever/subscriptions","organizations_url":"https://api.github.com/users/utilForever/orgs","repos_url":"https://api.github.com/users/utilForever/repos","events_url":"https://api.github.com/users/utilForever/events{/privacy}","received_events_url":"https://api.github.com/users/utilForever/received_events","type":"User","site_admin":false},"open_issues":10,"closed_issues":21,"state":"open","created_at":"2017-11-08T23:57:55Z","updated_at":"2018-05-13T06:36:52Z","due_on":null,"closed_at":null},"comments":4,"created_at":"2018-05-13T01:54:50Z","updated_at":"2018-05-14T03:35:49Z","closed_at":null,"author_association":"OWNER","pull_request":{"url":"https://api.github.com/repos/utilForever/Hearthstonepp/pulls/61","html_url":"https://github.com/utilForever/Hearthstonepp/pull/61","diff_url":"https://github.com/utilForever/Hearthstonepp/pull/61.diff","patch_url":"https://github.com/utilForever/Hearthstonepp/pull/61.patch"},"body":"하스스톤에는 수많은 열거체를 사용합니다. 하지만 JSON에는 열거체 형식이 아닌 문자열 형식으로 저장했었기 때문에 열거체와 문자열 사이의 변환을 위해 여러 map 변수를 만들어서 사용했었습니다. 하지만 열거체에 새로운 상수가 추가될 때마다 이 변수에도 추가 작업을 해줘야한다는 불편함이 있었습니다.\r\n이를 어떻게 개선할 수 있을까 고민하던 도중, 아는 분을 통해 better-enums라는 라이브러리를 들었고 열거체와 문자열을 쉽게 변환할 수 있다는 사실을 알게되었습니다. 이후 몇 가지 작업을 통해 기존 변수는 전부 삭제하고 코드를 대체했습니다.\r\nEnums.h에 보면 전처리문이 되어있는 부분을 확인할 수 있는데, 이 부분에 대해 설명하겠습니다. better-enums에서 열거체 상수 이름의 글자수는 23자, 상수의 개수는 64개로 제한되어 있습니다. 하지만 GameTag 열거체의 경우 상수의 개수가 64개가 넘습니다.\r\n다행이 better-enums의 제한을 확장하는 방법이 있습니다. 파이썬 스크립트를 통해 별도의 헤더 파일을 생성하면 됩니다. 하지만 Python2 문법으로 되어 있어서 Python3 문법으로 변환한 뒤 Scripts 폴더에 스크립트 파일을 추가했습니다.\r\n하지만 Visual Studio에서는 컴파일러 내부에서 매크로 인수의 개수를 127개로 제한하는 문제가 있었습니다. 따라서 전처리문을 통해 VS에서만 우회하는 방법을 선택했습니다. 나머지 플랫폼에서는 문제가 없으니 참고해주시기 바랍니다."},"comment":{"url":"https://api.github.com/repos/utilForever/Hearthstonepp/issues/comments/388687756","html_url":"https://github.com/utilForever/Hearthstonepp/pull/61#issuecomment-388687756","issue_url":"https://api.github.com/repos/utilForever/Hearthstonepp/issues/61","id":388687756,"user":{"login":"utilForever","id":5622661,"avatar_url":"https://avatars2.githubusercontent.com/u/5622661?v=4","gravatar_id":"","url":"https://api.github.com/users/utilForever","html_url":"https://github.com/utilForever","followers_url":"https://api.github.com/users/utilForever/followers","following_url":"https://api.github.com/users/utilForever/following{/other_user}","gists_url":"https://api.github.com/users/utilForever/gists{/gist_id}","starred_url":"https://api.github.com/users/utilForever/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/utilForever/subscriptions","organizations_url":"https://api.github.com/users/utilForever/orgs","repos_url":"https://api.github.com/users/utilForever/repos","events_url":"https://api.github.com/users/utilForever/events{/privacy}","received_events_url":"https://api.github.com/users/utilForever/received_events","type":"User","site_admin":false},"created_at":"2018-05-14T03:35:49Z","updated_at":"2018-05-14T03:35:49Z","author_association":"OWNER","body":"모두들 감사합니다. 머지하겠습니다."}}
{"actor":{"display_login":"utilForever"}}