Inheritance: Dwarrowdelf.Server.GameEngine
Exemplo n.º 1
0
        public IGame CreateGame(string gameDir, GameOptions options)
        {
            MyTraceContext.ThreadTraceContext = new MyTraceContext("Server");

            Trace.TraceInformation("Initializing area");
            var initSw = Stopwatch.StartNew();

            IGame game;

            switch (options.Mode)
            {
            case GameMode.Fortress:
                game = new Fortress.FortressGame(gameDir, options);
                break;

            case GameMode.Adventure:
                game = new Fortress.DungeonGame(gameDir, options);
                break;

            default:
                throw new Exception();
            }

            initSw.Stop();
            Trace.TraceInformation("Initializing area took {0} ms", initSw.ElapsedMilliseconds);

            return(game);
        }
Exemplo n.º 2
0
        public IGame CreateGame(string gameDir, GameOptions options)
        {
            MyTraceContext.ThreadTraceContext = new MyTraceContext("Server");

            Trace.TraceInformation("Initializing area");
            var initSw = Stopwatch.StartNew();

            IGame game;

            switch (options.Mode)
            {
                case GameMode.Fortress:
                    game = new Fortress.FortressGame(gameDir, options);
                    break;

                case GameMode.Adventure:
                    game = new Fortress.DungeonGame(gameDir, options);
                    break;

                default:
                    throw new Exception();
            }

            initSw.Stop();
            Trace.TraceInformation("Initializing area took {0} ms", initSw.ElapsedMilliseconds);

            return game;
        }