Exemple #1
0
        private void CreateAgent(int x, int y)
        {
            var agent = Plugin.CreateAgent(Space, x, y);

            Goals.Initialize(agent);
            Agents.Add(agent);
            AgentCreated?.Invoke(agent);
        }
Exemple #2
0
        public void AddAgent(Agent agentModel)
        {
            if (agentModel == null)
            {
                return;
            }

            if (!_allAgents.ContainsKey(agentModel.Name))
            {
                if (_allAgents.TryAdd(agentModel.Name, agentModel))
                {
                    AgentCreated.Invoke(this, new AddedAgentEventArgs(agentModel));
                }
            }
        }