namespace bts.md { using bts.api.core; using mbts; using mbts.co2; using mbts.spark; using System; using System.Collections.Generic; using System.Linq; using System.Reactive.Linq; public readonly struct Book : IEquatable { public Book(uint security_id, List bids, List asks) { this.security_id = security_id; this.bids = bids; this.asks = asks; } public uint security_id { get; } public List bids { get; } public List asks { get; } public static Book empty(uint security_id) => new(security_id, new(0), new(0)); public bool Equals(Book other) => security_id == other.security_id && bids.SequenceEqual(other.bids) && asks.SequenceEqual(other.asks); public override bool Equals(object obj) => obj is Book other && Equals(other); public override int GetHashCode() => security_id.GetHashCode(); public static bool operator ==(Book left, Book right) => left.Equals(right); public static bool operator !=(Book left, Book right) => !(left == right); } }