{"id":20572051,"url":"https://github.com/netease/pomelo-aoi","last_synced_at":"2025-04-14T17:08:13.811Z","repository":{"id":5571065,"uuid":"6776653","full_name":"NetEase/pomelo-aoi","owner":"NetEase","description":"The aoi module used in lordofpomelo","archived":false,"fork":false,"pushed_at":"2013-03-21T06:27:54.000Z","size":129,"stargazers_count":63,"open_issues_count":1,"forks_count":28,"subscribers_count":14,"default_branch":"master","last_synced_at":"2025-04-14T17:08:00.408Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/NetEase.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-11-20T11:12:03.000Z","updated_at":"2025-03-26T08:54:17.000Z","dependencies_parsed_at":"2022-07-06T14:32:11.077Z","dependency_job_id":null,"html_url":"https://github.com/NetEase/pomelo-aoi","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NetEase%2Fpomelo-aoi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NetEase%2Fpomelo-aoi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NetEase%2Fpomelo-aoi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NetEase%2Fpomelo-aoi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NetEase","download_url":"https://codeload.github.com/NetEase/pomelo-aoi/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248923764,"owners_count":21183953,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-16T05:18:10.192Z","updated_at":"2025-04-14T17:08:13.773Z","avatar_url":"https://github.com/NetEase.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pomelo-aoi\npomelo-schedule is the aoi module used in the demo of pomelo.\n\nThe aoi module include a set of aoi interface, and an implementation of tower aoi algorithm.  \n##Installation\n```\nnpm install pomelo-aoi\n```\n##Generate an aoi instance\nFor the aoi service can be used in many areas, each area use the aoi module should use it's own aoi instance.\nWe use a aoi factory to generate aoi instance, it accept an object as parameter, and return an aoi instance,  which can be used to implament the aoi function.   \n\n``` javascript\nvar aoiManager = require('pomelo-aoi');\nvar config = {\n\tmap : {\n\t\twidth : 3200,\n\t\theight : 2400\n\t},\n\ttower : {\n\t\twidth : 300,\n\t\theight : 300\n\t}\n}\n\nvar aoi = qoiManager.getService(config);\n```\n\n##Use the aoi service\nThe aoi instace has the basic interface for aoi action.\n\n``` javascript\n\t//Add object \n\taoi.addObject(obj, pos);\n\t\n\t//Remove object \n\taoi.removeObject(obj, pos);\n\t\n\t//Update object\n\taoi.updateObject(obj, oldPos, newPos);\n\t\n\t//Add watcher \n\taoi.addWatcher(watcher, pos, range);\n\t\n\t//Remove watcher\n\taoi.removeWatcher(watcher, pos, range0;\n\t\n\t//updateWatcher(watcher, oldPos, newPos, oldRange, newRange);\n``` \nMore api can be find in aoiService.js.\n\n##Handle aoi event\nThe aoi service will generate event when the status of objects or watchers changes. You can handler these event :\n``` javascript\n\taoi.on('add', function(params){\n\t\t//Handle add event\n\t});\n\n``` \nThe event of tower aoi are: 'add', 'remove', 'update' for aoi object, and 'updateWatcher' for watcher.\nOf course you can ignore all these events without do any effect to aoi function. \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnetease%2Fpomelo-aoi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnetease%2Fpomelo-aoi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnetease%2Fpomelo-aoi/lists"}