Whitelist Option + Hiding Banned Blocks Rules (#7553)
* Whitelist Option * Hide banned blocks rule
This commit is contained in:
@@ -95,6 +95,12 @@ public class Rules{
|
||||
public boolean onlyDepositCore = false;
|
||||
/** If true, every enemy block in the radius of the (enemy) core is destroyed upon death. Used for campaign maps. */
|
||||
public boolean coreDestroyClear = false;
|
||||
/** If true, banned blocks are hidden from the build menu. */
|
||||
public boolean hideBannedBlocks = false;
|
||||
/** If true, bannedBlocks becomes a whitelist. */
|
||||
public boolean blockWhitelist = false;
|
||||
/** If true, bannedUnits becomes a whitelist. */
|
||||
public boolean unitWhitelist = false;
|
||||
/** Radius around enemy wave drop zones.*/
|
||||
public float dropZoneRadius = 300f;
|
||||
/** Time between waves in ticks. */
|
||||
@@ -228,6 +234,14 @@ public class Rules{
|
||||
return buildSpeedMultiplier * teams.get(team).buildSpeedMultiplier;
|
||||
}
|
||||
|
||||
public boolean isBanned(Block block){
|
||||
return blockWhitelist != bannedBlocks.contains(block);
|
||||
}
|
||||
|
||||
public boolean isBanned(UnitType unit){
|
||||
return unitWhitelist != bannedUnits.contains(unit);
|
||||
}
|
||||
|
||||
/** A team-specific ruleset. */
|
||||
public static class TeamRule{
|
||||
/** Whether, when AI is enabled, ships should be spawned from the core. TODO remove / unnecessary? */
|
||||
|
||||
Reference in New Issue
Block a user