示例#1
0
        /// <summary>
        /// Setup the engine.
        ///
        /// This loads the game constants from the given constants file and initializes the user options.
        ///
        /// NOTE: This does NOT actually load the user options. That happens after calling Begin.
        /// </summary>
        /// <param name="constantsFileName"></param>
        /// <param name="setupAction"></param>
        /// <param name="optionFileName"></param>
        public static void Setup(string constantsFileName, string optionFileName, Action setupAction)
        {
            GameConstants.ReadFromFile(constantsFileName);
            ConvertUnits.SetDisplayUnitToSimUnitRatio(GameConstants.PixelsPerSimUnit);

            UserOptions.SetFileName(optionFileName);
            AddOptions();
            setupAction();

            SetupCalled = true;
        }