pyscreeps-arena 0.1.10__tar.gz → 0.5.7.6__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. pyscreeps_arena-0.5.7.6/PKG-INFO +50 -0
  2. pyscreeps_arena-0.5.7.6/pyscreeps_arena/__init__.py +88 -0
  3. pyscreeps_arena-0.5.7.6/pyscreeps_arena/build.py +7 -0
  4. pyscreeps_arena-0.5.7.6/pyscreeps_arena/compiler.py +1403 -0
  5. pyscreeps_arena-0.5.7.6/pyscreeps_arena/core/__init__.py +1 -0
  6. pyscreeps_arena-0.5.7.6/pyscreeps_arena/core/basic.py +72 -0
  7. pyscreeps_arena-0.5.7.6/pyscreeps_arena/core/config.py +19 -0
  8. pyscreeps_arena-0.5.7.6/pyscreeps_arena/core/const.py +28 -0
  9. pyscreeps_arena-0.5.7.6/pyscreeps_arena/core/core.py +132 -0
  10. pyscreeps_arena-0.5.7.6/pyscreeps_arena/core/main.py +9 -0
  11. pyscreeps_arena-0.5.7.6/pyscreeps_arena/core/utils.py +11 -0
  12. pyscreeps_arena-0.5.7.6/pyscreeps_arena/localization.py +150 -0
  13. pyscreeps_arena-0.5.7.6/pyscreeps_arena/project.7z +0 -0
  14. pyscreeps_arena-0.5.7.6/pyscreeps_arena/ui/P2PY.py +108 -0
  15. pyscreeps_arena-0.5.7.6/pyscreeps_arena/ui/__init__.py +12 -0
  16. pyscreeps_arena-0.5.7.6/pyscreeps_arena/ui/creeplogic_edit.py +14 -0
  17. pyscreeps_arena-0.5.7.6/pyscreeps_arena/ui/map_render.py +705 -0
  18. pyscreeps_arena-0.5.7.6/pyscreeps_arena/ui/mapviewer.py +14 -0
  19. pyscreeps_arena-0.5.7.6/pyscreeps_arena/ui/project_ui.py +215 -0
  20. pyscreeps_arena-0.5.7.6/pyscreeps_arena/ui/qcreeplogic/__init__.py +3 -0
  21. pyscreeps_arena-0.5.7.6/pyscreeps_arena/ui/qcreeplogic/model.py +72 -0
  22. pyscreeps_arena-0.5.7.6/pyscreeps_arena/ui/qcreeplogic/qcreeplogic.py +770 -0
  23. pyscreeps_arena-0.5.7.6/pyscreeps_arena/ui/qmapker/__init__.py +1 -0
  24. pyscreeps_arena-0.5.7.6/pyscreeps_arena/ui/qmapker/qmapmarker.py +339 -0
  25. pyscreeps_arena-0.5.7.6/pyscreeps_arena/ui/qmapker/qvariable.py +303 -0
  26. pyscreeps_arena-0.5.7.6/pyscreeps_arena/ui/qmapker/test_compact_variable.py +61 -0
  27. pyscreeps_arena-0.5.7.6/pyscreeps_arena/ui/qmapker/test_qmapmarker.py +71 -0
  28. pyscreeps_arena-0.5.7.6/pyscreeps_arena/ui/qmapker/test_qvariable.py +49 -0
  29. pyscreeps_arena-0.5.7.6/pyscreeps_arena/ui/qmapker/to_code.py +100 -0
  30. pyscreeps_arena-0.5.7.6/pyscreeps_arena/ui/qmapv/__init__.py +3 -0
  31. pyscreeps_arena-0.5.7.6/pyscreeps_arena/ui/qmapv/qcinfo.py +567 -0
  32. pyscreeps_arena-0.5.7.6/pyscreeps_arena/ui/qmapv/qco.py +441 -0
  33. pyscreeps_arena-0.5.7.6/pyscreeps_arena/ui/qmapv/qmapv.py +728 -0
  34. pyscreeps_arena-0.5.7.6/pyscreeps_arena/ui/qmapv/test_array_drag.py +191 -0
  35. pyscreeps_arena-0.5.7.6/pyscreeps_arena/ui/qmapv/test_drag.py +107 -0
  36. pyscreeps_arena-0.5.7.6/pyscreeps_arena/ui/qmapv/test_qcinfo.py +169 -0
  37. pyscreeps_arena-0.5.7.6/pyscreeps_arena/ui/qmapv/test_qco_drag.py +7 -0
  38. pyscreeps_arena-0.5.7.6/pyscreeps_arena/ui/qmapv/test_qmapv.py +224 -0
  39. pyscreeps_arena-0.5.7.6/pyscreeps_arena/ui/qmapv/test_simple_array.py +303 -0
  40. pyscreeps_arena-0.5.7.6/pyscreeps_arena/ui/qrecipe/__init__.py +1 -0
  41. pyscreeps_arena-0.5.7.6/pyscreeps_arena/ui/qrecipe/model.py +434 -0
  42. pyscreeps_arena-0.5.7.6/pyscreeps_arena/ui/qrecipe/qrecipe.py +914 -0
  43. pyscreeps_arena-0.5.7.6/pyscreeps_arena/ui/rs_icon.py +43 -0
  44. pyscreeps_arena-0.5.7.6/pyscreeps_arena.egg-info/PKG-INFO +50 -0
  45. pyscreeps_arena-0.5.7.6/pyscreeps_arena.egg-info/SOURCES.txt +49 -0
  46. pyscreeps_arena-0.5.7.6/pyscreeps_arena.egg-info/entry_points.txt +4 -0
  47. {pyscreeps-arena-0.1.10 → pyscreeps_arena-0.5.7.6}/pyscreeps_arena.egg-info/requires.txt +2 -0
  48. {pyscreeps-arena-0.1.10 → pyscreeps_arena-0.5.7.6}/setup.py +7 -3
  49. pyscreeps-arena-0.1.10/PKG-INFO +0 -22
  50. pyscreeps-arena-0.1.10/pyscreeps_arena/__init__.py +0 -31
  51. pyscreeps-arena-0.1.10/pyscreeps_arena/build.py +0 -527
  52. pyscreeps-arena-0.1.10/pyscreeps_arena/project.7z +0 -0
  53. pyscreeps-arena-0.1.10/pyscreeps_arena.egg-info/PKG-INFO +0 -22
  54. pyscreeps-arena-0.1.10/pyscreeps_arena.egg-info/SOURCES.txt +0 -10
  55. pyscreeps-arena-0.1.10/pyscreeps_arena.egg-info/entry_points.txt +0 -2
  56. {pyscreeps-arena-0.1.10 → pyscreeps_arena-0.5.7.6}/pyscreeps_arena.egg-info/dependency_links.txt +0 -0
  57. {pyscreeps-arena-0.1.10 → pyscreeps_arena-0.5.7.6}/pyscreeps_arena.egg-info/top_level.txt +0 -0
  58. {pyscreeps-arena-0.1.10 → pyscreeps_arena-0.5.7.6}/setup.cfg +0 -0
@@ -0,0 +1,50 @@
1
+ Metadata-Version: 2.4
2
+ Name: pyscreeps-arena
3
+ Version: 0.5.7.6
4
+ Summary: Python api|interface to play game: Screeps: Arena.
5
+ Author-email: 2229066748@qq.com
6
+ Maintainer: Eagle'sBaby
7
+ Maintainer-email: 2229066748@qq.com
8
+ License: Apache Licence 2.0
9
+ Keywords: python,screeps:arena,screeps
10
+ Classifier: Programming Language :: Python
11
+ Classifier: Programming Language :: Python :: 3
12
+ Requires-Python: >=3.10
13
+ Description-Content-Type: text/markdown
14
+ Requires-Dist: pyperclip
15
+ Requires-Dist: colorama
16
+ Requires-Dist: py7zr
17
+ Requires-Dist: chardet
18
+ Requires-Dist: Transcrypt==3.9.1
19
+ Requires-Dist: PyQt6
20
+ Requires-Dist: mkdocs
21
+ Requires-Dist: mkdocstrings[python]
22
+ Requires-Dist: mkdocs-material
23
+ Dynamic: author-email
24
+ Dynamic: classifier
25
+ Dynamic: description
26
+ Dynamic: description-content-type
27
+ Dynamic: keywords
28
+ Dynamic: license
29
+ Dynamic: maintainer
30
+ Dynamic: maintainer-email
31
+ Dynamic: requires-dist
32
+ Dynamic: requires-python
33
+ Dynamic: summary
34
+
35
+ # PyScreeps-Arena
36
+
37
+ use cmd `pyscreeps-arena <your new project path>` to new a project.
38
+
39
+ ## Tutorial
40
+
41
+ * [Tutorial 1: Loop and import](https://github.com/EagleBaby/python_screeps_arena/blob/main/tutorials/tutorial1-Loop%20and%20import.md)
42
+ * [Tutorial 2: Simple move](https://github.com/EagleBaby/python_screeps_arena/blob/main/tutorials/tutorial2-Simple%20move.md)
43
+ * [Tutorial 3: First attack](https://github.com/EagleBaby/python_screeps_arena/blob/main/tutorials/tutorial3-First%20attack.md)
44
+ * [Tutorial 4: Creeps bodies](https://github.com/EagleBaby/python_screeps_arena/blob/main/tutorials/tutorial4-Creeps%20Bodies.md)
45
+ * [Tutorial 5: Store and transfer](https://github.com/EagleBaby/python_screeps_arena/blob/main/tutorials/tutorial5-Store%20and%20transfer.md)
46
+ * [Tutorial 6: Terrain](https://github.com/EagleBaby/python_screeps_arena/blob/main/tutorials/tutorial6-Terrain.md)
47
+ * [Tutorial 7: Spawn creeps](https://github.com/EagleBaby/python_screeps_arena/blob/main/tutorials/tutorial7-Spawn%20creeps.md)
48
+ * [Tutorial 8: Harvest energy](https://github.com/EagleBaby/python_screeps_arena/blob/main/tutorials/tutorial8-Harvest%20energy.md)
49
+ * [Tutorial 9: Construction](https://github.com/EagleBaby/python_screeps_arena/blob/main/tutorials/tutorial9-Construction.md)
50
+ * [Tutorial 10: Final test](https://github.com/EagleBaby/python_screeps_arena/blob/main/tutorials/tutorial10-Final%20test.md)
@@ -0,0 +1,88 @@
1
+ import os
2
+ import sys
3
+ import shutil
4
+ import py7zr
5
+ from pyscreeps_arena.core import const, config
6
+ from pyscreeps_arena.ui.mapviewer import run_mapviewer
7
+ from pyscreeps_arena.ui.project_ui import run_project_creator
8
+ from pyscreeps_arena.ui.creeplogic_edit import run_creeplogic_edit
9
+
10
+ def CMD_NewProject():
11
+ """
12
+ cmd:
13
+ pyscreeps-arena [project_path]
14
+ arena [project_path]
15
+
16
+ * 复制"src" "game" "build.py" 到指定目录
17
+
18
+ Returns:
19
+
20
+ """
21
+ if len(sys.argv) < 2:
22
+ print("Usage: pyarena new [project_path]\n# or\narena new [project_path]")
23
+ return
24
+ project_path = sys.argv[1]
25
+ if not os.path.exists(project_path):
26
+ os.makedirs(project_path)
27
+ this_path = os.path.dirname(os.path.abspath(__file__))
28
+ extract_7z(os.path.join(this_path, 'project.7z'), project_path)
29
+ print("Project created at", project_path)
30
+
31
+ def CMD_OpenUI():
32
+ """
33
+ cmd:
34
+ psaui 无参数,启用project ui
35
+ psaui -c/-e 启用creeplogic edit
36
+ psaui -m [-c/-e] 启用mapviewer. 默认cn,可以指定-c/-e
37
+ psaui -h 显示帮助信息
38
+
39
+ * 打开UI界面
40
+
41
+ Returns:
42
+
43
+ """
44
+ try:
45
+ # 显示帮助信息
46
+ if len(sys.argv) > 1 and sys.argv[1] == '-h':
47
+ print("Usage:")
48
+ print(" psaui 启用project ui")
49
+ print(" psaui -c/-e 启用creeplogic edit (-c: 中文, -e: 英文)")
50
+ print(" psaui -m [-c/-e] 启用mapviewer (-c: 中文, -e: 英文, 默认: 中文)")
51
+ print(" psaui -h 显示帮助信息")
52
+ print(" --------------------------------------------------------------")
53
+ print(" psaui run `project ui`")
54
+ print(" psaui -c/-e run `creeplogic edit` (-c: chinese, -e: english)")
55
+ print(" psaui -m [-c/-e] run `mapviewer` (-c: chinese, -e: english, default: chinese)")
56
+ print(" psaui -h Show this help message")
57
+
58
+ return
59
+
60
+ # 检查是否使用mapviewer
61
+ if len(sys.argv) > 1 and sys.argv[1] == '-m':
62
+ # 检查语言参数
63
+ if len(sys.argv) > 2 and sys.argv[2] == '-e':
64
+ from pyscreeps_arena.core import config
65
+ config.language = 'en'
66
+ run_mapviewer()
67
+ # 检查是否使用creeplogic edit
68
+ elif len(sys.argv) > 1 and sys.argv[1] == '-c':
69
+ run_creeplogic_edit()
70
+ elif len(sys.argv) > 1 and sys.argv[1] == '-e':
71
+ from pyscreeps_arena.core import config
72
+ config.language = 'en'
73
+ run_creeplogic_edit()
74
+ # 默认启用project ui
75
+ else:
76
+ run_project_creator()
77
+ except ImportError as e:
78
+ print(f"错误: 无法导入UI模块 - {e}")
79
+ print("请确保已安装PyQt6: pip install PyQt6")
80
+ except Exception as e:
81
+ print(f"错误: 打开UI界面失败 - {e}")
82
+
83
+ def extract_7z(file_path, output_dir):
84
+ with py7zr.SevenZipFile(file_path, mode='r') as archive:
85
+ archive.extractall(path=output_dir)
86
+
87
+ if __name__ == '__main__':
88
+ CMD_OpenUI()
@@ -0,0 +1,7 @@
1
+ from pyscreeps_arena.compiler import Compiler
2
+
3
+ if __name__ == '__main__':
4
+ compiler = Compiler('src', 'library', 'build')
5
+
6
+ compiler.compile()
7
+ # compiler.clean()