예제 #1
0
 public Game(GameWindow gWindow)
 {
     gameWindow = gWindow;
     Network = gWindow.getNetwork();
     Network.NetClientEvent +=new NetCore.NetClientEventHandler(NetClientEventHandler);
     Network.ReceiveObservers += new NetCore.NetPackageReceiveHandler(NetPackageReceiveHandler);
 }
예제 #2
0
 public void initialize(UniversalLobby.model.LFNet network, UniversalLobby.model.Profile profile)
 {
     replay = "None";
     Network = network;
     MyProfile = profile;
     OpponentProfile = Network.getOpponentProfile();
     Refresher = new DispatcherTimer();
     Refresher.Interval = new TimeSpan(100);
     Refresher.Tick += new EventHandler(Refresher_Tick);
     CountDown = new DispatcherTimer();
     CountDown.Interval = new TimeSpan(10000000);
     CountDown.Tick += new EventHandler(CountDown_Tick);
     if (MyProfile.Username == null)
     {
         playerNamelb.Content = "Me";
     }
     else
     {
         playerNamelb.Content = MyProfile.Username;
     }
     if (OpponentProfile.Username == null)
     {
         opponentNamelb.Content = "Opponent";
     }
     else
     {
         opponentNamelb.Content = OpponentProfile.Username;
     }
     if (MyProfile.Avatar != null)
     {
         ImgMyProfile.Source = MyProfile.Avatar;
     }
     if (OpponentProfile.Avatar != null)
     {
         ImgOpponentProfile.Source = OpponentProfile.Avatar;
     }
 }
예제 #3
0
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            _profile = new Profile("", null);
            ProfileWindow profile = new ProfileWindow(_profile);
            profile.ShowDialog();

            _lfnet = new LFNet(_profile);
            _lfnet.NetClientEvent += NetClientEventHandler;
            _lfnet.NetError += NetCoreEventHandler;
            _lfnet.ReceiveObservers += NetPackageReceiveHandler;
        }