-
Notifications
You must be signed in to change notification settings - Fork 48
/
RedeemCodeListSheet.cs
35 lines (32 loc) · 1.03 KB
/
RedeemCodeListSheet.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
using System;
using System.Collections.Generic;
using Bencodex.Types;
using Libplanet.Common;
using Libplanet.Crypto;
using Nekoyume.Model.State;
using static Nekoyume.TableData.TableExtensions;
namespace Nekoyume.TableData
{
[Serializable]
public class RedeemCodeListSheet : Sheet<int, RedeemCodeListSheet.Row>
{
[Serializable]
public class Row : SheetRow<int>
{
public override int Key => Id;
public int Id { get; private set; }
public int RewardId { get; private set; }
public PublicKey PublicKey => PublicKeyBinary.ToPublicKey();
public Binary PublicKeyBinary { get; private set; }
public override void Set(IReadOnlyList<string> fields)
{
Id = ParseInt(fields[0]);
RewardId = ParseInt(fields[1]);
PublicKeyBinary = new Binary(ByteUtil.ParseHex(fields[2]));
}
}
public RedeemCodeListSheet() : base(nameof(RedeemCodeListSheet))
{
}
}
}