Skip to content

Commit

Permalink
MedalId moved into ArenaSheet
Browse files Browse the repository at this point in the history
  • Loading branch information
U-lis committed Oct 22, 2024
1 parent d48c103 commit fb04ae9
Showing 1 changed file with 3 additions and 27 deletions.
30 changes: 3 additions & 27 deletions NineChronicles.DataProvider/DataRendering/BattleArenaData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,11 @@ namespace NineChronicles.DataProvider.DataRendering
using Libplanet.Action.State;
using Libplanet.Crypto;
using Libplanet.Types.Assets;
using Nekoyume.Arena;
using Nekoyume.Extensions;
using Nekoyume.Model.Arena;
using Nekoyume.Model.EnumType;
using Nekoyume.Model.State;
using Nekoyume.Module;
using Nekoyume.TableData;
using Nekoyume.TableData.Rune;
using NineChronicles.DataProvider.Store.Models;

public static class BattleArenaData
Expand Down Expand Up @@ -43,21 +40,6 @@ DateTimeOffset blockTime
signer,
ncgCurrency);
var burntNCG = prevNCGBalance - outputNCGBalance;
int ticketCount = ticket;
var sheets = previousStates.GetSheets(
sheetTypes: new[]
{
typeof(ArenaSheet),
typeof(ItemRequirementSheet),
typeof(EquipmentItemRecipeSheet),
typeof(EquipmentItemSubRecipeSheetV2),
typeof(EquipmentItemOptionSheet),
typeof(MaterialItemSheet),
typeof(CharacterSheet),
typeof(CostumeStatSheet),
typeof(RuneListSheet),
typeof(RuneOptionSheet),
});
var arenaSheet = outputStates.GetSheet<ArenaSheet>();
var arenaData = arenaSheet.GetRoundByBlockIndex(blockIndex);
var arenaInformationAdr =
Expand All @@ -66,15 +48,9 @@ DateTimeOffset blockTime
outputStates.TryGetArenaInformation(arenaInformationAdr, out var currentArenaInformation);
var winCount = currentArenaInformation.Win - previousArenaInformation.Win;
var medalCount = 0;
if (arenaData.ArenaType != ArenaType.OffSeason &&
winCount > 0)
if (arenaData.ArenaType != ArenaType.OffSeason && winCount > 0)
{
var materialSheet = sheets.GetSheet<MaterialItemSheet>();
var medal = ArenaHelper.GetMedal(championshipId, round, materialSheet);
if (medal != null)
{
medalCount += winCount;
}
medalCount += winCount;
}

var battleArenaModel = new BattleArenaModel()
Expand All @@ -87,7 +63,7 @@ DateTimeOffset blockTime
EnemyAvatarAddress = enemyAvatarAddress.ToString(),
ChampionshipId = championshipId,
Round = round,
TicketCount = ticketCount,
TicketCount = ticket,
BurntNCG = Convert.ToDecimal(burntNCG.GetQuantityString()),
Victory = currentArenaScore.Score > previousArenaScore.Score,
MedalCount = medalCount,
Expand Down

0 comments on commit fb04ae9

Please sign in to comment.