public Guess(IGuessInfo guessInfo, IChainDTO chain) { this.Contributor = guessInfo.Contributor; this.Content = guessInfo.Content; this.Type = guessInfo.Type; this.Chain = chain; }
public void AddGuess(IGuessInfo guessInfo) { if (HasPlayerContributedGuess(guessInfo.Contributor)) { string message = String.Format( "{0} has already contributed a guess to the chain", Maybe.From(guessInfo.Contributor). Select(c => c.Name).Value); throw new ChainLockedException(message); } if (guessInfo.Contributor.Id != this.LockedBy.Id) { throw new ChainLockedException(GetLockedMessage()); } this.Guesses.Add(this.GuessFactory.MakeGuess(guessInfo)); if (Guesses.Count == MaximumLength) { this.OnMaximumChainLengthReached(); } }
public void AddGuess(IGuessInfo guess) { PlayerPendingActions[guess.Contributor].Execute(guess); }
public void Execute(IGuessInfo guess) { this.InPlayChain.AddGuess(guess); this.Release(guess.Contributor); }
public InPlayChain(IGuessInfo guessInfo) { this.GuessFactory = new GuessFactory(this); this.Guesses = new List<IGuessDTO> { this.GuessFactory.MakeGuess(guessInfo) }; }
public void CreateNew(IGuessInfo guess) { var chain = new InPlayChain(guess); chain.MaximumChainLengthReached += chain_MaximumChainLengthReached; this.Chains.Add(chain); }
public IGuessDTO MakeGuess(IGuessInfo guessInfo) { return new Guess(guessInfo, this.chain); }
public void Execute(IGuessInfo guess) { this.ChainList.CreateNew(guess); this.Release(guess.Contributor); }