MingStar.SimUniversity.Game.Game.GenerateAllMoves C# (CSharp) Method

GenerateAllMoves() public method

public GenerateAllMoves ( ) : ReadOnlyCollection
return ReadOnlyCollection
        public ReadOnlyCollection<IPlayerMoveForUpdate> GenerateAllMoves()
        {
            if (_allAvailableMoves == null)
            {
                _allAvailableMoves =
                    CurrentPhase == GamePhase.Play
                        ? PlayPhraseMoveGenerator.GenerateAllMoves(this).AsReadOnly()
                        : _setupMoveGenerator.GenerateAllMoves(this).AsReadOnly();
            }
            return _allAvailableMoves;
        }

Usage Example

Example #1
0
 internal static TurnInfo Create(Game game, IPlayerMoveForUpdate move)
 {
     return new TurnInfo
                {
                    Move = move,
                    AllMoves = game.GenerateAllMoves(),
                    MostFailedStartUps = game.MostFailedStartUps,
                    MostInternetLinks = game.LongestInternetLink,
                    Hash = game.Hash,
                    CurrentUnversityLongestLink = game.CurrentUniversity.LengthOfLongestLink,
                };
 }