This repository has been archived on 2023-07-11. You can view files and clone it, but cannot push or open issues or pull requests.
BWMirror-Generator/bwapi4/GameWrapper.java

41 lines
820 B
Java
Raw Normal View History

package bwapi4;
import bwapi4.*;
import java.util.Map;
import java.util.HashMap;
import java.util.Collection;
import java.util.List;
public class GameWrapper {
public void flush() {
flush_native(pointer);
}
private static Map<Long, GameWrapper> instances = new HashMap<Long, GameWrapper>();
private GameWrapper(long pointer) {
this.pointer = pointer;
}
private static GameWrapper get(long pointer) {
2015-02-07 12:16:07 -05:00
if (pointer == 0 ) {
return null;
}
GameWrapper instance = instances.get(pointer);
if (instance == null ) {
instance = new GameWrapper(pointer);
instances.put(pointer, instance);
}
return instance;
}
private long pointer;
private native void flush_native(long pointer);
}