public static bool TryParse(string str, out DiscreteOutcome?outcome) { outcome = null; if (str == null) { throw new ArgumentNullException(nameof(str)); } if (str.StartsWith("MSG:")) { outcome = new DiscreteOutcome(str.Substring(4)); return(true); } else if (str.StartsWith("SHA256:")) { try { outcome = new DiscreteOutcome(Encoders.Hex.DecodeData(str.Substring(7))); return(true); } catch { return(false); } } return(false); }
public DiscretePayoff(DiscreteOutcome outcome, Money reward) { if (outcome.OutcomeString is null) { throw new ArgumentException("OutcomeString is not available", nameof(outcome)); } Reward = reward; Outcome = outcome; }
public DLCExecution(Transaction cET, DiscreteOutcome outcome) { CET = cET; Outcome = outcome; }
public bool TryGetValue(DiscreteOutcome outcome, out Money payout) { return(_Rewards.TryGetValue(outcome, out payout)); }
public void Add(DiscreteOutcome outcome, Money reward) { this.Add(new DiscretePayoff(outcome, reward)); }
public DiscretePayoff(DiscreteOutcome outcome, Money reward) { Reward = reward; Outcome = outcome; }