Esempio n. 1
0
        public void PlayerListNotEmpty()
        {
            var listVM      = new PlayerListViewModel();
            var dataVM      = new PlayerDataViewModel();
            var coordinator = new PlayerListCoordinator(listVM, dataVM, (wrapper) => {});

            coordinator.Run(TimeSpan.FromMilliseconds(50));
            Thread.Sleep(100);
            Assert.NotEmpty(listVM.Items);
        }
        internal PlayerListCoordinator(PlayerListViewModel listViewModel, PlayerDataViewModel dataViewModel, Action <UdpWrapper <GamePacket> > onJoinGameEvent)
        {
            _playerView    = listViewModel;
            _playerDataBox = dataViewModel;
            {
                UdpClient multicastClient = new UdpClient(Config.MulticastEndPoint.Port);
                multicastClient.JoinMulticastGroup(Config.MulticastEndPoint.Address);
                multicastClient.MulticastLoopback = true;
                _multicaster = new UdpWrapper <Player>(multicastClient, Config.MulticastEndPoint, false);
            }
            _invitationManager = new InvitationManager();
            _invitationManager.JoinGameEvent += onJoinGameEvent;

            _playerDataBox.SetPublicEndPoint(_invitationManager.ListenerEndPoint);
        }
Esempio n. 3
0
 public PlayerData()
 {
     InitializeComponent();
     viewModel = new PlayerDataViewModel(this);
 }