mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 03:38:01 +00:00
Merge branch 'multiplayer' into 'master'
Multiplayer See merge request core-developers/forge!207
This commit is contained in:
@@ -373,7 +373,14 @@ public class PlayerView extends GameEntityView {
|
||||
}
|
||||
|
||||
public int getMana(final byte color) {
|
||||
Integer count = getMana().get(color);
|
||||
Integer count = null;
|
||||
try {
|
||||
count = getMana().get(color);
|
||||
}
|
||||
catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
count = null;
|
||||
}
|
||||
return count != null ? count.intValue() : 0;
|
||||
}
|
||||
private Map<Byte, Integer> getMana() {
|
||||
|
||||
@@ -14,7 +14,7 @@ public abstract class TrackableObject implements IIdentifiable, Serializable {
|
||||
private static final long serialVersionUID = 7386836745378571056L;
|
||||
|
||||
private final int id;
|
||||
protected final transient Tracker tracker;
|
||||
protected transient Tracker tracker;
|
||||
private final Map<TrackableProperty, Object> props;
|
||||
private final Set<TrackableProperty> changedProps;
|
||||
private boolean copyingProps;
|
||||
@@ -30,6 +30,11 @@ public abstract class TrackableObject implements IIdentifiable, Serializable {
|
||||
return id;
|
||||
}
|
||||
|
||||
// needed for multiplayer support
|
||||
public void setTracker(Tracker tracker) {
|
||||
this.tracker = tracker;
|
||||
}
|
||||
|
||||
public final Tracker getTracker() {
|
||||
return tracker;
|
||||
}
|
||||
@@ -45,6 +50,11 @@ public abstract class TrackableObject implements IIdentifiable, Serializable {
|
||||
return o.hashCode() == id && o.getClass().equals(getClass());
|
||||
}
|
||||
|
||||
// don't know if this is really needed, but don't know a better way
|
||||
public <T> T getProps() {
|
||||
return (T)props;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
protected final <T> T get(final TrackableProperty key) {
|
||||
T value = (T)props.get(key);
|
||||
|
||||
Reference in New Issue
Block a user