private static RiotJsTransformer.JavascriptyPlayer TransformParticipant(IParticipant participant, int teamId, long dudeAccountId) { GameParticipant gameParticipant = participant as GameParticipant; if (gameParticipant == null) { return new RiotJsTransformer.JavascriptyPlayer() { PickState = "completed" }; } double accountId = -1; double summonerId = -1; PlayerParticipant playerParticipant = gameParticipant as PlayerParticipant; if (playerParticipant != null) { accountId = playerParticipant.AccountId; summonerId = playerParticipant.SummonerId; } RiotJsTransformer.JsRerollState jsRerollState = null; AramPlayerParticipant aramPlayerParticipant = gameParticipant as AramPlayerParticipant; if (aramPlayerParticipant != null && aramPlayerParticipant.PointSummary != null) { PointSummary pointSummary = aramPlayerParticipant.PointSummary; RiotJsTransformer.JsRerollState jsRerollState1 = new RiotJsTransformer.JsRerollState() { Points = (int)pointSummary.CurrentPoints, MaximumPoints = pointSummary.MaxRolls * (int)pointSummary.PointsCostToRoll, RerollCost = (int)pointSummary.PointsCostToRoll }; jsRerollState = jsRerollState1; } RiotJsTransformer.JavascriptyPlayer javascriptyPlayer = new RiotJsTransformer.JavascriptyPlayer() { Name = gameParticipant.SummonerName, InternalName = gameParticipant.SummonerInternalName, SummonerId = summonerId, AccountId = accountId, TeamId = teamId, RerollState = jsRerollState, SpellIds = new int[0], PickState = RiotJsTransformer.TransformPickState(gameParticipant.PickMode), IsDude = accountId == (double)dudeAccountId }; return javascriptyPlayer; }
private static RiotJsTransformer.JavascriptyPlayer TransformParticipant(IParticipant participant, int teamId, long dudeAccountId) { GameParticipant gameParticipant = participant as GameParticipant; if (gameParticipant != null) { double num1 = -1.0; double num2 = -1.0; PlayerParticipant playerParticipant1 = gameParticipant as PlayerParticipant; if (playerParticipant1 != null) { num1 = playerParticipant1.AccountId; num2 = playerParticipant1.SummonerId; } RiotJsTransformer.JsRerollState jsRerollState = (RiotJsTransformer.JsRerollState) null; AramPlayerParticipant playerParticipant2 = gameParticipant as AramPlayerParticipant; if (playerParticipant2 != null && playerParticipant2.PointSummary != null) { PointSummary pointSummary = playerParticipant2.PointSummary; jsRerollState = new RiotJsTransformer.JsRerollState() { Points = (int) pointSummary.CurrentPoints, MaximumPoints = pointSummary.MaxRolls * (int) pointSummary.PointsCostToRoll, RerollCost = (int) pointSummary.PointsCostToRoll }; } return new RiotJsTransformer.JavascriptyPlayer() { Name = gameParticipant.SummonerName, InternalName = gameParticipant.SummonerInternalName, SummonerId = num2, AccountId = num1, TeamId = teamId, RerollState = jsRerollState, SpellIds = new int[0], PickState = RiotJsTransformer.TransformPickState(gameParticipant.PickMode), IsDude = num1 == (double) dudeAccountId }; } else return new RiotJsTransformer.JavascriptyPlayer() { PickState = "completed" }; }