⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 pevent.java

📁 华为CNGP.CMPP.SGIP.CMPP源代码。
💻 JAVA
字号:
package com.huawei.insa2.comm;

import java.lang.reflect.Field;
import java.util.HashMap;

public class PEvent {

	public PEvent(int type, PLayer source, Object data) {
		this.type = type;
		this.source = source;
		this.data = data;
	}

	public PLayer getSource() {
		return source;
	}

	public int getType() {
		return type;
	}

	public Object getData() {
		return data;
	}

	public String toString() {
		return "PEvent:source=" + source + ",type="
				+ names.get(new Integer(type)) + ",data=" + data;
	}

	public static final int CREATED = 1;

	public static final int CHILD_CREATED = 2;

	public static final int DELETED = 4;

	public static final int MESSAGE_SEND_SUCCESS = 8;

	public static final int MESSAGE_SEND_FAIL = 16;

	public static final int MESSAGE_DISPATCH_SUCCESS = 32;

	public static final int MESSAGE_DISPATCH_FAIL = 64;

	static final HashMap names;

	protected PLayer source;

	protected int type;

	protected Object data;

	static {
		names = new HashMap();
		try {
			Field f[] = (com.huawei.insa2.comm.PEvent.class).getFields();
			for (int i = 0; i < f.length; i++) {
				String name = f[i].getName();
				Object id = f[i].get(null);
				names.put(id, name);
			}

		} catch (Exception ex) {
			ex.printStackTrace();
		}
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -