Remove LoadScripts from CSimualation2

`LoadScripts` and `LoadDefaultScripts` have to be called imediately
after the `CSimulation2` constructor.

By doing the necesarry work in the constructor and removing
`LoadScripts` and `LoadDefaultScripts` the interface of `CSimulation2`
is simplified.
This commit is contained in:
phosit
2025-11-21 18:57:53 +01:00
parent 0b83e24065
commit ba2351611c
13 changed files with 61 additions and 89 deletions
+2 -3
View File
@@ -1,4 +1,4 @@
/* Copyright (C) 2025 Wildfire Games.
/* Copyright (C) 2026 Wildfire Games.
* This file is part of 0 A.D.
*
* 0 A.D. is free software: you can redistribute it and/or modify
@@ -596,8 +596,7 @@ bool Init(const CmdLineArgs& args, int flags)
{
try
{
CSimulation2 sim{NULL, *g_ScriptContext, NULL};
sim.LoadDefaultScripts();
CSimulation2 sim{NULL, *g_ScriptContext, NULL, CSimulation2::DEFAULT_SCRIPTS};
std::ofstream f("entity.rng", std::ios_base::out | std::ios_base::trunc);
f << sim.GenerateSchema();
debug_printf("Generated entity.rng\n");