mirror of
https://github.com/ProjectSWGCore/NGECore2.git
synced 2026-07-15 00:07:39 -04:00
Merge branch 'master' of https://github.com/ProjectSWGCore/NGECore2
This commit is contained in:
@@ -56,6 +56,7 @@ public class PlayerObject extends IntangibleObject {
|
||||
private int totalPlayTime = 0;
|
||||
private byte[] collections = new byte[] { };
|
||||
private int highestSetBit = 0;
|
||||
private int flagBitmask = 0;
|
||||
|
||||
// PLAY 6
|
||||
|
||||
@@ -658,4 +659,38 @@ public class PlayerObject extends IntangibleObject {
|
||||
}
|
||||
}
|
||||
|
||||
public int getFlagBitmask() {
|
||||
synchronized(objectMutex) {
|
||||
return flagBitmask;
|
||||
}
|
||||
}
|
||||
|
||||
public void setFlagBitmask(int flagBitmask) {
|
||||
synchronized(objectMutex) {
|
||||
this.flagBitmask |= flagBitmask;
|
||||
}
|
||||
|
||||
if (getContainer() != null) {
|
||||
getContainer().notifyObservers(messageBuilder.buildFlagBitmask(this.flagBitmask), true);
|
||||
}
|
||||
}
|
||||
public void clearFlagBitmask(int flagBitmask) {
|
||||
synchronized(objectMutex) {
|
||||
// set flag bitmask to 0
|
||||
this.flagBitmask &= ~flagBitmask;
|
||||
}
|
||||
|
||||
if (getContainer() != null) {
|
||||
getContainer().notifyObservers(messageBuilder.buildFlagBitmask(this.flagBitmask), true);
|
||||
}
|
||||
}
|
||||
|
||||
public void toggleFlag(int flag) {
|
||||
if ((this.flagBitmask & flag) == flag) {
|
||||
clearFlagBitmask(flag);
|
||||
} else {
|
||||
setFlagBitmask(flag);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user