コード例 #1
0
ファイル: GameResult.cs プロジェクト: Troman-cs/DBD-Monitor
        public int getBpAmount(PlayerIndex playerIndex)
        {
            Dbg.assertPlayerIndexIsInRangeAndNotInvalid(playerIndex);

            return(this.playerBpAmount[(int)playerIndex]);
        }
コード例 #2
0
ファイル: GameResult.cs プロジェクト: Troman-cs/DBD-Monitor
        public bool isBpAmountSet(PlayerIndex playerIndex)
        {
            Dbg.assertPlayerIndexIsInRangeAndNotInvalid(playerIndex);

            return(this.playerBpAmount[( int )playerIndex] != EndscoreBpDigitGfx.INVALID_BP_AMOUNT);
        }
コード例 #3
0
ファイル: GameResult.cs プロジェクト: Troman-cs/DBD-Monitor
        public bool isSurvivorStillPlaying(int survivorIndex)
        {
            Dbg.assertIsValidSurvivorIndex(survivorIndex);

            return(getSurvivorResultIcon(survivorIndex) == EndgameSurvivorIcon.SurvIconStillPlaying);
        }
コード例 #4
0
ファイル: GameResult.cs プロジェクト: Troman-cs/DBD-Monitor
        /// <summary>
        /// Set BP amount for survivor or killer
        /// </summary>
        public void setBpAmount(PlayerIndex playerIndex, int myBpAmount)
        {
            Dbg.assertPlayerIndexIsInRangeAndNotInvalid(playerIndex);

            this.playerBpAmount[( int )playerIndex] = myBpAmount;
        }
コード例 #5
0
ファイル: GameResult.cs プロジェクト: Troman-cs/DBD-Monitor
        /// <summary>
        /// Was killed or escaped (not still playing and not DCed etc)
        /// </summary>
        public bool isSurvivorKilledOrEscaped(int survivorIndex)
        {
            Dbg.assertIsValidSurvivorIndex(survivorIndex);

            return(isSurvivorEscaped(survivorIndex) || isSurvivorKilled(survivorIndex));
        }
コード例 #6
0
ファイル: GameResult.cs プロジェクト: Troman-cs/DBD-Monitor
        /// <summary>
        /// Survivor or Killer DCed
        /// </summary>
        public bool isPlayerDCed(int survivorIndex)
        {
            Dbg.assertPlayerIndexIsInRangeAndNotInvalid((PlayerIndex)survivorIndex);

            return(getSurvivorResultIcon(survivorIndex) == EndgameSurvivorIcon.DCed);
        }
コード例 #7
0
ファイル: GameResult.cs プロジェクト: Troman-cs/DBD-Monitor
        public bool isSurvivorEscaped(int survivorIndex)
        {
            Dbg.assertIsValidSurvivorIndex(survivorIndex);

            return(getSurvivorResultIcon(survivorIndex) == EndgameSurvivorIcon.Escaped);
        }
コード例 #8
0
ファイル: GameResult.cs プロジェクト: Troman-cs/DBD-Monitor
        /// <summary>
        /// Get string for saving to disk
        /// </summary>
        public string getStringForSaving()
        {
            // Player index
            var playerIndexEnum = getSelectedPlayerIndex();
            int playerIndex     = ( int )playerIndexEnum;

            Dbg.assertPlayerIndexIsInRangeAndNotInvalid(playerIndexEnum);

            string surv1Result = _resultIconToString(getSurvivorResultIcon(0));
            string surv2Result = _resultIconToString(getSurvivorResultIcon(1));
            string surv3Result = _resultIconToString(getSurvivorResultIcon(2));
            string surv4Result = _resultIconToString(getSurvivorResultIcon(3));

            string killerResult = "";

            string pipResult = "";

            string gameDuration = "";

            string myCharacterName = "";


            return(StatSaver.lineGameStat + StatSaver.lineNameSeparator + StatSaver.gameLinePlayerIndexField +
                   StatSaver.gameFieldValueSeparator + playerIndex + StatSaver.gameFieldsSeparator +
                   StatSaver.gameLineSurvivor1ResultField + StatSaver.gameFieldValueSeparator +
                   surv1Result + StatSaver.gameFieldsSeparator + StatSaver.gameLineSurvivor2ResultField +
                   StatSaver.gameFieldValueSeparator + surv2Result + StatSaver.gameFieldsSeparator +
                   StatSaver.gameLineSurvivor3ResultField + StatSaver.gameFieldValueSeparator + surv3Result +
                   StatSaver.gameFieldsSeparator + StatSaver.gameLineSurvivor4ResultField +
                   StatSaver.gameFieldValueSeparator + surv4Result + StatSaver.gameFieldsSeparator +

                   // Killer result
                   StatSaver.gameLineKillerField + StatSaver.gameFieldValueSeparator + killerResult + StatSaver.gameFieldsSeparator +

                   // Pipped?
                   "p" + StatSaver.gameFieldValueSeparator + pipResult + StatSaver.gameFieldsSeparator +

                   // Game type
                   getKeyValuePair(StatSaver.gameLineGameType, this.getGameType().ToString()) +

                   // Bloodpoints
                   getKeyValuePair(StatSaver.gameLineSurvivor1BP, getBpAmount(PlayerIndex.Survivor1).ToString()) +
                   getKeyValuePair(StatSaver.gameLineSurvivor2BP, getBpAmount(PlayerIndex.Survivor2).ToString()) +
                   getKeyValuePair(StatSaver.gameLineSurvivor3BP, getBpAmount(PlayerIndex.Survivor3).ToString()) +
                   getKeyValuePair(StatSaver.gameLineSurvivor4BP, getBpAmount(PlayerIndex.Survivor4).ToString()) +
                   getKeyValuePair(StatSaver.gameLineKillerBP, getBpAmount(PlayerIndex.Killer).ToString()) +

                   //StatSaver.gameLineBloodpoints + StatSaver.gameFieldValueSeparator + getMyBpAmount() + StatSaver.gameFieldsSeparator +

                   // Match duration
                   StatSaver.gameLineMatchDuration + StatSaver.gameFieldValueSeparator + gameDuration + StatSaver.gameFieldsSeparator +

                   // Date
                   StatSaver.gameLineDate + StatSaver.gameFieldValueSeparator + Utils.getCurrentDateAsString(this.getDate()) + StatSaver.gameFieldsSeparator +

                   // Name of Killer/Survivor played this game
                   "n" + StatSaver.gameFieldValueSeparator + myCharacterName);

            string getKeyValuePair(string keyOfValue, string value)
            {
                return(keyOfValue + StatSaver.gameFieldValueSeparator + value + StatSaver.gameFieldsSeparator);
            }

            string _resultIconToString(EndgameSurvivorIcon icon)
            {
                string result = "error";

                if (icon == EndgameSurvivorIcon.Escaped)
                {
                    result = StatSaver.gameLineSurvivorResultEscaped;
                }
                else if (icon == EndgameSurvivorIcon.KilledSacrificed)
                {
                    result = StatSaver.gameLineSurvivorResultSacrificed;
                }
                else if (icon == EndgameSurvivorIcon.KilledBleedoutOrMoried)
                {
                    result = StatSaver.gameLineSurvivorResultMoried;
                }
                else if (icon == EndgameSurvivorIcon.DCed)
                {
                    result = StatSaver.gameLineSurvivorResultDCed;
                }
                else if (icon == EndgameSurvivorIcon.SurvIconStillPlaying)
                {
                    result = StatSaver.gameLineSurvivorResultStillPlaying;
                }
                else
                {
                    // in a custom game this player spot might not be filled, if not
                    // all 4 survivors are playing
                    if (this.getGameType() == Stats.GameType.CustomGame)
                    {
                        result = StatSaver.gameLineSurvivorResultNoPlayer;
                    }
                    else
                    {
                        Dbg.onDebugError("Wrong result: " + icon.ToString());
                    }
                }

                return(result);
            }
        }
コード例 #9
0
ファイル: GameResult.cs プロジェクト: Troman-cs/DBD-Monitor
        /// <summary>
        /// Index is 0-3 (not 1-4).
        /// </summary>
        public EndgameSurvivorIcon getSurvivorResultIcon(int survivorIndex)
        {
            Dbg.assertPlayerIndexIsInRangeAndNotInvalid(( PlayerIndex )survivorIndex);

            return(this.playerIconList[survivorIndex]);
        }