Пример #1
0
        public void SetUp()
        {
            _context = new ServiceContext();

            /*_prototype = ScriptableObject.CreateInstance<AgentPrototype>();
             * _prototype.Id = "t1p";
             * _prototype.Key = "T1P";
             * _prototype.Sprite = null;
             * _prototype.Actions = new List<PrototypeActionEntry>();
             */
            _sensorFactory  = new AgentSensorFactory().BindServiceContext(_context);
            _agentContainer = new AgentContainer().BindServiceContext(_context);
        }
        override protected void Action()
        {
            AgentContainer container = MainAgentContainer.Find().GetContainer(containerId);

            if (name == null)
            {
                container.RegisterAgent(Agent);
            }
            else
            {
                container.RegisterAgent(Agent, name);
            }
        }
Пример #3
0
        public void SetUp()
        {
            _context      = new ServiceContext();
            _subContainer = Substitute.For <AgentContainer>().BindServiceContext(_context);


            _agent  = new Agent();
            _agent2 = new Agent();

            BindActionHelper(_agent, new AgentActionFake("act", "Act"));
            BindActionHelper(_agent, new AgentSelfActionFake("self", "SelfAct"));
            BindActionHelper(_agent2, new AgentActionFake("act", "Act"));
            BindActionHelper(_agent2, new AgentSelfActionFake("self", "SelfAct"));

            _agent.Sensor  = new AgentSensor(_context, _agent);
            _agent2.Sensor = new AgentSensor(_context, _agent2);
        }