예제 #1
0
        public override bool InitLayer(LayerInitData layerInitData, RegisterAgent registerAgentHandle, UnregisterAgent unregisterAgentHandle)
        {
            var initiated = base.InitLayer(layerInitData, registerAgentHandle, unregisterAgentHandle);

            DeerEnvironment = new SpatialHashEnvironment <Deer>(Width - 1, Height - 1)
            {
                CheckBoundaries = true
            };
            WolfEnvironment = new SpatialHashEnvironment <Wolf>(Width - 1, Height - 1)
            {
                CheckBoundaries = true
            };


            AgentManager = layerInitData.Container.Resolve <IAgentManager>();
            AgentManager.Spawn <Deer, ForestLayer>().ToList();


            return(initiated);
        }