Difficult-Rocket/Difficult_Rocket/command/tree.py
2022-05-11 11:11:39 +08:00

69 lines
1.6 KiB
Python

# -------------------------------
# Difficult Rocket
# Copyright © 2021-2022 by shenjackyuanjie
# All rights reserved
# -------------------------------
"""
writen by shenjackyuanjie
mail: 3695888@qq.com
github: @shenjackyuanjie
gitee: @shenjackyuanjie
"""
from Difficult_Rocket import game_version
from Difficult_Rocket.command import line
COMMAND = 'command'
SUB_COMMAND = 'sub_command'
INFO = 'info'
RUN = 'run'
DR_command = {
'name': 'DR-root',
'version': game_version,
INFO: 'DR的自带命令解析树',
COMMAND: {
INFO: '这里是DR的根命令节点',
RUN: None,
SUB_COMMAND: {
'stop': {
INFO: '退出游戏',
RUN: None
},
'fps': {
INFO: 'FPS相关命令',
RUN: None,
SUB_COMMAND: {
'log': {
INFO: '输出FPS信息',
RUN: None
},
'min': {
INFO: '输出一段时间内最小fps',
RUN: None
},
'max': {
INFO: '输出一段时间内最大FPS',
RUN: None
}
}
},
'default': {
INFO: '重置一些设置'
}
}
}
}
# TODO 给爷做了他
class CommandTree:
def __init__(self, command_tree_dict):
self.command_tree_dict = command_tree_dict
def parse(self, command: [line.CommandText, str]):
pass