Change remaining flags to 0b notation by popularity vote

This commit is contained in:
Fabian Dill 2022-01-21 00:42:45 +01:00
parent dc6f1c4dd2
commit 31a823bc34
2 changed files with 7 additions and 7 deletions

View File

@ -166,7 +166,6 @@ class JSONTypes(str, enum.Enum):
class JSONtoTextParser(metaclass=HandlerMeta):
color_codes = {
# not exact color names, close enough but decent looking
"black": "000000",
@ -216,11 +215,11 @@ class JSONtoTextParser(metaclass=HandlerMeta):
flags = node.get("flags", 0)
if flags == 0:
node["color"] = 'cyan'
elif flags & 1 << 0: # advancement
elif flags & 0b001: # advancement
node["color"] = 'plum'
elif flags & 1 << 1: # never_exclude
elif flags & 0b010: # never_exclude
node["color"] = 'slateblue'
elif flags & 1 << 2: # trap
elif flags & 0b100: # trap
node["color"] = 'salmon'
else:
node["color"] = 'cyan'

View File

@ -9,8 +9,6 @@ from .. import cache
api_endpoints = Blueprint('api', __name__, url_prefix="/api")
from . import generate, user # trigger registration
# unsorted/misc endpoints
@ -46,3 +44,6 @@ def get_datapackge_versions():
version_package = {game: world.data_version for game, world in AutoWorldRegister.world_types.items()}
version_package["version"] = network_data_package["version"]
return version_package
from . import generate, user # trigger registration