当前位置: 首页>>代码示例>>Java>>正文


Java RoomManagerInstance类代码示例

本文整理汇总了Java中net.dlogic.kryonet.common.manager.RoomManagerInstance的典型用法代码示例。如果您正苦于以下问题:Java RoomManagerInstance类的具体用法?Java RoomManagerInstance怎么用?Java RoomManagerInstance使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


RoomManagerInstance类属于net.dlogic.kryonet.common.manager包,在下文中一共展示了RoomManagerInstance类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: setUp

import net.dlogic.kryonet.common.manager.RoomManagerInstance; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
	manager = RoomManagerInstance.manager;
	Room room = new Room();
	room.name = "Test";
	room.maxUsers = 2;
	manager.map.put(room.name, room);
	Room room2 = new Room();
	room2.name = "Test2";
	room2.maxUsers = 32;
	manager.map.put(room2.name, room2);
	Room room3 = new Room();
	room3.name = "Lobby";
	room3.maxUsers = 32;
	manager.map.put(room3.name, room3);
}
 
开发者ID:macalimlim,项目名称:kryonet-common,代码行数:17,代码来源:RoomManagerTest.java

示例2: setUp

import net.dlogic.kryonet.common.manager.RoomManagerInstance; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
	listener = new KryonetClientListener();
	listener.setConnectionEventCallback(new MockConnectionEventCallback());
	listener.setRoomEventCallback(new MockRoomEventCallback());
	RoomManagerInstance.manager.map.clear();
	UserManagerInstance.manager.map.clear();
	initializeMyself();
	connection = new MockConnection();
}
 
开发者ID:macalimlim,项目名称:kryonet-client,代码行数:11,代码来源:KryonetClientListenerTest.java

示例3: testConnected

import net.dlogic.kryonet.common.manager.RoomManagerInstance; //导入依赖的package包/类
@Test
public void testConnected() {
	listener.connected(connection);
	assertEquals(connection.getID(), MyselfInstance.myself.id);
	assertFalse(MyselfInstance.myself.isAdmin);
	assertTrue(MyselfInstance.myself.isItMe);
	assertFalse(MyselfInstance.myself.isPlayer);
	assertEquals(0, RoomManagerInstance.manager.map.size());
	assertEquals(1, UserManagerInstance.manager.map.size());
	assertTrue(UserManagerInstance.manager.map.containsKey(MyselfInstance.myself.id));
}
 
开发者ID:macalimlim,项目名称:kryonet-client,代码行数:12,代码来源:KryonetClientListenerTest.java

示例4: testDisconnected

import net.dlogic.kryonet.common.manager.RoomManagerInstance; //导入依赖的package包/类
@Test
public void testDisconnected() {
	testConnected();
	listener.disconnected(connection);
	assertEquals(0, MyselfInstance.myself.id);
	assertNull(MyselfInstance.myself.username);
	assertFalse(MyselfInstance.myself.isAdmin);
	assertFalse(MyselfInstance.myself.isItMe);
	assertFalse(MyselfInstance.myself.isPlayer);
	assertEquals(0, RoomManagerInstance.manager.map.size());
	assertEquals(0, UserManagerInstance.manager.map.size());
	assertFalse(UserManagerInstance.manager.map.containsKey(MyselfInstance.myself.id));
}
 
开发者ID:macalimlim,项目名称:kryonet-client,代码行数:14,代码来源:KryonetClientListenerTest.java

示例5: sendLeaveRoomResponse

import net.dlogic.kryonet.common.manager.RoomManagerInstance; //导入依赖的package包/类
public void sendLeaveRoomResponse() {
	RoomManagerInstance.manager.forEachRoom(new IForEach<Room>() {
		public void exec(Room entity) {
			if (entity.users.containsKey(sender.id)) {
				sendLeaveRoomResponse(entity);
			}
		}
	});
}
 
开发者ID:macalimlim,项目名称:kryonet-server,代码行数:10,代码来源:BaseEventHandler.java

示例6: onJoinRoomFailure

import net.dlogic.kryonet.common.manager.RoomManagerInstance; //导入依赖的package包/类
@Override
public void onJoinRoomFailure(String errorMessage) {
	Log.info(errorMessage);
	Room room = RoomManagerInstance.manager.map.get("Game");
	Log.info(room.users.toString());
}
 
开发者ID:macalimlim,项目名称:kryonet-client,代码行数:7,代码来源:RoomEventCallback.java

示例7: KryonetServerListener

import net.dlogic.kryonet.common.manager.RoomManagerInstance; //导入依赖的package包/类
public KryonetServerListener() {
	Log.debug("KryonetServerListener()");
	userManager = UserManagerInstance.manager;
	roomManager = RoomManagerInstance.manager;
}
 
开发者ID:macalimlim,项目名称:kryonet-server,代码行数:6,代码来源:KryonetServerListener.java


注:本文中的net.dlogic.kryonet.common.manager.RoomManagerInstance类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。