public AgentItem AddCustomAgent(long start, long end, AgentItem.AgentType type, string name, string prof, ushort ID)
        {
            Random rnd        = new Random();
            ulong  agentValue = 0;

            while (AgentValues.Contains(agentValue) || agentValue == 0)
            {
                agentValue = (ulong)rnd.Next(Int32.MaxValue / 2, Int32.MaxValue);
            }
            ushort instID = 0;

            while (InstIDValues.Contains(instID) || instID == 0)
            {
                instID = (ushort)rnd.Next(ushort.MaxValue / 2, ushort.MaxValue);
            }
            AgentItem agent = new AgentItem(agentValue, name, prof, ID, type, 0, 0, 0, 0, 20, 20)
            {
                InstID      = instID,
                LastAware   = end,
                FirstAware  = start,
                MasterAgent = 0
            };

            _allAgentsList.Add(agent);
            Refresh();
            return(agent);
        }
Example #2
0
        public AgentItem AddCustomAgent(long start, long end, AgentItem.AgentType type, string name, string prof, ushort ID, uint toughness = 0, uint healing = 0, uint condition = 0, uint concentration = 0, uint hitboxWidth = 0, uint hitboxHeight = 0)
        {
            Random rnd        = new Random();
            ulong  agentValue = 0;

            while (AgentValues.Contains(agentValue) || agentValue == 0)
            {
                agentValue = (ulong)rnd.Next(Int32.MaxValue / 2, Int32.MaxValue);
            }
            ushort instID = 0;

            while (InstIDValues.Contains(instID) || instID == 0)
            {
                instID = (ushort)rnd.Next(ushort.MaxValue / 2, ushort.MaxValue);
            }
            AgentItem agent = new AgentItem(agentValue, name, prof, ID, type, toughness, healing, condition, concentration, hitboxWidth, hitboxHeight)
            {
                InstID            = instID,
                LastAwareLogTime  = end,
                FirstAwareLogTime = start,
                MasterAgent       = null
            };

            _allAgentsList.Add(agent);
            Refresh();
            return(agent);
        }
Example #3
0
 public IReadOnlyList <AgentItem> GetAgentByType(AgentItem.AgentType type)
 {
     if (_allAgentsByType.TryGetValue(type, out List <AgentItem> list))
     {
         return(list);
     }
     else
     {
         return(new List <AgentItem>());
     }
 }
Example #4
0
        internal AgentItem AddCustomAgent(long start, long end, AgentItem.AgentType type, string name, string prof, int ID, bool isDummy, ushort toughness = 0, ushort healing = 0, ushort condition = 0, ushort concentration = 0, uint hitboxWidth = 0, uint hitboxHeight = 0)
        {
            var   rnd        = new Random();
            ulong agentValue = 0;

            while (AgentValues.Contains(agentValue) || agentValue == 0)
            {
                agentValue = (ulong)rnd.Next(int.MaxValue / 2, int.MaxValue);
            }
            ushort instID = 0;

            while (InstIDValues.Contains(instID) || instID == 0)
            {
                instID = (ushort)rnd.Next(ushort.MaxValue / 2, ushort.MaxValue);
            }
            var agent = new AgentItem(agentValue, name, prof, ID, instID, type, toughness, healing, condition, concentration, hitboxWidth, hitboxHeight, start, end, isDummy);

            _allAgentsList.Add(agent);
            Refresh();
            return(agent);
        }