This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static Set<Path> getAllowedFiles(final Path gameDirectory, final Manifest manifest) | |
{ | |
return manifest.getManifestContent() | |
.map(manifestContent -> { | |
final List<FileEntry> debugFiles = manifestContent.getDebug(); | |
final List<FileEntry> releaseFiles = manifestContent.getRelease(); | |
final Map<String, ArchiveEntry> archives = manifestContent.getArchives(); | |
final Set<Path> paths = new HashSet<>(debugFiles.size() + releaseFiles.size() + archives.size()); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.vizor.unreal.platform.mac; | |
import com.vizor.log.LogManager; | |
import com.vizor.log.Logger; | |
import com.vizor.unreal.platform.FrameDecorator; | |
import javax.swing.ImageIcon; | |
import java.awt.Image; | |
import java.lang.invoke.MethodHandle; | |
import java.net.URL; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static class GameObject | |
{ | |
private Map<Class<?>, List<Number>> componentsByClass = new HashMap<>(); | |
public void AddComponent(Class<? extends Number> componentClass) throws IllegalAccessException, InstantiationException | |
{ | |
if (componentClass != null) | |
{ | |
List<Number> components; | |
if ((components = componentsByClass.get(componentClass)) == null) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static int[] sieveOfEratosthenes(int n) | |
{ | |
final boolean[] map; | |
try { | |
// Math.max(n, 0) is a negative-size protection | |
map = new boolean[Math.max(n, 0)]; | |
} | |
catch (OutOfMemoryError ignore) { | |
return new int[0]; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static <T extends Number> Optional<T> parse(final String s, final Class<T> clazz) | |
{ | |
// Escape if null input | |
if ((s == null) || (clazz == null)) | |
return Optional.empty(); | |
Object parsed = null; | |
NumberFormatException exception = null; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int utf8_to_wide_char(const char* UTF8_string, wchar_t** OUT_wide_chars, size_t* OUT_size) | |
{ | |
if (!UTF8_string) | |
return 1; | |
const size_t length = (size_t)MultiByteToWideChar(CP_UTF8, 0, UTF8_string, -1, NULL, 0); | |
wchar_t* wide_characters = (wchar_t*)malloc(length * sizeof(wchar_t)); | |
if (!wide_characters) | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.vizor.unreal.platform.mac; | |
import com.vizor.unreal.platform.FrameDecorator; | |
import com.vizor.unreal.util.MiscUtils; | |
import com.vizor.unreal.util.StringUtils; | |
import com.vizor.unreal.util.logger.LogManager; | |
import com.vizor.unreal.util.logger.Logger; | |
import javax.swing.ImageIcon; | |
import java.awt.Image; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.vizor.unreal.platform.mac; | |
import com.vizor.unreal.platform.FrameDecorator; | |
import javax.swing.ImageIcon; | |
import java.awt.Image; | |
import java.lang.invoke.MethodHandle; | |
import java.net.URL; | |
import static java.lang.invoke.MethodHandles.lookup; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.vizor.unreal.util.util; | |
import java.time.ZonedDateTime; | |
public class GarbageFreeClock | |
{ | |
private static final int msInSec = 1000; | |
private static final int msInMin = msInSec * 60; | |
private static final int msInHou = msInMin * 60; | |
private static final int msInDay = msInHou * 24; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.vizor.unreal.util.util; | |
import java.time.ZonedDateTime; | |
public class GarbageFreeClock | |
{ | |
private static final int msInSec = 1000; | |
private static final int msInMin = msInSec * 60; | |
private static final int msInHou = msInMin * 60; | |
private static final int msInDay = msInHou * 24; |