org.unlaxer.tinyexpression.model.CharacterAttributes Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of tinyExpression Show documentation
Show all versions of tinyExpression Show documentation
TinyExpression implemented with Unlaxer
package org.unlaxer.tinyexpression.model;
public class CharacterAttributes{
public int attributres;
public void setAttributes(CharacterAttribute...characterAttributes){
for (CharacterAttribute characterAttribute : characterAttributes) {
if(has(characterAttribute)){
continue;
}
attributres += characterAttribute.code;
}
}
public void resetAttributes(CharacterAttribute...characterAttributes){
for (CharacterAttribute characterAttribute : characterAttributes) {
if(has(characterAttribute)){
attributres -= characterAttribute.code;
}
}
}
public boolean has(CharacterAttribute characterAttribute){
return (attributres & characterAttribute.code) != 0;
}
}