{"action":"created","issue":{"url":"https://api.github.com/repos/chrsmith/bwapi/issues/238","labels_url":"https://api.github.com/repos/chrsmith/bwapi/issues/238/labels{/name}","comments_url":"https://api.github.com/repos/chrsmith/bwapi/issues/238/comments","events_url":"https://api.github.com/repos/chrsmith/bwapi/issues/238/events","html_url":"https://github.com/chrsmith/bwapi/issues/238","id":58670930,"number":238,"title":"Explicit type conversion between Position and TilePosition","user":{"login":"GoogleCodeExporter","id":9614759,"avatar_url":"https://avatars.githubusercontent.com/u/9614759?v=3","gravatar_id":"","url":"https://api.github.com/users/GoogleCodeExporter","html_url":"https://github.com/GoogleCodeExporter","followers_url":"https://api.github.com/users/GoogleCodeExporter/followers","following_url":"https://api.github.com/users/GoogleCodeExporter/following{/other_user}","gists_url":"https://api.github.com/users/GoogleCodeExporter/gists{/gist_id}","starred_url":"https://api.github.com/users/GoogleCodeExporter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GoogleCodeExporter/subscriptions","organizations_url":"https://api.github.com/users/GoogleCodeExporter/orgs","repos_url":"https://api.github.com/users/GoogleCodeExporter/repos","events_url":"https://api.github.com/users/GoogleCodeExporter/events{/privacy}","received_events_url":"https://api.github.com/users/GoogleCodeExporter/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/chrsmith/bwapi/labels/auto-migrated","name":"auto-migrated","color":"ededed"},{"url":"https://api.github.com/repos/chrsmith/bwapi/labels/Component-Logic","name":"Component-Logic","color":"ededed"},{"url":"https://api.github.com/repos/chrsmith/bwapi/labels/Component-Persistence","name":"Component-Persistence","color":"ededed"},{"url":"https://api.github.com/repos/chrsmith/bwapi/labels/Priority-Low","name":"Priority-Low","color":"ededed"},{"url":"https://api.github.com/repos/chrsmith/bwapi/labels/Type-Defect","name":"Type-Defect","color":"ededed"},{"url":"https://api.github.com/repos/chrsmith/bwapi/labels/Usability","name":"Usability","color":"ededed"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-02-23T23:59:05Z","updated_at":"2015-02-23T23:59:06Z","closed_at":"2015-02-23T23:59:06Z","body":"```\nCurrently, Position and TilePosition objects are implicitly converted to each \nother. This means that this is possible:\n\nBWAPI::Position a(100,100);\nBWAPI::TilePosition b = a;\n\nThis sometimes causes accidental problems because the .getDistance function \nreturns other distances when comparing Positions and the same converted \nTilePositions. Also, converting to a TilePosition causes accuracy loss.\n\nAnother related issue is that when converting BWAPI::Position::Invalid to a \nTilePosition it does not become equal to BWAPI::TilePosition::Invalid.\n\nTo solve this I would like to suggest using explicit type conversion instead of \nimplicit, which would mean the above would need to be written as:\n\nBWAPI::Position a(100,100);\nBWAPI::TilePosition b = (BWAPI::TilePosition)a;\n```\n\n-----\nOriginal issue reported on code.google.com by `blued...@gmail.com` on 16 Sep 2010 at 2:06"},"comment":{"url":"https://api.github.com/repos/chrsmith/bwapi/issues/comments/75666628","html_url":"https://github.com/chrsmith/bwapi/issues/238#issuecomment-75666628","issue_url":"https://api.github.com/repos/chrsmith/bwapi/issues/238","id":75666628,"user":{"login":"GoogleCodeExporter","id":9614759,"avatar_url":"https://avatars.githubusercontent.com/u/9614759?v=3","gravatar_id":"","url":"https://api.github.com/users/GoogleCodeExporter","html_url":"https://github.com/GoogleCodeExporter","followers_url":"https://api.github.com/users/GoogleCodeExporter/followers","following_url":"https://api.github.com/users/GoogleCodeExporter/following{/other_user}","gists_url":"https://api.github.com/users/GoogleCodeExporter/gists{/gist_id}","starred_url":"https://api.github.com/users/GoogleCodeExporter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GoogleCodeExporter/subscriptions","organizations_url":"https://api.github.com/users/GoogleCodeExporter/orgs","repos_url":"https://api.github.com/users/GoogleCodeExporter/repos","events_url":"https://api.github.com/users/GoogleCodeExporter/events{/privacy}","received_events_url":"https://api.github.com/users/GoogleCodeExporter/received_events","type":"User","site_admin":false},"created_at":"2015-02-23T23:59:06Z","updated_at":"2015-02-23T23:59:06Z","body":"```\nI don't quite understand.\nConverting to TilePosition does what it should.\n\nI fixed the Positions::Invalid != TilePositions::Invalid issue though.\n\nIt doesn't matter how you change it, b will always equal a/32.\n```\n\n-----\nOriginal comment by `AHeinerm` on 29 Sep 2010 at 7:35\n* Changed state: **Questionable**"}}