{"action":"created","issue":{"url":"https://api.github.com/repos/TeamPorcupine/ProjectPorcupine/issues/386","repository_url":"https://api.github.com/repos/TeamPorcupine/ProjectPorcupine","labels_url":"https://api.github.com/repos/TeamPorcupine/ProjectPorcupine/issues/386/labels{/name}","comments_url":"https://api.github.com/repos/TeamPorcupine/ProjectPorcupine/issues/386/comments","events_url":"https://api.github.com/repos/TeamPorcupine/ProjectPorcupine/issues/386/events","html_url":"https://github.com/TeamPorcupine/ProjectPorcupine/pull/386","id":172269963,"number":386,"title":"Trade foundation ui & model","user":{"login":"sboigelot","id":6545998,"avatar_url":"https://avatars.githubusercontent.com/u/6545998?v=3","gravatar_id":"","url":"https://api.github.com/users/sboigelot","html_url":"https://github.com/sboigelot","followers_url":"https://api.github.com/users/sboigelot/followers","following_url":"https://api.github.com/users/sboigelot/following{/other_user}","gists_url":"https://api.github.com/users/sboigelot/gists{/gist_id}","starred_url":"https://api.github.com/users/sboigelot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sboigelot/subscriptions","organizations_url":"https://api.github.com/users/sboigelot/orgs","repos_url":"https://api.github.com/users/sboigelot/repos","events_url":"https://api.github.com/users/sboigelot/events{/privacy}","received_events_url":"https://api.github.com/users/sboigelot/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":12,"created_at":"2016-08-20T12:59:30Z","updated_at":"2016-08-20T15:21:16Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/TeamPorcupine/ProjectPorcupine/pulls/386","html_url":"https://github.com/TeamPorcupine/ProjectPorcupine/pull/386","diff_url":"https://github.com/TeamPorcupine/ProjectPorcupine/pull/386.diff","patch_url":"https://github.com/TeamPorcupine/ProjectPorcupine/pull/386.patch"},"body":"As requested by @vogonistic \r\n\r\nhere is a small rimworld-like trade ui.\r\n\r\nThe UI work with models, the models are\r\n\r\n- Trade\r\n- Traders\r\n- Inventory from the code base\r\n\r\nThe UI will NOT make the trade happen, this will be something to develop as part of the game, this merge request is here to facilitate future trade feature development.\r\n\r\nChange in the scene were requiered to add a new dialog box.\r\n\r\n![image](https://cloud.githubusercontent.com/assets/6545998/17831340/4655c442-66e6-11e6-92e1-f57780a5ed3b.png)\r\n\r\n\r\nSample code to setup a new trade is available in DialogBoxTrade.cs\r\n\r\n```\r\npublic void DoTradingTestWithMockTraders()\r\n{\r\n\tTrader mockPlayer = new Trader\r\n\t{\r\n\t\tCurrencyBalance = 500,\r\n\t\tName = \"Player\",\r\n\t\tSaleMarginMultiplier = 1f,\r\n\t\tStock = new List<Inventory>\r\n\t\t{\r\n\t\t\tnew Inventory(\"Steel Plate\",50,10){ basePrice = 3f},\r\n\t\t\tnew Inventory(\"Raw Iron\",100,90){ basePrice = 0.2f},\r\n\t\t}\r\n\t};\r\n\tTrader mockTrader = new Trader\r\n\t{\r\n\t\tCurrencyBalance = 1500,\r\n\t\tName = \"Trader\",\r\n\t\tSaleMarginMultiplier = 1.23f,\r\n\t\tStock = new List<Inventory>\r\n\t\t{\r\n\t\t\tnew Inventory(\"Steel Plate\",50,40){ basePrice = 3f},\r\n\t\t\tnew Inventory(\"Steel Plate\",50,40){ basePrice = 3f},\r\n\t\t\tnew Inventory(\"Oxygen Bottle\",10,10){ basePrice = 50f},\r\n\t\t}\r\n\t};\r\n\tSetupTrade(new Trade(mockPlayer,mockTrader));\r\n}\r\n\r\n```"},"comment":{"url":"https://api.github.com/repos/TeamPorcupine/ProjectPorcupine/issues/comments/241205943","html_url":"https://github.com/TeamPorcupine/ProjectPorcupine/pull/386#issuecomment-241205943","issue_url":"https://api.github.com/repos/TeamPorcupine/ProjectPorcupine/issues/386","id":241205943,"user":{"login":"RodRitter","id":4159679,"avatar_url":"https://avatars.githubusercontent.com/u/4159679?v=3","gravatar_id":"","url":"https://api.github.com/users/RodRitter","html_url":"https://github.com/RodRitter","followers_url":"https://api.github.com/users/RodRitter/followers","following_url":"https://api.github.com/users/RodRitter/following{/other_user}","gists_url":"https://api.github.com/users/RodRitter/gists{/gist_id}","starred_url":"https://api.github.com/users/RodRitter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RodRitter/subscriptions","organizations_url":"https://api.github.com/users/RodRitter/orgs","repos_url":"https://api.github.com/users/RodRitter/repos","events_url":"https://api.github.com/users/RodRitter/events{/privacy}","received_events_url":"https://api.github.com/users/RodRitter/received_events","type":"User","site_admin":false},"created_at":"2016-08-20T15:21:15Z","updated_at":"2016-08-20T15:21:15Z","body":"Ok merged. Let's see what people can do with this."}}
{"actor":{"display_login":"RodRitter"}}