2022-01-16 22:29:50 +01:00
using Newtonsoft.Json ;
using System.Diagnostics ;
namespace MinecraftDiscordBot.Models ;
[JsonObject(MemberSerialization.OptIn, Description = "Describes a fluid in a Refined Storage system.", MissingMemberHandling = MissingMemberHandling.Ignore)]
[DebuggerDisplay($"{{{nameof(ToString)}(),nq}}")]
public class Fluid {
[JsonProperty("amount", Required = Required.Always)]
public int Amount { get ; set ; }
[JsonProperty("displayName", Required = Required.Always)]
public string DisplayName { get ; set ; } = default ! ;
[JsonProperty("tags", Required = Required.DisallowNull)]
public string [ ] ? Tags { get ; set ; } = default ;
[JsonProperty("name", Required = Required.Always)]
public ModItemId ItemId { get ; set ; } = default ! ;
public override string ToString ( ) = > Amount > 10000
? $"{Amount / 1000.0f:n2} B of {DisplayName}"
: $"{Amount:n0} mB of {DisplayName}" ;
[JsonIgnore]
public string CleanDisplayName = > DisplayName [ 1. . ^ 1 ] ;
2022-01-18 11:46:23 +01:00
[JsonIgnore]
public string? TagString = > Tags is string [ ] tags ? string . Join ( ", " , tags ) : null ;
2022-01-16 22:29:50 +01:00
}