Difficult-Rocket/Difficult_Rocket/command/tree.py

69 lines
1.6 KiB
Python
Raw Normal View History

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