-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added planet/surface info extraction
- Loading branch information
Showing
17 changed files
with
118 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# _factorio_version.py | ||
|
||
__factorio_version__ = "2.0.27.0" | ||
__factorio_version_info__ = (2, 0, 27, 0) | ||
__factorio_version__ = "2.0.29.0" | ||
__factorio_version_info__ = (2, 0, 29, 0) |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# planets.py | ||
|
||
import pickle | ||
|
||
import importlib.resources as pkg_resources | ||
|
||
from draftsman import data | ||
from draftsman.classes.collision_set import CollisionSet | ||
from draftsman.env import get_default_collision_mask | ||
from draftsman.utils import PrimitiveAABB, AABB | ||
|
||
|
||
try: | ||
with pkg_resources.open_binary(data, "planets.pkl") as inp: | ||
_data: dict = pickle.load(inp) | ||
|
||
raw: dict[str, dict] = _data[0] | ||
|
||
except FileNotFoundError: | ||
raw = {} | ||
|
||
def supports(object) -> bool: | ||
""" | ||
Checks to see if a | ||
""" | ||
pass |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule factorio-data
updated
15 files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# recipe_types.py | ||
""" | ||
Extracts different types of recipes into logical data structures and displays | ||
their contents to stdout. | ||
""" | ||
|
||
from draftsman.data import planets, recipes | ||
from draftsman.entity import AssemblingMachine | ||
|
||
def main(): | ||
# All recipes where productivity modules are allowed | ||
productivity_recipes = {} | ||
# All recipes where quality modules are allowed | ||
quality_recipes = {} | ||
# Recipes allowed on specific planets | ||
planet_recipes = {planet_name: {} for planet_name in planets.raw} | ||
|
||
for recipe_name, recipe in recipes.raw.items(): | ||
if "allow_quality" in recipe: | ||
productivity_recipes[recipe_name] = recipe | ||
if "allow_quality" in recipe: | ||
quality_recipes[recipe_name] = recipe | ||
for planet_name, planet in planets.raw.items(): | ||
if recipes.is_usable_on(recipe, planet): | ||
planet_recipes[planet_name][recipe_name] = recipe | ||
|
||
print("\t", productivity_recipes.keys()) | ||
print("\t", quality_recipes.keys()) | ||
for planet_name in planet_recipes: | ||
print("\t{}:\t{}".format(planet_name, planet_recipes[planet_name].keys())) | ||
|
||
# Recipes available for crafting in machines separately | ||
print("\t", recipes.for_machine["assembling-machine-1"]) | ||
# or, equivalently: | ||
machine = AssemblingMachine("assembling-machine-1") | ||
assert machine.allowed_recipes == recipes.for_machine[machine.name] | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |