/// <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()); }
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); }