public IRoad NextBranch(GameFlags flags) { var choise = Branch.Keys .FirstOrDefault(a => a.ImplementTo(flags)); return(choise != null ? Branch[choise] : Branch.Last().Value); }
/// <summary> /// Are this object implement to other? /// Checking flags and last user`s choise /// </summary> /// <param name="other">Checked GameFlags</param> /// <returns>True if this implement to other</returns> public bool ImplementTo(GameFlags other) { return DialogChoice == other.DialogChoice && Flags.All(a => other.Flags.Contains(a)); }
/// <summary> /// Are this object implement to other? /// Checking flags and last user`s choise /// </summary> /// <param name="other">Checked GameFlags</param> /// <returns>True if this implement to other</returns> public bool ImplementTo(GameFlags other) { return(DialogChoice == other.DialogChoice && Flags.All(a => other.Flags.Contains(a))); }
public IRoad NextBranch(GameFlags flags) { var choise = Branch.Keys .FirstOrDefault(a => a.ImplementTo(flags)); return choise != null ? Branch[choise] : Branch.Last().Value; }