{"action":"opened","issue":{"url":"https://api.github.com/repos/chrsmith/bwapi/issues/114","labels_url":"https://api.github.com/repos/chrsmith/bwapi/issues/114/labels{/name}","comments_url":"https://api.github.com/repos/chrsmith/bwapi/issues/114/comments","events_url":"https://api.github.com/repos/chrsmith/bwapi/issues/114/events","html_url":"https://github.com/chrsmith/bwapi/issues/114","id":58485313,"number":114,"title":"reusable BWAPI::Units, aid or sham?","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"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-02-22T01:32:46Z","updated_at":"2015-02-22T01:32:46Z","closed_at":null,"body":"```\nCurrently even with the BWAPI::Flag::CompleteMapInformation flagg off, the \nUnit* pointers do not change after a unit disappeared in for of war and \nreappeared again, so practically this is an illegal means of unit \nidentification. In \"real life\" people cannot tell if it's the same marine \nthat escaped earlier or if it's a new one.\n\nSUGGESTION: each time a unit hides in the fog (or cloakes && !sneaks) the \nactual Unit* becomes invalid, a new one will be provided when that unit is \nbeing detected again. The callbacks are in control of the lifetime of the \nUnit* objects.\n\nonUnitUncloak - creates a Unit*\nonUnitCreate - creates a Unit*\nonUnitShow - creates a Unit*\nonUnitDestroy - destroys a Unit*\nonUnitCloak - destroys a Unit*\nonUnitHide - destroys a Unit*\n\nPOSSIBLE PROBLEM: I've noticed BWAPI currently saves all Unit*s in a \nunusedUnits set, in a \"not exists\" state which refuses all access to \nproperties. With the suggested behaviour the number of Unit*s in that \narray would grow rapidly. Since we're building a callback-based API here, \nand like I said, the lifetime of whese object is clear, i oppose the \nunusedUnits set.\n```\n\n-----\nOriginal issue reported on code.google.com by `goo...@teabix.com` on 18 Nov 2009 at 2:48"}}