|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectvooga.engine.event.EventPool
public class EventPool
The EventPool
collects all the events from the game loop. User has the ability to add
event object which implements IEventHandler
interface. Also the user has the flexibility
to remove the event from the EventPool if a certain event is not wanted anymore. In the game loop,
(EventPool)object.checkEvents()
needs to be called to check all the events. If an event's condition is satisfied,
the event will be triggered or fired automatically. For more details about how to use, please see the
Demo2
.
IEventHandler
Constructor Summary | |
---|---|
EventPool()
|
Method Summary | |
---|---|
void |
addEvent(IEventHandler event)
Add event into the eventPool so that eventPool can check the event for you in the game loop. |
void |
checkEvents()
Put this method in the update game loop so that all the events will be checked automatically and fired accordingly. |
java.util.ArrayList<IEventHandler> |
getEventList()
Get the a list of events which contains all the events in the EventPool |
void |
removeEvent(IEventHandler event)
Remove event from the eventPool so that this event will not trigger anything in the gameloop. |
void |
setEventList(java.util.ArrayList<IEventHandler> eventList)
Set the eventList object. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public EventPool()
Method Detail |
---|
public void addEvent(IEventHandler event)
event
- The object which implements IEventHandler
interface.public java.util.ArrayList<IEventHandler> getEventList()
IEventHandler
interface.public void setEventList(java.util.ArrayList<IEventHandler> eventList)
eventList
- An event list object which is an arrayList of objects which implement IEventHandler
interface.public void removeEvent(IEventHandler event)
event
- The class object which implements IEventHandler
interface.public void checkEvents()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |