pyscreeps-arena 0.2.1__tar.gz → 0.3.0__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.
- pyscreeps_arena-0.3.0/PKG-INFO +37 -0
- {pyscreeps_arena-0.2.1 → pyscreeps_arena-0.3.0}/pyscreeps_arena/build.py +17 -12
- pyscreeps_arena-0.3.0/pyscreeps_arena/project.7z +0 -0
- pyscreeps_arena-0.3.0/pyscreeps_arena.egg-info/PKG-INFO +37 -0
- {pyscreeps_arena-0.2.1 → pyscreeps_arena-0.3.0}/pyscreeps_arena.egg-info/requires.txt +1 -1
- {pyscreeps_arena-0.2.1 → pyscreeps_arena-0.3.0}/setup.py +2 -2
- pyscreeps_arena-0.2.1/PKG-INFO +0 -1001
- pyscreeps_arena-0.2.1/pyscreeps_arena/project.7z +0 -0
- pyscreeps_arena-0.2.1/pyscreeps_arena.egg-info/PKG-INFO +0 -1001
- {pyscreeps_arena-0.2.1 → pyscreeps_arena-0.3.0}/pyscreeps_arena/__init__.py +0 -0
- {pyscreeps_arena-0.2.1 → pyscreeps_arena-0.3.0}/pyscreeps_arena.egg-info/SOURCES.txt +0 -0
- {pyscreeps_arena-0.2.1 → pyscreeps_arena-0.3.0}/pyscreeps_arena.egg-info/dependency_links.txt +0 -0
- {pyscreeps_arena-0.2.1 → pyscreeps_arena-0.3.0}/pyscreeps_arena.egg-info/entry_points.txt +0 -0
- {pyscreeps_arena-0.2.1 → pyscreeps_arena-0.3.0}/pyscreeps_arena.egg-info/top_level.txt +0 -0
- {pyscreeps_arena-0.2.1 → pyscreeps_arena-0.3.0}/setup.cfg +0 -0
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: pyscreeps-arena
|
|
3
|
+
Version: 0.3.0
|
|
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: Transcrypt==3.9.3
|
|
18
|
+
Requires-Dist: mkdocs
|
|
19
|
+
Requires-Dist: mkdocstrings[python]
|
|
20
|
+
Requires-Dist: mkdocs-material
|
|
21
|
+
|
|
22
|
+
# PyScreeps-Arena
|
|
23
|
+
|
|
24
|
+
use cmd `pyscreeps-arena <your new project path>` to new a project.
|
|
25
|
+
|
|
26
|
+
## Tutorial
|
|
27
|
+
|
|
28
|
+
* [Tutorial 1: Loop and import](https://github.com/EagleBaby/python_screeps_arena/blob/main/tutorials/tutorial1-Loop%20and%20import.md)
|
|
29
|
+
* [Tutorial 2: Simple move](https://github.com/EagleBaby/python_screeps_arena/blob/main/tutorials/tutorial2-Simple%20move.md)
|
|
30
|
+
* [Tutorial 3: First attack](https://github.com/EagleBaby/python_screeps_arena/blob/main/tutorials/tutorial3-First%20attack.md)
|
|
31
|
+
* [Tutorial 4: Creeps bodies](https://github.com/EagleBaby/python_screeps_arena/blob/main/tutorials/tutorial4-Creeps%20Bodies.md)
|
|
32
|
+
* [Tutorial 5: Store and transfer](https://github.com/EagleBaby/python_screeps_arena/blob/main/tutorials/tutorial5-Store%20and%20transfer.md)
|
|
33
|
+
* [Tutorial 6: Terrain](https://github.com/EagleBaby/python_screeps_arena/blob/main/tutorials/tutorial6-Terrain.md)
|
|
34
|
+
* [Tutorial 7: Spawn creeps](https://github.com/EagleBaby/python_screeps_arena/blob/main/tutorials/tutorial7-Spawn%20creeps.md)
|
|
35
|
+
* [Tutorial 8: Harvest energy](https://github.com/EagleBaby/python_screeps_arena/blob/main/tutorials/tutorial8-Harvest%20energy.md)
|
|
36
|
+
* [Tutorial 9: Construction](https://github.com/EagleBaby/python_screeps_arena/blob/main/tutorials/tutorial9-Construction.md)
|
|
37
|
+
* [Tutorial 10: Final test](https://github.com/EagleBaby/python_screeps_arena/blob/main/tutorials/tutorial10-Final%20test.md)
|
|
@@ -215,7 +215,6 @@ class Compiler:
|
|
|
215
215
|
_pre_define_ = {} # define
|
|
216
216
|
_js_replace_, _insert_id_ = {}, 0 # insert
|
|
217
217
|
|
|
218
|
-
|
|
219
218
|
# ----------------------------------- IMPORT ----------------------------------- #
|
|
220
219
|
# 获取所有.py文件中的所有import的内容,并记录下来fname:[imp1, imp2, ...]
|
|
221
220
|
for i, fpath in enumerate(py_fpath):
|
|
@@ -241,7 +240,7 @@ class Compiler:
|
|
|
241
240
|
f.write(new_content)
|
|
242
241
|
|
|
243
242
|
# ------------------------------------ SORT ------------------------------------ #
|
|
244
|
-
# 获取所有.py文件中的所有# sort的内容,并记录下来(不存在则默认为
|
|
243
|
+
# 获取所有.py文件中的所有# sort的内容,并记录下来(不存在则默认为2^32-1)
|
|
245
244
|
for i, fpath in enumerate(py_fpath):
|
|
246
245
|
fname = py_names[i][:-3] + '.js'
|
|
247
246
|
content = self.auto_read(fpath)
|
|
@@ -250,11 +249,11 @@ class Compiler:
|
|
|
250
249
|
try:
|
|
251
250
|
sort_num = int(m.group(1))
|
|
252
251
|
except ValueError:
|
|
253
|
-
print(Fore.YELLOW + '[Warn] ' + Fore.RESET + f'sort number error: "{m.group(1)}", use
|
|
254
|
-
sort_num =
|
|
252
|
+
print(Fore.YELLOW + '[Warn] ' + Fore.RESET + f'sort number error: "{m.group(1)}", use 2^32-1 instead.')
|
|
253
|
+
sort_num = 4294967295
|
|
255
254
|
_pre_sort_[fname] = sort_num
|
|
256
255
|
else:
|
|
257
|
-
_pre_sort_[fname] =
|
|
256
|
+
_pre_sort_[fname] = 4294967295
|
|
258
257
|
|
|
259
258
|
# ------------------------------------ DEFINE ------------------------------------ #
|
|
260
259
|
# 扫描所有# define的内容,然后在.py中移除这些行,并记录下来
|
|
@@ -471,15 +470,21 @@ class Compiler:
|
|
|
471
470
|
f_sorts[self.JS_VM] = -1
|
|
472
471
|
|
|
473
472
|
err_flag = False
|
|
474
|
-
for module in usr_modules:
|
|
473
|
+
for i, module in enumerate(usr_modules):
|
|
475
474
|
if module[2:] not in f_sorts:
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
475
|
+
if module[2:6] == 'src.' and module[6:] in f_sorts:
|
|
476
|
+
f_sorts[module[2:]] = f_sorts[module[6:]]
|
|
477
|
+
# 为了解决这样的问题:
|
|
478
|
+
# > import src.creeps.basic
|
|
479
|
+
# import src.creeps.basic
|
|
480
480
|
else:
|
|
481
|
-
print(
|
|
482
|
-
|
|
481
|
+
print(Fore.RED + '\n[Error] ' + Fore.RESET + f'"{module[2:-3]}.py" is not a user module.')
|
|
482
|
+
imp_detail = t_imps.get(module, None)
|
|
483
|
+
if imp_detail:
|
|
484
|
+
print("\t\t-- May be imported by user in: %s" % imp_detail)
|
|
485
|
+
else:
|
|
486
|
+
print("\t\t-- Please move this file into the 'src' directory.")
|
|
487
|
+
err_flag = True
|
|
483
488
|
if err_flag:
|
|
484
489
|
sys.exit(1)
|
|
485
490
|
for i in range(len(usr_modules)):
|
|
Binary file
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: pyscreeps-arena
|
|
3
|
+
Version: 0.3.0
|
|
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: Transcrypt==3.9.3
|
|
18
|
+
Requires-Dist: mkdocs
|
|
19
|
+
Requires-Dist: mkdocstrings[python]
|
|
20
|
+
Requires-Dist: mkdocs-material
|
|
21
|
+
|
|
22
|
+
# PyScreeps-Arena
|
|
23
|
+
|
|
24
|
+
use cmd `pyscreeps-arena <your new project path>` to new a project.
|
|
25
|
+
|
|
26
|
+
## Tutorial
|
|
27
|
+
|
|
28
|
+
* [Tutorial 1: Loop and import](https://github.com/EagleBaby/python_screeps_arena/blob/main/tutorials/tutorial1-Loop%20and%20import.md)
|
|
29
|
+
* [Tutorial 2: Simple move](https://github.com/EagleBaby/python_screeps_arena/blob/main/tutorials/tutorial2-Simple%20move.md)
|
|
30
|
+
* [Tutorial 3: First attack](https://github.com/EagleBaby/python_screeps_arena/blob/main/tutorials/tutorial3-First%20attack.md)
|
|
31
|
+
* [Tutorial 4: Creeps bodies](https://github.com/EagleBaby/python_screeps_arena/blob/main/tutorials/tutorial4-Creeps%20Bodies.md)
|
|
32
|
+
* [Tutorial 5: Store and transfer](https://github.com/EagleBaby/python_screeps_arena/blob/main/tutorials/tutorial5-Store%20and%20transfer.md)
|
|
33
|
+
* [Tutorial 6: Terrain](https://github.com/EagleBaby/python_screeps_arena/blob/main/tutorials/tutorial6-Terrain.md)
|
|
34
|
+
* [Tutorial 7: Spawn creeps](https://github.com/EagleBaby/python_screeps_arena/blob/main/tutorials/tutorial7-Spawn%20creeps.md)
|
|
35
|
+
* [Tutorial 8: Harvest energy](https://github.com/EagleBaby/python_screeps_arena/blob/main/tutorials/tutorial8-Harvest%20energy.md)
|
|
36
|
+
* [Tutorial 9: Construction](https://github.com/EagleBaby/python_screeps_arena/blob/main/tutorials/tutorial9-Construction.md)
|
|
37
|
+
* [Tutorial 10: Final test](https://github.com/EagleBaby/python_screeps_arena/blob/main/tutorials/tutorial10-Final%20test.md)
|
|
@@ -7,7 +7,7 @@ with open(r"T:\New_PC\Import_Project\uploads\pyscreeps-arena_upload\pyscreeps-ar
|
|
|
7
7
|
long_description = f.read()
|
|
8
8
|
setup(
|
|
9
9
|
name='pyscreeps-arena',
|
|
10
|
-
version='0.
|
|
10
|
+
version='0.3.0',
|
|
11
11
|
description='Python api|interface to play game: Screeps: Arena.',
|
|
12
12
|
long_description=long_description,
|
|
13
13
|
long_description_content_type='text/markdown',
|
|
@@ -34,7 +34,7 @@ setup(
|
|
|
34
34
|
'pyperclip',
|
|
35
35
|
'colorama',
|
|
36
36
|
'py7zr',
|
|
37
|
-
'Transcrypt==3.9.
|
|
37
|
+
'Transcrypt==3.9.3',
|
|
38
38
|
'mkdocs',
|
|
39
39
|
'mkdocstrings[python]',
|
|
40
40
|
'mkdocs-material',
|