{"action":"opened","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":58380986,"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":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-02-20T17:05:25Z","updated_at":"2015-02-20T17:05:25Z","closed_at":null,"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"}}