summaryrefslogtreecommitdiffstats
path: root/EssentialsGroupManager/src/org/anjocaido/groupmanager/events/GroupManagerEventHandler.java
blob: dd24dffdb9e1e2d6256c056831f9e7b5fdd11574 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
package org.anjocaido.groupmanager.events;

import org.anjocaido.groupmanager.data.Group;
import org.anjocaido.groupmanager.data.User;
import org.bukkit.Server;

/**
 * @author ElgarL
 * 
 *         Handles all Event generation.
 * 
 */
public class GroupManagerEventHandler {
	
	protected Server server;
	
	public GroupManagerEventHandler(Server server) {
		this.server = server;
	}

	protected void callEvent(GMGroupEvent event) {

		event.schedule(event);
	}

	protected void callEvent(GMUserEvent event) {

		event.schedule(event);
	}

	protected void callEvent(GMSystemEvent event) {

		event.schedule(event);
	}

	public void callEvent(Group group, GMGroupEvent.Action action) {

		callEvent(new GMGroupEvent(group, action));
	}

	public void callEvent(String groupName, GMGroupEvent.Action action) {

		callEvent(new GMGroupEvent(groupName, action));
	}

	public void callEvent(User user, GMUserEvent.Action action) {

		callEvent(new GMUserEvent(user, action));
	}

	public void callEvent(String userName, GMUserEvent.Action action) {

		callEvent(new GMUserEvent(userName, action));
	}

	public void callEvent(GMSystemEvent.Action action) {

		callEvent(new GMSystemEvent(action));
	}
	
	/**
	 * @return the server
	 */
	public Server getServer() {
	
		return server;
	}

	
	/**
	 * @param server the server to set
	 */
	public void setServer(Server server) {
	
		this.server = server;
	}
}