Exemplo n.º 1
0
        /// <summary>
        /// Creates a new GameCore instance.
        /// </summary>
        /// <param name="logger"></param>
        /// <param name="gamemode"></param>
        /// <param name="skipInit">Whether to skip the customary X second init and gamemode setup</param>
        public GameCore(ILogger logger, Gamemodes.Gamemode gamemode, ModAssetInfo map, EngineSettings settings = null)
        {
            if (Logger == null)
            {
                Logger = new NullLogger();
            }
            else
            {
                Logger = new ModuleLogger(logger, "Game");
            }
            if (settings == null)
            {
                Settings = new EngineSettings();
            }
            else
            {
                Settings = settings;
            }

            //Set up the game mode internally
            Gamemode = gamemode;
            Gamemode.SetGame(this);

            Map = Maps.Map.LoadMap(map, this);

            InitializeGame();
        }
Exemplo n.º 2
0
        /// <summary>
        /// Creates a new GameCore instance.
        /// </summary>
        /// <param name="logger"></param>
        /// <param name="gamemode"></param>
        /// <param name="skipInit">Whether to skip the customary X second init and gamemode setup</param>
        public GameCore(ILogger logger, Gamemodes.Gamemode gamemode, string map, EngineSettings settings = null)
        {
            Logger = logger;
            if (Logger == null)
            {
                Logger = new NullLogger();
            }
            if (settings == null)
            {
                Settings = new EngineSettings();
            }
            else
            {
                Settings = settings;
            }

            //Set up the game mode internally
            Gamemode = gamemode;
            Gamemode.SetGame(this);

            Map = Maps.Map.Load(map, this);

            InitializeGame();
        }