Add shipping lane support to campaign files.

These don't actually do anything yet, this is just the campaign support
and UI.

https://github.com/Khopa/dcs_liberation/issues/826
This commit is contained in:
Dan Albert
2021-04-24 21:32:37 -07:00
parent 97b73e1a01
commit 5e67ce0ab2
6 changed files with 173 additions and 40 deletions

View File

@@ -1,5 +1,6 @@
from __future__ import annotations
import itertools
import math
from dataclasses import dataclass
from typing import Union
@@ -178,3 +179,13 @@ def mach(value: float, altitude: Distance) -> Speed:
SPEED_OF_SOUND_AT_SEA_LEVEL = knots(661.5)
def pairwise(iterable):
"""
itertools recipe
s -> (s0,s1), (s1,s2), (s2, s3), ...
"""
a, b = itertools.tee(iterable)
next(b, None)
return zip(a, b)