예제 #1
0
        public BoardResult CurrentResult(Participant currentContender, bool allowReplay)
        {
            if (currentContender == null)
            {
                throw new ArgumentNullException("currentContender");
            }
            if (this.currentResult == null || (this.currentResult.Play != null && this.currentResult.Play.PlayEnded))
            {
                foreach (var result in this.results)
                {
                    if (currentContender.IsSame(result.Participants.Names))
                    {
                        if (!allowReplay)
                        {
                            throw new InvalidOperationException("Replay not allowed");
                        }

                        break;
                    }
                }

                //if (this.currentResult == null)
                {
                    this.currentResult = new BoardResult("Board", this, currentContender);
                    this.results.Add(this.currentResult);
                }
            }

            return(this.currentResult);
        }
예제 #2
0
 internal void BoardChanged(BoardResult p)
 {
     this.parent = p;
     if (this.contract != null)
     {
         this.contract.Vulnerability = p.Board.Vulnerable;
     }
 }
예제 #3
0
        public BoardResult CurrentResult(bool detached = false)
        {
            if (this.currentResult == null)
            {
                this.currentResult       = new BoardResult("Board", this, new SeatCollection <string>());
                this.currentResult.Board = this;
                this.results.Add(this.currentResult);
            }

            return(this.currentResult);
        }
예제 #4
0
 public abstract Task SaveAsync(BoardResult result);
예제 #5
0
 public override async Task SaveAsync(BoardResult result)
 {
 }
예제 #6
0
 public void ClearCurrentResult()
 {
     this.currentResult = null;
 }
예제 #7
0
 public Auction(BoardResult p)
     : this()
 {
     this.parent = p;
 }