예제 #1
0
        /// <summary>
        /// Получение точек патруля, которые можно обходить.
        /// </summary>
        /// <returns> Набор узлов карты. </returns>
        private HexNode[] CalcActualRoutePoints()
        {
            var hexNodes          = _patrolRoute.Points.Cast <HexNode>();
            var actorHexNode      = (HexNode)Actor.Node;
            var actualRoutePoints = from node in hexNodes
                                    where !HexNodeHelper.EqualCoordinates(node, actorHexNode)
                                    select node;

            return(actualRoutePoints.ToArray());
        }
예제 #2
0
        private int?CalcCurrentPatrolPointIndex()
        {
            int?currentIndex = null;

            for (var i = 0; i < _patrolRoute.Points.Count(); i++)
            {
                var routeNode = (HexNode)_patrolRoute.Points[i];
                var actorNode = (HexNode)_actor.Node;
                if (HexNodeHelper.EqualCoordinates(routeNode, actorNode))
                {
                    currentIndex = i;
                    break;
                }
            }

            return(currentIndex);
        }