Exemplo n.º 1
0
        protected void Create_Standard_Patrol(int End_A, int End_B)
        {
            List <int> Route = NetworkMethod.Dijkstrafy_Routes(map, new List <int>()
            {
                End_A, End_B
            });

            if (Route.Count > 2)
            {
                List <int> Way_Back = new List <int>();
                for (int I = Route.Count - 2; I >= 1; I--)//cuts the first and last point - these would just be repeats.
                {
                    Way_Back.Add(Route[I]);
                }
                Route.AddRange(Way_Back);
            }

            AIMoveManager.Instance.RemoveFromRR(Route);
            Default_Route_Waypoints = Create_New_Waypoint_Set(Route);

            if (Default_Route_Waypoints.Count == Route.Count)
            {
                Default_Route_Waypoint_Rooms = Route;
            }
            else
            {
                Default_Route_Waypoint_Rooms = new List <int>();
                for (int I = 0; I < Default_Route_Waypoints.Count; I++)
                {
                    Default_Route_Waypoint_Rooms.Add(RectMethod.FindWhatRoomLocationIsIn(Default_Route_Waypoints[I], map, out bool VOID));
                }
            }
            NextWaypointNum = AssignStartingWaypoint();
        }
Exemplo n.º 2
0
        protected void Create_Long_Circuit_Patrol(List <int> Visits)//doesn't have to be sorted
        {
            List <int> Route = NetworkMethod.Dijkstrafy_Routes(map, Visits);

            AIMoveManager.Instance.RemoveFromRR(Route);
            Default_Route_Waypoints = Create_New_Waypoint_Set(Route);

            if (Default_Route_Waypoints.Count == Route.Count)
            {
                Default_Route_Waypoint_Rooms = Route;
            }
            else
            {
                Default_Route_Waypoint_Rooms = new List <int>();
                for (int I = 0; I < Default_Route_Waypoints.Count; I++)
                {
                    Default_Route_Waypoint_Rooms.Add(RectMethod.FindWhatRoomLocationIsIn(Default_Route_Waypoints[I], map, out bool VOID));
                }
            }
            NextWaypointNum = AssignStartingWaypoint();
        }
Exemplo n.º 3
0
        protected virtual Rectangle ThreatLocation()
        {
            int     BiggestValue = 0;
            Vector2 BiggestKey   = Vector2.Zero;

            foreach (KeyValuePair <Vector2, int> I in Me.CurrentSuspicions)
            {
                if (I.Value > BiggestValue)
                {
                    BiggestValue = I.Value;
                    BiggestKey   = I.Key;
                }
            }
            int RoomIndex = RectMethod.FindWhatRoomLocationIsIn(BiggestKey, map, out bool IsInPassage);

            if (RoomIndex == Me.CurrentRoomIn)
            {
                return(RectMethod.AddABorder(Me.ImmediatelyAhead, 1));
            }
            else
            {
                return(CalculateCurrentRoomIn(BiggestKey));
            }
        }