public void Setup()
        {
            world = TestWorldBuilder.createTestWorld(20, 10);

            gameState = new GameState(world);

            inputHandler = Substitute.For <IPlayerInputHandler>();
            npf          = new NetworkedPlayerFactory(
                (transporter, handler) => new NetworkPlayerInputForwarder(transporter, handler, world),
                state => inputHandler, gameState);
        }
Beispiel #2
0
        public GodGameServer(WorldSimulationService worldSimulationService,
                             NetworkedPlayerFactory networkedPlayerFactory,
                             ClearGameStateChangesService clearStateChangesSimulator,
                             INetworkConnectorServer networkConnectorServer,
                             GameStateDeltaPacketBuilder deltaPacketBuilder,
                             Model.World world,
                             WorldPersisterService persisterService,
                             UserInputService userInputService)
        {
            World = world;
            this.WorldSimulationService     = worldSimulationService;
            this.clearStateChangesSimulator = clearStateChangesSimulator;
            this.networkConnectorServer     = networkConnectorServer;
            this.deltaPacketBuilder         = deltaPacketBuilder;
            this.userInputService           = userInputService;

            serverPlayerListener = new ServerPlayerListener(networkConnectorServer, networkedPlayerFactory);
            persisterService.Load(world, TWDir.GameData.GetChild("Saves/GodGame").CreateFile("auto.xml"));
        }