public GameUC() { app = (ITetrisMultiplayerApplication)Activator.CreateInstance(GetConfigurationType(), new GeniusTetris.Utils.WpfTimer()); //_Server = new GeniusP2PManager.Server(); //_Options = new ObservableCollection<byte>(); //_DataOptions = new DataOptions(); //_Game = new Game(new GeniusTetris.Utils.WpfTimer()); app.CurrentGame.OnGameOver += new EventHandler(_Game_OnGameOver); app.OnOptionArrived += new Action <GeniusTetris.Multiplayer.GeniusTetrisPlayer, GeniusTetris.Multiplayer.GeniusTetrisPlayer, byte>(app_OnOptionArrived); app.OnGameRequestAccepted += new Action <GeniusTetris.Multiplayer.GeniusTetrisPlayer>(app_OnGameRequestAccepted); app.OnGameRequestReceived += new Action <GeniusTetrisPlayer, string>(app_OnGameRequestReceived); app.OnHideBoard += new Action <GeniusTetris.Multiplayer.GeniusTetrisPlayer, bool>(app_OnHideBoard); app.OnEndGameEnd += new Action <GeniusTetrisPlayer, string>(app_OnEndGameEnd); app.OnGameOver += new Action <GeniusTetrisPlayer, string>(app_OnGameOver); app.OnSendBoard += new Action <GeniusTetrisPlayer, byte[, ]>(app_OnSendBoard); app.OnStartGameNow += new Action <GeniusTetrisPlayer>(app_OnStartGameNow); //_Game.OnOptionsChanged += new EventHandler(_Game_OnOptionsChanged); //_Game.Board.OnDropped += new EventHandler<BoardChangedEventArgs>(Board_OnDropped); //_Game.OnBoardChanged += new EventHandler(_Game_OnBoardChanged); //_Game.OnHideMyBoard += new EventHandler(_Game_OnHideMyBoard); _PlayersBoard = new Dictionary <Guid, GeniusTetris.BoardUC>(); _PlayersKey = new Dictionary <string, GeniusTetrisPlayer>(); InitializeComponent(); this.board.Board = app.CurrentGame.Board; //this.board1.Board = this.board2.Board = this.board3.Board = this.board4.Board = this.board5.Board = this.board6.Board = _Game.Board; this.previewctl.ShapeQueue = app.CurrentGame.ShapeQueue; Application.Current.Exit += new ExitEventHandler(Current_Exit); }
public ProxyGame(ITetrisMultiplayerApplication app, Guid toMember, Board toMemberBoard) { _app = app; _toMember = toMember; _toMemberBoard = toMemberBoard; }