pyscreeps-arena 0.5.7a2__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 (32) hide show
  1. pyscreeps_arena-0.5.7a2/PKG-INFO +50 -0
  2. pyscreeps_arena-0.5.7a2/pyscreeps_arena/__init__.py +56 -0
  3. pyscreeps_arena-0.5.7a2/pyscreeps_arena/build.py +7 -0
  4. pyscreeps_arena-0.5.7a2/pyscreeps_arena/compiler.py +1398 -0
  5. pyscreeps_arena-0.5.7a2/pyscreeps_arena/core/__init__.py +1 -0
  6. pyscreeps_arena-0.5.7a2/pyscreeps_arena/core/basic.py +72 -0
  7. pyscreeps_arena-0.5.7a2/pyscreeps_arena/core/config.py +19 -0
  8. pyscreeps_arena-0.5.7a2/pyscreeps_arena/core/const.py +28 -0
  9. pyscreeps_arena-0.5.7a2/pyscreeps_arena/core/core.py +132 -0
  10. pyscreeps_arena-0.5.7a2/pyscreeps_arena/core/main.py +9 -0
  11. pyscreeps_arena-0.5.7a2/pyscreeps_arena/core/utils.py +11 -0
  12. pyscreeps_arena-0.5.7a2/pyscreeps_arena/localization.py +146 -0
  13. pyscreeps_arena-0.5.7a2/pyscreeps_arena/project.7z +0 -0
  14. pyscreeps_arena-0.5.7a2/pyscreeps_arena/ui/P2PY.py +108 -0
  15. pyscreeps_arena-0.5.7a2/pyscreeps_arena/ui/__init__.py +10 -0
  16. pyscreeps_arena-0.5.7a2/pyscreeps_arena/ui/creeplogic_edit.py +14 -0
  17. pyscreeps_arena-0.5.7a2/pyscreeps_arena/ui/project_ui.py +215 -0
  18. pyscreeps_arena-0.5.7a2/pyscreeps_arena/ui/qcreeplogic/__init__.py +3 -0
  19. pyscreeps_arena-0.5.7a2/pyscreeps_arena/ui/qcreeplogic/model.py +72 -0
  20. pyscreeps_arena-0.5.7a2/pyscreeps_arena/ui/qcreeplogic/qcreeplogic.py +709 -0
  21. pyscreeps_arena-0.5.7a2/pyscreeps_arena/ui/qrecipe/__init__.py +1 -0
  22. pyscreeps_arena-0.5.7a2/pyscreeps_arena/ui/qrecipe/model.py +434 -0
  23. pyscreeps_arena-0.5.7a2/pyscreeps_arena/ui/qrecipe/qrecipe.py +914 -0
  24. pyscreeps_arena-0.5.7a2/pyscreeps_arena/ui/rs_icon.py +43 -0
  25. pyscreeps_arena-0.5.7a2/pyscreeps_arena.egg-info/PKG-INFO +50 -0
  26. pyscreeps_arena-0.5.7a2/pyscreeps_arena.egg-info/SOURCES.txt +30 -0
  27. pyscreeps_arena-0.5.7a2/pyscreeps_arena.egg-info/dependency_links.txt +1 -0
  28. pyscreeps_arena-0.5.7a2/pyscreeps_arena.egg-info/entry_points.txt +4 -0
  29. pyscreeps_arena-0.5.7a2/pyscreeps_arena.egg-info/requires.txt +9 -0
  30. pyscreeps_arena-0.5.7a2/pyscreeps_arena.egg-info/top_level.txt +1 -0
  31. pyscreeps_arena-0.5.7a2/setup.cfg +4 -0
  32. pyscreeps_arena-0.5.7a2/setup.py +46 -0
@@ -0,0 +1,50 @@
1
+ Metadata-Version: 2.4
2
+ Name: pyscreeps-arena
3
+ Version: 0.5.7a2
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,56 @@
1
+ import os
2
+ import sys
3
+ import shutil
4
+ import py7zr
5
+ from pyscreeps_arena.core import const, config
6
+ def CMD_NewProject():
7
+ """
8
+ cmd:
9
+ pyscreeps-arena [project_path]
10
+ arena [project_path]
11
+
12
+ * 复制"src" "game" "build.py" 到指定目录
13
+
14
+ Returns:
15
+
16
+ """
17
+ if len(sys.argv) < 2:
18
+ print("Usage: pyarena new [project_path]\n# or\narena new [project_path]")
19
+ return
20
+ project_path = sys.argv[1]
21
+ if not os.path.exists(project_path):
22
+ os.makedirs(project_path)
23
+ this_path = os.path.dirname(os.path.abspath(__file__))
24
+ extract_7z(os.path.join(this_path, 'project.7z'), project_path)
25
+ print("Project created at", project_path)
26
+
27
+ def CMD_OpenUI():
28
+ """
29
+ cmd:
30
+ psaui
31
+
32
+ * 打开UI界面
33
+
34
+ Returns:
35
+
36
+ """
37
+ try:
38
+ # 检查是否带 -c
39
+ if len(sys.argv) > 1 and sys.argv[1] == '-c':
40
+ from pyscreeps_arena.ui.creeplogic_edit import run_creeplogic_edit
41
+ run_creeplogic_edit()
42
+ else:
43
+ from pyscreeps_arena.ui.project_ui import run_project_creator
44
+ run_project_creator()
45
+ except ImportError as e:
46
+ print(f"错误: 无法导入UI模块 - {e}")
47
+ print("请确保已安装PyQt6: pip install PyQt6")
48
+ except Exception as e:
49
+ print(f"错误: 打开UI界面失败 - {e}")
50
+
51
+ def extract_7z(file_path, output_dir):
52
+ with py7zr.SevenZipFile(file_path, mode='r') as archive:
53
+ archive.extractall(path=output_dir)
54
+
55
+ if __name__ == '__main__':
56
+ 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()