Sha256: d1b1ac0dd7685839a0c2f36049db2936ff98b07082d2cc60e1986cc6e35829a0

Contents?: true

Size: 1020 Bytes

Versions: 2

Compression:

Stored size: 1020 Bytes

Contents

package com.game_machine.core;

import GameMachine.Messages.ClientManagerEvent;
import GameMachine.Messages.GameMessage;

public class GameMessageActor extends GameActor {

	
	public void onReceive(Object message) throws Exception {
		if (message instanceof GameMessage) {
			GameMessage gameMessage = (GameMessage)message;
			setPlayerId(gameMessage.playerId);
			onGameMessage(gameMessage);
		} else if (message instanceof ClientManagerEvent) {
			ClientManagerEvent clientManagerEvent = (ClientManagerEvent)message;
			if (clientManagerEvent.event.equals("disconnected")) {
				onPlayerDisconnect(clientManagerEvent.player_id);
			}
		} else {
			unhandled(message);
		}
	}
	
	@Override
	public void preStart() {
		awake();
	}
	
	public void awake() {
		
	}
	
	public void onGameMessage(GameMessage gameMessage) {
		
	}
	
	public void sendGameMessage(GameMessage gameMessage, String playerId) {
		PlayerCommands.sendGameMessage(gameMessage, playerId);
	}
	
	private void onPlayerDisconnect(String playerId) {
		
	}
}

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
game_machine-1.0.4 java/project/src/main/java/com/game_machine/core/GameMessageActor.java
game_machine-1.0.2 java/project/src/main/java/com/game_machine/core/GameMessageActor.java