示例#1
0
        //---------------------------------------------------------------------
        void _initBaseFishLordMgr(List <JsonPacket> json_packet_list, List <RouteJsonPacket> route_json_packet_list)
        {
            ParticleSystemFactory fish_lord_factory = new ParticleSystemFactory();

            // 发射器工厂
            fish_lord_factory.regGeneratorFactory(new DivergencePointGeneratorFactory());
            fish_lord_factory.regGeneratorFactory(new LineGeneratorFactory());
            fish_lord_factory.regGeneratorFactory(new CircleGeneratorFactory());
            fish_lord_factory.regGeneratorFactory(new IntervalDivergenceGeneratorFactory());
            fish_lord_factory.regGeneratorFactory(new RoundCircleGeneratorFactory());
            fish_lord_factory.regGeneratorFactory(new NormalGeneratorFactory());
            fish_lord_factory.regGeneratorFactory(new RedFishGeneratorFactory());
            fish_lord_factory.regGeneratorFactory(new FixGeneratorFactory());

            // 影响器工厂
            fish_lord_factory.regAffectorFactory(new StopAffectorFactory());
            fish_lord_factory.regAffectorFactory(new StartMoveAffectorFactory());
            fish_lord_factory.regAffectorFactory(new AngleSpeedAffectorFactory());

            mBaseFishLordMgr = new BaseFishLordMgr(new LogicFishFactory(mScene), fish_lord_factory);
            mBaseFishLordMgr.create(json_packet_list, route_json_packet_list);

            mLogicParticleSystemOuter = new LogicParticleSystemOuter();
            mLogicParticleSystemOuter.create(mScene, mBaseFishLordMgr);
        }
示例#2
0
        //---------------------------------------------------------------------
        public EntityParticleSystem create(BaseFishLordMgr fish_lord_mgr, BaseEntityFactory factory,
            EntityParticleSystemData fish_lord_data, int fish_begin_id, List<string> server_param, RouteObjectMgr route_object_mgr)
        {
            mFishLordMgr = fish_lord_mgr;
            mBaseEntityFactory = factory;
            mSurvivalTime = fish_lord_data.mFishLordCommonData.mDestroyTime;

            mParticleSystemEntityKeeper = new ParticleSystemEntityKeeper();
            mGeneratorAndAffectorKeeper = new GeneratorAndAffectorKeeper(fish_lord_mgr, this, factory, fish_lord_data, fish_begin_id, server_param, route_object_mgr);

            return this;
        }
示例#3
0
        //---------------------------------------------------------------------
        public EntityParticleSystem create(BaseFishLordMgr fish_lord_mgr, BaseEntityFactory factory,
                                           EntityParticleSystemData fish_lord_data, int fish_begin_id, List <string> server_param, RouteObjectMgr route_object_mgr)
        {
            mFishLordMgr       = fish_lord_mgr;
            mBaseEntityFactory = factory;
            mSurvivalTime      = fish_lord_data.mFishLordCommonData.mDestroyTime;

            mParticleSystemEntityKeeper = new ParticleSystemEntityKeeper();
            mGeneratorAndAffectorKeeper = new GeneratorAndAffectorKeeper(fish_lord_mgr, this, factory, fish_lord_data, fish_begin_id, server_param, route_object_mgr);

            return(this);
        }
        //---------------------------------------------------------------------
        public GeneratorAndAffectorKeeper(
            BaseFishLordMgr fish_lord_mgr, EntityParticleSystem fish_lord, BaseEntityFactory factory,
            EntityParticleSystemData fish_lord_data, int fish_begin_id, List <string> server_param, RouteObjectMgr route_object_mgr)
        {
            mFishLordMgr = fish_lord_mgr;

            int fish_id = fish_begin_id;

            int generator_id = 0;

            foreach (var it in fish_lord_data.mListBaseGenerator)
            {
                EntityGenerator generator = mFishLordMgr.buildGenerator(it, server_param, route_object_mgr);
                generator.setBaseFishLord(fish_lord);
                generator.setBaseGeneratorId(generator_id);

                generator.setBeginFishId(fish_id);
                fish_id += it.getBaseEntityCount();

                if (generator == null)
                {
                    continue;
                }
                mListBaseGenerator.Add(generator);

                generator_id++;
            }

            foreach (var it in fish_lord_data.mListBaseAffector)
            {
                EntityAffector affector = mFishLordMgr.buildAffector(it);
                if (affector == null)
                {
                    continue;
                }
                affector.setBaseFishLord(fish_lord);
                mListBaseAffector.Add(affector);
            }

            foreach (var it in fish_lord_data.mGeneratorAffectorMap)
            {
                if (mListBaseAffector.Count > it.mAffectorIndex && mListBaseGenerator.Count > it.mGeneratorIndex)
                {
                    mListBaseAffector[it.mAffectorIndex].setGeneratorId(it.mGeneratorIndex);
                }
            }

            foreach (var it in mListBaseGenerator)
            {
                it.create();
            }
        }
示例#5
0
        //---------------------------------------------------------------------
        public void destroy()
        {
            destroyFsm();

            if (mLogicParticleSystemOuter != null)
            {
                mLogicParticleSystemOuter.destroy();
                mLogicParticleSystemOuter = null;
            }

            if (mBaseFishLordMgr != null)
            {
                mBaseFishLordMgr.destroy();
                mBaseFishLordMgr = null;
            }
        }
        //---------------------------------------------------------------------
        public GeneratorAndAffectorKeeper(
            BaseFishLordMgr fish_lord_mgr, EntityParticleSystem fish_lord, BaseEntityFactory factory,
            EntityParticleSystemData fish_lord_data, int fish_begin_id, List<string> server_param, RouteObjectMgr route_object_mgr)
        {
            mFishLordMgr = fish_lord_mgr;

            int fish_id = fish_begin_id;

            int generator_id = 0;
            foreach (var it in fish_lord_data.mListBaseGenerator)
            {
                EntityGenerator generator = mFishLordMgr.buildGenerator(it, server_param, route_object_mgr);
                generator.setBaseFishLord(fish_lord);
                generator.setBaseGeneratorId(generator_id);

                generator.setBeginFishId(fish_id);
                fish_id += it.getBaseEntityCount();

                if (generator == null) continue;
                mListBaseGenerator.Add(generator);

                generator_id++;
            }

            foreach (var it in fish_lord_data.mListBaseAffector)
            {
                EntityAffector affector = mFishLordMgr.buildAffector(it);
                if (affector == null) continue;
                affector.setBaseFishLord(fish_lord);
                mListBaseAffector.Add(affector);
            }

            foreach (var it in fish_lord_data.mGeneratorAffectorMap)
            {
                if (mListBaseAffector.Count > it.mAffectorIndex && mListBaseGenerator.Count > it.mGeneratorIndex)
                {
                    mListBaseAffector[it.mAffectorIndex].setGeneratorId(it.mGeneratorIndex);
                }
            }

            foreach (var it in mListBaseGenerator)
            {
                it.create();
            }
        }
示例#7
0
        //---------------------------------------------------------------------
        void _initBaseFishLordMgr(List <JsonPacket> json_packet_list, List <RouteJsonPacket> route_json_packet_list)
        {
            ParticleSystemFactory entity_particle_system_factory = new ParticleSystemFactory();

            // 发射器工厂
            entity_particle_system_factory.regGeneratorFactory(new DivergencePointGeneratorFactory());
            entity_particle_system_factory.regGeneratorFactory(new LineGeneratorFactory());
            entity_particle_system_factory.regGeneratorFactory(new CircleGeneratorFactory());
            entity_particle_system_factory.regGeneratorFactory(new IntervalDivergenceGeneratorFactory());
            entity_particle_system_factory.regGeneratorFactory(new RoundCircleGeneratorFactory());
            entity_particle_system_factory.regGeneratorFactory(new NormalGeneratorFactory());
            entity_particle_system_factory.regGeneratorFactory(new RedFishGeneratorFactory());
            entity_particle_system_factory.regGeneratorFactory(new FixGeneratorFactory());

            // 影响器工厂
            entity_particle_system_factory.regAffectorFactory(new StopAffectorFactory());
            entity_particle_system_factory.regAffectorFactory(new StartMoveAffectorFactory());
            entity_particle_system_factory.regAffectorFactory(new AngleSpeedAffectorFactory());

            mBaseFishLordMgr = new BaseFishLordMgr(new CRenderFishFactory(mScene), entity_particle_system_factory);
            mBaseFishLordMgr.create(json_packet_list, route_json_packet_list);
        }
        //---------------------------------------------------------------------
        public void create(CLogicScene scene, BaseFishLordMgr base_fish_lord_mgr)
        {
            mScene = scene;
            mBaseFishLordMgr = base_fish_lord_mgr;

            mFishGroupRouteAlloter = new FishGroupRouteAlloter();
            mFishRouteMap = new FishRouteMap();
            Dictionary<int, EbData> mapData = EbDataMgr.Instance.getMapData<TbDataRoute>();
            foreach (var it in mapData)
            {
                if (TbDataRoute.DataState.ACTIVE == ((TbDataRoute)it.Value).State)
                {
                    mListRoute.Add(it.Key);
                }
            }

            mFormationNameList = mBaseFishLordMgr.getPrototypeNameList();
            mFormationNameList.Remove(mNormalFishParticleFileName);
            mFormationNameList.Remove(mRedFishParticleFileName);

            mOutFishState = OutFishState.Normal;
        }
示例#9
0
        //---------------------------------------------------------------------
        public void create(CLogicScene scene, BaseFishLordMgr base_fish_lord_mgr)
        {
            mScene           = scene;
            mBaseFishLordMgr = base_fish_lord_mgr;

            mFishGroupRouteAlloter = new FishGroupRouteAlloter();
            mFishRouteMap          = new FishRouteMap();
            Dictionary <int, EbData> mapData = EbDataMgr.Instance.getMapData <TbDataRoute>();

            foreach (var it in mapData)
            {
                if (TbDataRoute.DataState.ACTIVE == ((TbDataRoute)it.Value).State)
                {
                    mListRoute.Add(it.Key);
                }
            }

            mFormationNameList = mBaseFishLordMgr.getPrototypeNameList();
            mFormationNameList.Remove(mNormalFishParticleFileName);
            mFormationNameList.Remove(mRedFishParticleFileName);

            mOutFishState = OutFishState.Normal;
        }
示例#10
0
        //---------------------------------------------------------------------
        void _initBaseFishLordMgr(List<JsonPacket> json_packet_list, List<RouteJsonPacket> route_json_packet_list)
        {
            ParticleSystemFactory entity_particle_system_factory = new ParticleSystemFactory();

            // ����������
            entity_particle_system_factory.regGeneratorFactory(new DivergencePointGeneratorFactory());
            entity_particle_system_factory.regGeneratorFactory(new LineGeneratorFactory());
            entity_particle_system_factory.regGeneratorFactory(new CircleGeneratorFactory());
            entity_particle_system_factory.regGeneratorFactory(new IntervalDivergenceGeneratorFactory());
            entity_particle_system_factory.regGeneratorFactory(new RoundCircleGeneratorFactory());
            entity_particle_system_factory.regGeneratorFactory(new NormalGeneratorFactory());
            entity_particle_system_factory.regGeneratorFactory(new RedFishGeneratorFactory());
            entity_particle_system_factory.regGeneratorFactory(new FixGeneratorFactory());

            // Ӱ��������
            entity_particle_system_factory.regAffectorFactory(new StopAffectorFactory());
            entity_particle_system_factory.regAffectorFactory(new StartMoveAffectorFactory());
            entity_particle_system_factory.regAffectorFactory(new AngleSpeedAffectorFactory());

            mBaseFishLordMgr = new BaseFishLordMgr(new CRenderFishFactory(mScene), entity_particle_system_factory);
            mBaseFishLordMgr.create(json_packet_list, route_json_packet_list);
        }
示例#11
0
        //---------------------------------------------------------------------
        void _initBaseFishLordMgr(List<JsonPacket> json_packet_list, List<RouteJsonPacket> route_json_packet_list)
        {
            ParticleSystemFactory fish_lord_factory = new ParticleSystemFactory();

            // ����������
            fish_lord_factory.regGeneratorFactory(new DivergencePointGeneratorFactory());
            fish_lord_factory.regGeneratorFactory(new LineGeneratorFactory());
            fish_lord_factory.regGeneratorFactory(new CircleGeneratorFactory());
            fish_lord_factory.regGeneratorFactory(new IntervalDivergenceGeneratorFactory());
            fish_lord_factory.regGeneratorFactory(new RoundCircleGeneratorFactory());
            fish_lord_factory.regGeneratorFactory(new NormalGeneratorFactory());
            fish_lord_factory.regGeneratorFactory(new RedFishGeneratorFactory());
            fish_lord_factory.regGeneratorFactory(new FixGeneratorFactory());

            // Ӱ��������
            fish_lord_factory.regAffectorFactory(new StopAffectorFactory());
            fish_lord_factory.regAffectorFactory(new StartMoveAffectorFactory());
            fish_lord_factory.regAffectorFactory(new AngleSpeedAffectorFactory());

            mBaseFishLordMgr = new BaseFishLordMgr(new LogicFishFactory(mScene), fish_lord_factory);
            mBaseFishLordMgr.create(json_packet_list, route_json_packet_list);

            mLogicParticleSystemOuter = new LogicParticleSystemOuter();
            mLogicParticleSystemOuter.create(mScene, mBaseFishLordMgr);
        }
示例#12
0
        //---------------------------------------------------------------------
        public void destroy()
        {
            destroyFsm();

            if (mLogicParticleSystemOuter != null)
            {
                mLogicParticleSystemOuter.destroy();
                mLogicParticleSystemOuter = null;
            }

            if (mBaseFishLordMgr != null)
            {
                mBaseFishLordMgr.destroy();
                mBaseFishLordMgr = null;
            }
        }
示例#13
0
 //---------------------------------------------------------------------
 public void destroy()
 {
     mBaseFishLordMgr = null;
 }
示例#14
0
 //---------------------------------------------------------------------
 public void destroy()
 {
     mBaseFishLordMgr = null;
 }