コード例 #1
0
ファイル: Mastermind.cs プロジェクト: Tointer/CBomberman
        private AgentAction ShakeOut(Map map)
        {
            var adjacent = map.GetAdjacentWalkableTiles(playerTile);

            if (adjacent.Count == 0)
            {
                return(AgentAction.BombDown);
            }
            Random random        = new Random();
            var    randomAdjTile = adjacent.OrderBy(x => random.Next()).First();

            return(GameLib.DirectionTo(playerTile, randomAdjTile));
        }