예제 #1
0
        public int getBpAmount(PlayerIndex playerIndex)
        {
            Dbg.assertPlayerIndexIsInRangeAndNotInvalid(playerIndex);

            return(this.playerBpAmount[(int)playerIndex]);
        }
예제 #2
0
        public bool isBpAmountSet(PlayerIndex playerIndex)
        {
            Dbg.assertPlayerIndexIsInRangeAndNotInvalid(playerIndex);

            return(this.playerBpAmount[( int )playerIndex] != EndscoreBpDigitGfx.INVALID_BP_AMOUNT);
        }
예제 #3
0
        public bool isSurvivorStillPlaying(int survivorIndex)
        {
            Dbg.assertIsValidSurvivorIndex(survivorIndex);

            return(getSurvivorResultIcon(survivorIndex) == EndgameSurvivorIcon.SurvIconStillPlaying);
        }
예제 #4
0
        /// <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
        /// <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
        /// <summary>
        /// Survivor or Killer DCed
        /// </summary>
        public bool isPlayerDCed(int survivorIndex)
        {
            Dbg.assertPlayerIndexIsInRangeAndNotInvalid((PlayerIndex)survivorIndex);

            return(getSurvivorResultIcon(survivorIndex) == EndgameSurvivorIcon.DCed);
        }
예제 #7
0
        public bool isSurvivorEscaped(int survivorIndex)
        {
            Dbg.assertIsValidSurvivorIndex(survivorIndex);

            return(getSurvivorResultIcon(survivorIndex) == EndgameSurvivorIcon.Escaped);
        }
예제 #8
0
        /// <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
        /// <summary>
        /// Index is 0-3 (not 1-4).
        /// </summary>
        public EndgameSurvivorIcon getSurvivorResultIcon(int survivorIndex)
        {
            Dbg.assertPlayerIndexIsInRangeAndNotInvalid(( PlayerIndex )survivorIndex);

            return(this.playerIconList[survivorIndex]);
        }