mirror of
https://github.com/dcs-liberation/dcs_liberation.git
synced 2025-11-10 14:22:26 +00:00
Doctrine load from YAML (#3291)
This PR refactors the Doctrine class to load from YAML files in the resources folder instead of being hardcoded as a step towards making doctrines moddable (Issue #829). I haven't added anything to the changelog as a couple of things should get cleaned up first: - As far as I can tell, the flags in the Doctrine class (cap, cas, sead etc.) aren't used anywhere. Need to test further, and if they're truly not used, will remove them. - Probably need to update the Wiki
This commit is contained in:
@@ -8,7 +8,7 @@ import pytest
|
||||
from dcs.terrain import Caucasus
|
||||
from shapely import Point, MultiPolygon, Polygon, unary_union
|
||||
|
||||
from game.data.doctrine import ALL_DOCTRINES
|
||||
from game.data.doctrine import Doctrine
|
||||
from game.flightplan.ipsolver import IpSolver
|
||||
from game.flightplan.waypointsolver import NoSolutionsError
|
||||
from game.flightplan.waypointstrategy import point_at_heading
|
||||
@@ -70,7 +70,7 @@ def fuzzed_solver_fixture(
|
||||
departure = Point(0, 0)
|
||||
target = point_at_heading(departure, target_heading, fuzzed_target_distance)
|
||||
solver = IpSolver(
|
||||
departure, target, random.choice(ALL_DOCTRINES), fuzzed_threat_poly
|
||||
departure, target, random.choice(Doctrine.all_doctrines()), fuzzed_threat_poly
|
||||
)
|
||||
solver.set_debug_properties(tmp_path, Caucasus())
|
||||
return solver
|
||||
@@ -98,4 +98,4 @@ def test_fuzz_ipsolver(fuzzed_solver: IpSolver, run_number: int) -> None:
|
||||
|
||||
|
||||
def test_can_construct_solver_with_empty_threat() -> None:
|
||||
IpSolver(Point(0, 0), Point(0, 0), ALL_DOCTRINES[0], MultiPolygon([]))
|
||||
IpSolver(Point(0, 0), Point(0, 0), Doctrine.named("coldwar"), MultiPolygon([]))
|
||||
|
||||
Reference in New Issue
Block a user