Ejemplo n.º 1
0
        /// <summary>
        /// 往平台组件中注册可视关系
        /// </summary>
        /// <param name="manager"></param>
        public void RegistVision(SmartTank.Senses.Vision.VisionMgr manager)
        {
            foreach (MulPair pair in visionGroups)
            {
                try
                {
                    //TypeGroup group1 = FindGroup( pair.groupPath ) as TypeGroup;
                    //TypeGroup group2 = FindGroup( pair.groupPath2 ) as TypeGroup;
                    //manager.AddVisionGroup(
                    //    group1.GetEnumerableCopy<IRaderOwner>(),
                    //    group2.GetEnumerableCopy<IEyeableObj>() );
                    List <IEnumerable <IEyeableObj> > EyeableGroups = new List <IEnumerable <IEyeableObj> >();

                    foreach (string eyeGroupPath in pair.groupPaths)
                    {
                        TypeGroup shelGroup = FindGroup(eyeGroupPath) as TypeGroup;
                        EyeableGroups.Add(shelGroup.GetEnumerableCopy <IEyeableObj>());
                    }

                    TypeGroup group = FindGroup(pair.groupPath) as TypeGroup;

                    manager.AddVisionGroup(
                        group.GetEnumerableCopy <IRaderOwner>(),
                        EyeableGroups.ToArray());
                }
                catch (Exception ex)
                {
                    Log.Write("RegistVisionGroup error: " + pair.groupPath + ", " +
                              pair.groupPath.ToString() + ", " + ex.Message);
                }
            }
        }
Ejemplo n.º 2
0
 public void RegistVision ( VisionMgr manager )
 {
     manager.AddVisionGroup( tankRaderOwners, visibleObjs );
 }
Ejemplo n.º 3
0
        protected override void Initialize ()
        {
            base.Initialize();

            phiColManager = new PhiColMgr();
            shelterMgr = new ShelterMgr();
            drawManager = new DrawMgr();
            updateMgr = new UpdateMgr();
            visionMgr = new VisionMgr();
            objMemoryMananger = new ObjMemoryMgr();

            Sound.Initial();

            // 在此处将主界面压入堆栈。


            // test

            gameScreens.Push( new RuleSelectScreen() );

            //

        }