forked from jo3bingham/TibiaAPI
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathOffer.cs
More file actions
41 lines (31 loc) · 1.2 KB
/
Offer.cs
File metadata and controls
41 lines (31 loc) · 1.2 KB
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
36
37
38
39
40
41
using System;
using OXGaming.TibiaAPI.Constants;
namespace OXGaming.TibiaAPI.Market
{
public class Offer
{
public OfferId OfferId { get; set; }
public MarketOfferTerminationReason TerminationReason { get; set; }
public string Character { get; set; }
public uint PiecePrice { get; set; }
public uint TerminationTimestamp { get; set; }
public uint TotalPrice { get; set; }
public int Kind { get; set; }
public ushort Amount { get; set; }
public ushort TypeId { get; set; }
public Offer(OfferId offerId, int kind, ushort typeId, ushort amount, uint piecePrice, string character, MarketOfferTerminationReason terminationReason)
{
OfferId = offerId ?? throw new ArgumentNullException(nameof(offerId));
if (kind != (int)MarketOfferType.Buy && kind != (int)MarketOfferType.Sell)
{
throw new ArgumentException($"[Offer] Invalid kind: {kind}");
}
Kind = kind;
TypeId = typeId;
Amount = amount;
PiecePrice = piecePrice;
Character = character;
TerminationReason = terminationReason;
}
}
}