Class RegionMembershipUtilities
Object
RegionMembershipUtilities
Utility class for managing 8-bit region membership.
This class provides methods for manipulating and checking region membership flags.
-
Method Summary
Modifier and TypeMethodDescriptionstatic byteGets the flag representing no region membership.static byteflagForRegion(int index) Gets the flag for a specific region index.static byteflagForRegion(int index1, int index2) Combines flags for two regions.static byteflagForRegion(int index1, int index2, int index3) Combines flags for three regions.static booleanisMemberFlagAnd(byte membership, byte flag) Checks if a membership flag is set using an AND operation.static booleanisMemberFlagOr(byte membership, byte flag) Checks if a membership flag is set using an OR operation.static bytesetAsMemberFlag(byte membership, byte flag) Sets a membership flag.
-
Method Details
-
isMemberFlagAnd
public static boolean isMemberFlagAnd(byte membership, byte flag) Checks if a membership flag is set using an AND operation.- Parameters:
membership- the current membership flagsflag- the flag to check- Returns:
- true if the flag is set, false otherwise
-
isMemberFlagOr
public static boolean isMemberFlagOr(byte membership, byte flag) Checks if a membership flag is set using an OR operation.- Parameters:
membership- the current membership flagsflag- the flag to check- Returns:
- true if the flag is set, false otherwise
-
setAsMemberFlag
public static byte setAsMemberFlag(byte membership, byte flag) Sets a membership flag.- Parameters:
membership- the current membership flagsflag- the flag to set- Returns:
- the updated membership flags
-
flagForNoRegion
public static byte flagForNoRegion()Gets the flag representing no region membership.- Returns:
- the flag for no region
-
flagForRegion
public static byte flagForRegion(int index) Gets the flag for a specific region index.- Parameters:
index- the index of the region (0-6)- Returns:
- the flag for the specified region
-
flagForRegion
public static byte flagForRegion(int index1, int index2) Combines flags for two regions.- Parameters:
index1- the index of the first regionindex2- the index of the second region- Returns:
- the combined flag for both regions
-
flagForRegion
public static byte flagForRegion(int index1, int index2, int index3) Combines flags for three regions.- Parameters:
index1- the index of the first regionindex2- the index of the second regionindex3- the index of the third region- Returns:
- the combined flag for all three regions
-