{"action":"created","issue":{"url":"https://api.github.com/repos/IIC2233-2016-1/syllabus/issues/195","repository_url":"https://api.github.com/repos/IIC2233-2016-1/syllabus","labels_url":"https://api.github.com/repos/IIC2233-2016-1/syllabus/issues/195/labels{/name}","comments_url":"https://api.github.com/repos/IIC2233-2016-1/syllabus/issues/195/comments","events_url":"https://api.github.com/repos/IIC2233-2016-1/syllabus/issues/195/events","html_url":"https://github.com/IIC2233-2016-1/syllabus/issues/195","id":145436395,"number":195,"title":"Duda con atributos interfaz","user":{"login":"agmardones","id":13753000,"avatar_url":"https://avatars.githubusercontent.com/u/13753000?v=3","gravatar_id":"","url":"https://api.github.com/users/agmardones","html_url":"https://github.com/agmardones","followers_url":"https://api.github.com/users/agmardones/followers","following_url":"https://api.github.com/users/agmardones/following{/other_user}","gists_url":"https://api.github.com/users/agmardones/gists{/gist_id}","starred_url":"https://api.github.com/users/agmardones/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/agmardones/subscriptions","organizations_url":"https://api.github.com/users/agmardones/orgs","repos_url":"https://api.github.com/users/agmardones/repos","events_url":"https://api.github.com/users/agmardones/events{/privacy}","received_events_url":"https://api.github.com/users/agmardones/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/IIC2233-2016-1/syllabus/labels/Tarea%202","name":"Tarea 2","color":"0052cc"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-04-03T00:37:30Z","updated_at":"2016-04-03T03:23:42Z","closed_at":null,"body":"No entiendo bien la relación de la gui y la interfaz:\r\n\r\nTengo creada la grid correspondiente a cada juego y quiero asignársela a la interfaz (debería?). Cuando intento algo como:\r\n```python\r\nimport gui\r\nfrom gui.variables import variables\r\ndef create_grid():\r\n    ...\r\n    return grid\r\nclass MyInterface(gui.GameInterface):\r\n    grid = None\r\n...\r\n...\r\ninterfaz = MyInterface()\r\ninterfaz.grid = create_grid()\r\ngui.set_game_interface(interfaz)\r\ngui.run()\r\n```\r\nAl momento de pasar el mouse por alguna pieza y llamar a ```piece_section_entered``` (dentro de ella intento iterar sobre la grid) me dice que MyInterface.grid es None\r\nLo otro que intente fue:\r\n```python\r\nimport gui\r\nfrom gui.variables import variables\r\ndef create_grid():\r\n    ...\r\n    return grid\r\n\r\nclass MyInterface(gui.GameInterface):\r\n    grid = create_grid()\r\n...\r\n...\r\ngui.set_game_interface(MyInterface())\r\ngui.run()\r\n```\r\no \r\n```python\r\nimport gui\r\nfrom gui.variables import variables\r\nclass MyInterface(gui.GameInterface):\r\n    grid = None\r\n...\r\n   def create_grid(self):\r\n        ...\r\n        MyInterface.grid = grid # Generada por la funcion\r\n...\r\ngui.set_game_interface(MyInterface())\r\ngui.run()\r\n```\r\nEn ambos casos, al llamar a la función mencionada antes, recibo este error:\r\n\r\n```python\r\n    __game.addPiece(i, j, piece_type, on_move_ended, number)\r\nAttributeError: 'NoneType' object has no attribute 'addPiece'\r\n```\r\n\r\nEspero se entienda lo que estoy intentando hacer, quiero tener la grid para poder iterar en las funciones de la interfaz.\r\n"},"comment":{"url":"https://api.github.com/repos/IIC2233-2016-1/syllabus/issues/comments/204860878","html_url":"https://github.com/IIC2233-2016-1/syllabus/issues/195#issuecomment-204860878","issue_url":"https://api.github.com/repos/IIC2233-2016-1/syllabus/issues/195","id":204860878,"user":{"login":"agmardones","id":13753000,"avatar_url":"https://avatars.githubusercontent.com/u/13753000?v=3","gravatar_id":"","url":"https://api.github.com/users/agmardones","html_url":"https://github.com/agmardones","followers_url":"https://api.github.com/users/agmardones/followers","following_url":"https://api.github.com/users/agmardones/following{/other_user}","gists_url":"https://api.github.com/users/agmardones/gists{/gist_id}","starred_url":"https://api.github.com/users/agmardones/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/agmardones/subscriptions","organizations_url":"https://api.github.com/users/agmardones/orgs","repos_url":"https://api.github.com/users/agmardones/repos","events_url":"https://api.github.com/users/agmardones/events{/privacy}","received_events_url":"https://api.github.com/users/agmardones/received_events","type":"User","site_admin":false},"created_at":"2016-04-03T03:23:41Z","updated_at":"2016-04-03T03:23:41Z","body":"Sí, lo puse antes de la definición de la clase de interfaz. Gracias @MainScientist "}}