Giter VIP home page Giter VIP logo

pomelo-aoi's Introduction

pomelo-aoi

pomelo-schedule is the aoi module used in the demo of pomelo.

The aoi module include a set of aoi interface, and an implementation of tower aoi algorithm.
##Installation

npm install pomelo-aoi

##Generate an aoi instance For the aoi service can be used in many areas, each area use the aoi module should use it's own aoi instance. We 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.

var aoiManager = require('pomelo-aoi');
var config = {
	map : {
		width : 3200,
		height : 2400
	},
	tower : {
		width : 300,
		height : 300
	}
}

var aoi = qoiManager.getService(config);

##Use the aoi service The aoi instace has the basic interface for aoi action.

	//Add object 
	aoi.addObject(obj, pos);
	
	//Remove object 
	aoi.removeObject(obj, pos);
	
	//Update object
	aoi.updateObject(obj, oldPos, newPos);
	
	//Add watcher 
	aoi.addWatcher(watcher, pos, range);
	
	//Remove watcher
	aoi.removeWatcher(watcher, pos, range0;
	
	//updateWatcher(watcher, oldPos, newPos, oldRange, newRange);

More api can be find in aoiService.js.

##Handle aoi event The aoi service will generate event when the status of objects or watchers changes. You can handler these event :

	aoi.on('add', function(params){
		//Handle add event
	});

The event of tower aoi are: 'add', 'remove', 'update' for aoi object, and 'updateWatcher' for watcher. Of course you can ignore all these events without do any effect to aoi function.

pomelo-aoi's People

Contributors

demon0925 avatar xiecc avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pomelo-aoi's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.