コード例 #1
0
        /// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="playerName">Human player name.</param>
        /// <param name="pointRule">Indicates the initial points count for every players.</param>
        /// <param name="endOfGameRule">The ruel to end a game.</param>
        /// <param name="save">Player save file.</param>
        /// <param name="useRedDoras">Indicates if red doras should be used.</param>
        /// <param name="useNagashiMangan"><c>True</c> to use the yaku 'Nagashi Mangan'.</param>
        /// <param name="useRenhou"><c>True</c> to use the yakuman 'Renhou'.</param>
        public MainWindow(string playerName, InitialPointsRulePivot pointRule, EndOfGameRulePivot endOfGameRule, PlayerSavePivot save, bool useRedDoras, bool useNagashiMangan, bool useRenhou)
        {
            InitializeComponent();

            LblHumanPlayer.Content = playerName;

            _game      = new GamePivot(playerName, pointRule, endOfGameRule, save, useRedDoras, useNagashiMangan, useRenhou);
            _tickSound = new System.Media.SoundPlayer(Properties.Resources.tick);

            _overlayStoryboard = FindResource("StbHideOverlay") as Storyboard;
            Storyboard.SetTarget(_overlayStoryboard, GrdOverlayCall);

            ApplyConfigurationToOverlayStoryboard();

            SetChronoTime();

            FixWindowDimensions();

            NewRoundRefresh();

            InitializeAutoPlayWorker();

            BindConfiguration();

            ContentRendered += delegate(object sender, EventArgs evt)
            {
                RunAutoPlay();
            };
        }
コード例 #2
0
        /// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="game">The game.</param>
        public EndOfGameWindow(GamePivot game)
        {
            InitializeComponent();

            List <PlayerScorePivot> playerScores = ScoreTools.ComputeCurrentRanking(game);

            for (int i = 0; i < playerScores.Count; i++)
            {
                this.FindControl("LblRank", i).Content   = playerScores[i].Rank;
                this.FindControl("LblPlayer", i).Content = playerScores[i].Player.Name;
                this.FindControl("LblPoints", i).Content = playerScores[i].Player.Points;
                this.FindControl("LblUma", i).ApplyGainAndLostStyle(playerScores[i].Uma);
                this.FindControl("LblScore", i).ApplyGainAndLostStyle(playerScores[i].Score);
            }
        }