示例#1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="player"></param>
        /// <returns></returns>
        private int GetSolutionCardinal(FreeSOMazePlayer player)
        {
            var solution = player.PeekSolution();

            if (solution != null)
            {
                return((int)player.GetTargetCardinal(player.Location, solution));
            }
            // if there are no nodes left in Solution and this player has no bread crumbs, then they're next to the partner's very first breadcrumb.
            else
            {
                FreeSOMazePlayer partner = (player.Equals(LogicPlayer) ? CharismaPlayer : LogicPlayer);
                solution = partner?.FirstCrumb;
                if (solution != null)
                {
                    return((int)partner.GetTargetCardinal(player.Location, solution));
                }
            }
            return((int)FreeSOMazeCardinals.Invalid); // 10 is no hint, but if this is reached then something went very wrong
        }