Beispiel #1
0
        /// <summary>
        /// Method to shuffle order of Agents in list
        /// </summary>
        /// <param name="lst"> List of Agents to be shuffled. </param>
        /// <returns> Shuffled list. </returns>
        public List <Agents> ShuffleAgentsList(List <Agents> lst)
        {
            Random r = new Random();

            for (int size = lst.Count; size > 1; size--)
            {
                int randN = r.Next(0, size);

                Agents val = lst[randN];
                lst[randN]    = lst[size - 1];
                lst[size - 1] = val;
            }
            return(lst);
        }
Beispiel #2
0
 /// <summary>
 /// Show if Agent is AI controlled.
 /// </summary>
 /// <param name="agent"> Agent to be checked. </param>
 public static void IsAi(Agents agent)
 {
     WriteLine($"Is Agent Ai? --> {agent.Ai}");
 }