{"action":"created","issue":{"url":"https://api.github.com/repos/colobot/colobot/issues/808","repository_url":"https://api.github.com/repos/colobot/colobot","labels_url":"https://api.github.com/repos/colobot/colobot/issues/808/labels{/name}","comments_url":"https://api.github.com/repos/colobot/colobot/issues/808/comments","events_url":"https://api.github.com/repos/colobot/colobot/issues/808/events","html_url":"https://github.com/colobot/colobot/pull/808","id":169320826,"number":808,"title":"Syntax sugar:  Accessing members of returned objects","user":{"login":"melex750","id":15256309,"avatar_url":"https://avatars.githubusercontent.com/u/15256309?v=3","gravatar_id":"","url":"https://api.github.com/users/melex750","html_url":"https://github.com/melex750","followers_url":"https://api.github.com/users/melex750/followers","following_url":"https://api.github.com/users/melex750/following{/other_user}","gists_url":"https://api.github.com/users/melex750/gists{/gist_id}","starred_url":"https://api.github.com/users/melex750/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/melex750/subscriptions","organizations_url":"https://api.github.com/users/melex750/orgs","repos_url":"https://api.github.com/users/melex750/repos","events_url":"https://api.github.com/users/melex750/events{/privacy}","received_events_url":"https://api.github.com/users/melex750/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":7,"created_at":"2016-08-04T08:37:56Z","updated_at":"2016-08-09T18:01:33Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/colobot/colobot/pulls/808","html_url":"https://github.com/colobot/colobot/pull/808","diff_url":"https://github.com/colobot/colobot/pull/808.diff","patch_url":"https://github.com/colobot/colobot/pull/808.patch"},"body":"**#384**\r\n```c++\r\nextern void object::New()\r\n{\r\n    goto( radar(Titanium).position );\r\n\r\n    bool b = radar(BotFactory).busy();\r\n}\r\n```\r\n**This also allows [method chaining](https://en.wikipedia.org/wiki/Method_chaining#Java):**\r\n```c++\r\n    AClass ac();\r\n     \" provided that each chained method returns \"this\"... \"\r\n\r\n    ac.SetInt(4).SetBool(true).SetFloat(3.14).SetString(\"str\");\r\n```\r\nAnd accessing array elements if that is wanted, it can be enabled with one line of code.\r\nobject o = radarall(PowerPlant)[0]; <-- element access(currently disabled)"},"comment":{"url":"https://api.github.com/repos/colobot/colobot/issues/comments/238637688","html_url":"https://github.com/colobot/colobot/pull/808#issuecomment-238637688","issue_url":"https://api.github.com/repos/colobot/colobot/issues/808","id":238637688,"user":{"login":"melex750","id":15256309,"avatar_url":"https://avatars.githubusercontent.com/u/15256309?v=3","gravatar_id":"","url":"https://api.github.com/users/melex750","html_url":"https://github.com/melex750","followers_url":"https://api.github.com/users/melex750/followers","following_url":"https://api.github.com/users/melex750/following{/other_user}","gists_url":"https://api.github.com/users/melex750/gists{/gist_id}","starred_url":"https://api.github.com/users/melex750/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/melex750/subscriptions","organizations_url":"https://api.github.com/users/melex750/orgs","repos_url":"https://api.github.com/users/melex750/repos","events_url":"https://api.github.com/users/melex750/events{/privacy}","received_events_url":"https://api.github.com/users/melex750/received_events","type":"User","site_admin":false},"created_at":"2016-08-09T18:01:33Z","updated_at":"2016-08-09T18:01:33Z","body":"@krzys-h As is.\r\nI think the other should be done a little differently.\r\nMaybe methods only?"}}
{"actor":{"display_login":"melex750"}}