예제 #1
0
        /// <summary>
        /// Draws every visualizable element.
        /// </summary>
        public void Draw(ExtendedSpriteBatch spriteBatch, AutomaticTurnGame game) {
            float interpolate = 1.0f;
            if (Interpolate) {
                interpolate = game.InterpolationPercentage;
            }

            foreach (IVisualizable visualizable in _visualizable) {
                visualizable.Draw(spriteBatch, interpolate);
            }
        }
예제 #2
0
        public GameEngineManager(string snapshotJson, string templateJson, int targetUpdatesPerSecond) {
            // allocate the engine
            // TODO: examine the maybe, make sure the game actually loaded
            _gameEngine = GameEngineFactory.CreateEngine(snapshotJson, templateJson).Value;

            // create the event monitors
            CreateEventMonitors(_gameEngine.EventNotifier);

            _networkContext = NetworkContext.CreateServer(new Player("test-player"), "");
            _turnGame = new AutomaticTurnGame(_networkContext, targetUpdatesPerSecond);
        }
 protected void OnEnable()
 {
     _networkContext = NetworkContext.CreateServer(HostPlayer, "");
     _game = new AutomaticTurnGame(_networkContext, TargetUpdatesPerSecond);
 }