{"action":"closed","issue":{"url":"https://api.github.com/repos/Topsuk/Testi-koodeja/issues/6","repository_url":"https://api.github.com/repos/Topsuk/Testi-koodeja","labels_url":"https://api.github.com/repos/Topsuk/Testi-koodeja/issues/6/labels{/name}","comments_url":"https://api.github.com/repos/Topsuk/Testi-koodeja/issues/6/comments","events_url":"https://api.github.com/repos/Topsuk/Testi-koodeja/issues/6/events","html_url":"https://github.com/Topsuk/Testi-koodeja/issues/6","id":297003338,"number":6,"title":"Gamecontroller 2","user":{"login":"Topsuk","id":34268842,"avatar_url":"https://avatars1.githubusercontent.com/u/34268842?v=4","gravatar_id":"","url":"https://api.github.com/users/Topsuk","html_url":"https://github.com/Topsuk","followers_url":"https://api.github.com/users/Topsuk/followers","following_url":"https://api.github.com/users/Topsuk/following{/other_user}","gists_url":"https://api.github.com/users/Topsuk/gists{/gist_id}","starred_url":"https://api.github.com/users/Topsuk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Topsuk/subscriptions","organizations_url":"https://api.github.com/users/Topsuk/orgs","repos_url":"https://api.github.com/users/Topsuk/repos","events_url":"https://api.github.com/users/Topsuk/events{/privacy}","received_events_url":"https://api.github.com/users/Topsuk/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-02-14T07:49:27Z","updated_at":"2018-03-29T12:45:05Z","closed_at":"2018-03-29T12:45:05Z","author_association":"OWNER","body":"using System.Collections;\r\nusing System.Collections.Generic;\r\nusing UnityEngine;\r\nusing UnityEngine.UI;\r\nusing System.Threading;\r\n\r\npublic class GameController : MonoBehaviour\r\n{\r\n\r\n\r\n\tprivate Button buttonDraw;\r\n\tprivate Button buttonHold;\r\n\tprivate Button buttonStart;\r\n\tprivate Text youDraw;\r\n\tprivate Text enemyDraw;\r\n\tprivate int start = -1;\r\n\t//\tprivate int end = 1;\r\n\t//\tprivate Text numbersText;\r\n\r\n\tprivate Die noppa1;\r\n\tprivate\tPlayer pelaaja1;\r\n\tprivate Player pelaaja2;\r\n\r\n\r\n\r\n\t//\tprivate int cardsDrawn = 0;\r\n\t//\tDie d1 = new Die ();\r\n\t//  Player p1 = new Player (d1);\r\n\r\n\r\n\t//\tprivate Player player = new Player ();\r\n\tprivate Dictionary <Button, GameItem> buttonItemMap = new Dictionary <Button, GameItem> ();\r\n\r\n\r\n\t//\t\tpublic Player (Die myDie)\r\n\r\n\r\n\r\n\r\n\t \t\r\n\r\n\tvoid Start ()\r\n\t{\r\n\r\n\r\n\t\tbuttonDraw = GameObject.Find (\"ButtonDraw\").GetComponent<Button> ();\r\n\t\tbuttonHold = GameObject.Find (\"ButtonHold\").GetComponent<Button> ();\r\n\t\tbuttonStart = GameObject.Find (\"ButtonStart\").GetComponent<Button> ();\r\n\r\n\t\tenemyDraw = GameObject.Find (\"TextEnemyDraw\").GetComponent<Text> ();\r\n\t\tyouDraw = GameObject.Find (\"TextYouDraw\").GetComponent<Text> ();\r\n\t\t//\tnumbersText = GameObject.Find (\"TextNumbers\").GetComponent<Text> ();\r\n\r\n\r\n\t\tbuttonItemMap.Add (buttonDraw, new GameItem (\"Draw\"));\r\n\t\tbuttonItemMap.Add (buttonHold, new GameItem (\"Hold\"));\r\n\t\r\n\t\tbuttonStart.onClick.AddListener (() => StartGame (buttonStart));\r\n\r\n\t\tnoppa1 = new Die ();\r\n\t\tpelaaja1 = new Player (noppa1);\r\n\t\tpelaaja2 = new Player (noppa1);\r\n\t\t\t\r\n\r\n\r\n\t}\r\n\r\n\tprivate void StartGame (Button a)\r\n\t{\r\n//\t\tDebug.Log (buttonItemMap [b].GetName ());\r\n\r\n\t\tDebug.Log (\"testi2\");\r\n\r\n\t\tstart++;\r\n\r\n\t\tif (start == 0) {\r\n\t\t\tbuttonDraw.onClick.AddListener (() => DrawCard (buttonDraw));\r\n\t\t\tbuttonHold.onClick.AddListener (() => Hold (buttonHold));\r\n\r\n\t\t}\r\n\t}\r\n\r\n\tprivate void DrawCard (Button c)\r\n\t{\r\n\t\tDebug.Log (\"Testi3\");\r\n\r\n\t\r\n\t\tpelaaja1.Throw ();\t\r\n\t\tpelaaja2.Throw ();\r\n\r\n\t\r\n\r\n\t\tyouDraw.text = \"You Drew: \" + pelaaja1.PrintNumbers ();\r\n\t\t//\tenemyDraw.text = \"Enemy Drew: \" + pelaaja2.PrintNumbers ();\r\n\t\r\n\t\tDebug.Log (\"testi5\");\r\n\r\n\t}\r\n\t\t\r\n\tprivate void Hold (Button d)\r\n\t{\r\n\r\n\t\tDebug.Log (\"testi4\");\r\n\t}\r\n\r\n}\r\n\r\n/* Heitto kuntoon\r\n * Ennen vastustajan heittoa arpoo holdaako vai ei\r\n * 15 tappaa kortin nostajan\r\n * Ei nosta nosta noppaa jos on jo nostettu.\r\n * \r\n * Reverse list. Pistää listalle numeron. Jos on o listalla arpoo uuden numeron.\r\n * \r\n * \r\n * \r\n * \r\n * \r\n * \r\n * \r\n */"}}
{"actor":{"display_login":"Topsuk"}}