2025-03-11 00:23:54 +01:00
|
|
|
package game.properties;
|
|
|
|
|
|
|
|
import java.util.Collection;
|
|
|
|
|
2025-03-16 17:40:47 +01:00
|
|
|
import com.google.common.collect.ImmutableSet;
|
2025-03-11 00:23:54 +01:00
|
|
|
|
|
|
|
public class PropertyBool extends PropertyHelper<Boolean>
|
|
|
|
{
|
|
|
|
private final ImmutableSet<Boolean> allowedValues = ImmutableSet.<Boolean>of(Boolean.valueOf(true), Boolean.valueOf(false));
|
|
|
|
|
|
|
|
protected PropertyBool(String name)
|
|
|
|
{
|
|
|
|
super(name, Boolean.class);
|
|
|
|
}
|
|
|
|
|
|
|
|
public Collection<Boolean> getAllowedValues()
|
|
|
|
{
|
|
|
|
return this.allowedValues;
|
|
|
|
}
|
|
|
|
|
|
|
|
public static PropertyBool create(String name)
|
|
|
|
{
|
|
|
|
return new PropertyBool(name);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the name for the given value.
|
|
|
|
*/
|
|
|
|
public String getName(Boolean value)
|
|
|
|
{
|
|
|
|
return value.toString();
|
|
|
|
}
|
|
|
|
}
|