class GameEventFactory {

	public static Optional<IGameEvent> fromProtobuf(SslGcGameEvent.GameEvent event)
	{
		if (event.getType() == SslGcGameEvent.GameEvent.Type.UNKNOWN_GAME_EVENT_TYPE)
		{
			return Optional.empty();
		}
		try
		{
			final EGameEvent gameEvent = EGameEvent.fromProto(event.getType());
			if (gameEvent == null)
			{
				return Optional.empty();
			}
			return Optional.of((IGameEvent) gameEvent.getInstanceableClass().newInstance(event));
		} catch (InstanceableClass.NotCreateableException e)
		{
			log.warn("Could not convert game event: " + event, e);
		}
		return Optional.empty();
	}

	private  GameEventFactory();

}