public NetworkModule(IConnection networkConnection, Game gameOpponent, IUserInquirer userInquirer) { initialize(); this.networkConnection = networkConnection; this.gameOpponent = gameOpponent; this.userInquirer = userInquirer; if (gameOpponent == null) throw new InvalidStateException("NetworkModule: Opponent is not set!"); }
private void loadCurrentRound(Game game) { visualSoundsContainer.Children.Clear(); // remove all sounds if (game == this.game) { game.RegisterVisual(this.graphicsControl); game.PreRoundLoaded += new VoidChangeDelegate(game_PreRoundLoaded); } else { game.RegisterVisual(this.graphicsControlOpponent); } game.LoadCurrentRound(); if (!game.IsQuestValid(this.quest)) { DebuggerIX.WriteLine(DebuggerTag.Game, "Quest", "Quest is not valid!"); throw new NotValidQuestException(game.QuestValidationErrorMessage); } if (game == this.game) { game.GameRepository.GameStarted += new VoidChangeDelegate(timeStart); DataContext = this; tbSteps.DataContext = this.Game.GameRepository; tbRoundName.DataContext = this.Game.GameRepository; Notify("GameRepository"); game.StartRendering(); } else { game.StartRendering(); } }
public void SetGameOpponent(Game gameOpponent) { this.gameOpponent = gameOpponent; }