Skip to content

Commit

Permalink
UPD renamed methods in AbstractEnumFlags
Browse files Browse the repository at this point in the history
  • Loading branch information
deepnight committed Sep 12, 2024
1 parent ac140ca commit 54158ce
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/dn/AbstractEnumFlags.hx
Original file line number Diff line number Diff line change
Expand Up @@ -13,35 +13,35 @@ class AbstractEnumFlags<T:Int> {
this.flagNames = flagNames;
}

public inline function hasFlag(flag:T) {
public inline function has(flag:T) {
return flagValues.exists(flag);
}

public inline function setFlagOnce(flag:T) {
if( !hasFlag(flag) ) {
setFlag(flag);
public inline function setOnce(flag:T) {
if( !has(flag) ) {
set(flag);
return true;
}
else
return false;
}

public inline function setFlag(flag:T, v=true) {
public inline function set(flag:T, v=true) {
if( v )
flagValues.set(flag,v);
else
flagValues.remove(flag);
}

public inline function toggleFlag(flag:T) {
setFlag(flag, !hasFlag(flag));
public inline function toggle(flag:T) {
set(flag, !has(flag));
}

public inline function getFlagValue(flag:T) {
return flagValues.exists(flag);
}

public inline function removeFlag(flag:T) {
public inline function remove(flag:T) {
return flagValues.remove(flag);
}

Expand Down

0 comments on commit 54158ce

Please sign in to comment.