コード例 #1
0
ファイル: NetworkModule.cs プロジェクト: MartyIX/SoTh
        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!");
        }
コード例 #2
0
ファイル: Round.cs プロジェクト: MartyIX/SoTh
        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();
            }
        }
コード例 #3
0
ファイル: NetworkModule.cs プロジェクト: MartyIX/SoTh
 public void SetGameOpponent(Game gameOpponent)
 {
     this.gameOpponent = gameOpponent;
 }