Build independent base gameplay and source-bound native verification
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
"""Execute production discovery bounds; native LOS/identity remain runtime checks."""
|
||||
from policy_harness import ROOT, body, run
|
||||
|
||||
source = ROOT / 'addons/core/Scripts/Game/ERR/ERR_SiteDiscoveryRules.c'
|
||||
methods = '\n'.join(body(source, sig) for sig in (
|
||||
'static float RadioRadiusLimit(', 'static bool ValidRadius(', 'static bool InRange('
|
||||
)).replace('ERR_LocationKind.', 'ERR_LocationKind::')
|
||||
run('''#include <cassert>
|
||||
enum class ERR_LocationKind { PRISON, RADIO, EXTRACTION, OUTPOST, DEPOT };
|
||||
''' + methods.replace('int kind,', 'ERR_LocationKind kind,') + '''
|
||||
int main() {
|
||||
using K=ERR_LocationKind;
|
||||
assert(ValidRadius(K::RADIO,0) && ValidRadius(K::RADIO,8));
|
||||
assert(!ValidRadius(K::RADIO,8.01f) && !ValidRadius(K::RADIO,-1));
|
||||
assert(ValidRadius(K::DEPOT,60) && ValidRadius(K::OUTPOST,60));
|
||||
assert(!ValidRadius(K::DEPOT,60.01f));
|
||||
assert(ValidRadius(K::PRISON,0) && ValidRadius(K::EXTRACTION,0));
|
||||
assert(!ValidRadius(K::PRISON,1) && !ValidRadius(K::EXTRACTION,1));
|
||||
assert(!ValidRadius(static_cast<K>(42),0));
|
||||
assert(InRange(8,8,8) && InRange(8,0,0));
|
||||
assert(!InRange(0,0,0) && !InRange(8,8.01f,0));
|
||||
assert(!InRange(8,0,8.01f) && !InRange(8,-1,0) && !InRange(8,0,-1));
|
||||
}
|
||||
''')
|
||||
print('PASS: authored radio/optional-site bounds and physical horizontal/vertical boundaries')
|
||||
Reference in New Issue
Block a user