public override WeeklyArenaState Modify(WeeklyArenaState state) { if (state is null) { throw new ArgumentNullException(nameof(state)); } foreach (var addressHex in avatarAddressHexList) { var address = new Address(addressHex); if (state.TryGetValue(address, out var arenaInfo)) { arenaInfo.Activate(); } else { var sb = new StringBuilder($"[{nameof(WeeklyArenaInfoActivator)}]"); sb.Append($"{nameof(Modify)} Not found `{nameof(ArenaInfo)}` exception."); sb.Append($"{nameof(addressHex)}: {addressHex}"); Debug.LogWarning(sb.ToString()); } } return(state); }
public static bool TryGetThisWeekStateAndArenaInfo(long blockIndex, Address avatarAddress, out WeeklyArenaState weeklyArenaState, out ArenaInfo arenaInfo) { arenaInfo = null; return(TryGetThisWeekState(blockIndex, out weeklyArenaState) && weeklyArenaState.TryGetValue(avatarAddress, out arenaInfo)); }