Ejemplo n.º 1
0
        //---------------------------------------------------------------------
        public void destroy()
        {
            if (mEntityFactory != null)
            {
                mEntityFactory = null;
            }

            if (mParticleSystemDataPrototype != null)
            {
                mParticleSystemDataPrototype = null;
            }

            if (mRouteObjectMgr != null)
            {
                mRouteObjectMgr = null;
            }

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

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

            if (mBaseEntityKeeper != null)
            {
                mBaseEntityKeeper.destroy();
                mBaseEntityKeeper = null;
            }
        }
Ejemplo n.º 2
0
 //---------------------------------------------------------------------
 public void create(List <JsonPacket> json_packet_list, List <RouteJsonPacket> route_json_packet_list)
 {
     mParticleSystemDataPrototype = new ParticleSystemDataPrototype(json_packet_list, mParticleSystemFactory);
     mParticleSystemKeeper        = new ParticleSystemKeeper();
     mBaseEntityKeeper            = new BaseEntityKeeper();
     mRouteObjectMgr = new RouteObjectMgr(route_json_packet_list);
 }
Ejemplo n.º 3
0
 //---------------------------------------------------------------------
 public void create(List<JsonPacket> json_packet_list, List<RouteJsonPacket> route_json_packet_list)
 {
     mParticleSystemDataPrototype = new ParticleSystemDataPrototype(json_packet_list, mParticleSystemFactory);
     mParticleSystemKeeper = new ParticleSystemKeeper();
     mBaseEntityKeeper = new BaseEntityKeeper();
     mRouteObjectMgr = new RouteObjectMgr(route_json_packet_list);
 }
Ejemplo n.º 4
0
 //---------------------------------------------------------------------
 public EntityGenerator(List <string> server_param, RouteObjectMgr route_object_mgr)
 {
     mServerParam    = server_param;
     mRouteObjectMgr = route_object_mgr;
     if (mServerParam == null)
     {
         mServerParam = new List <string>();
     }
 }
Ejemplo n.º 5
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;
        }
Ejemplo n.º 6
0
 //---------------------------------------------------------------------
 public EntityGenerator buildGenerator(EntityGeneratorData generator_data, List<string> server_param, RouteObjectMgr route_object_mgr)
 {
     string type_name = generator_data.GetType().ToString();
     if (mDicGeneratorFactory.ContainsKey(type_name))
     {
         return mDicGeneratorFactory[type_name].buildGenerator(generator_data, server_param, route_object_mgr);
     }
     else
     {
         EbLog.Error(@"BaseFishLordMgr::buildGenerator::error::there are no " + type_name + " factory");
         return null;
     }
 }
Ejemplo n.º 7
0
        //---------------------------------------------------------------------
        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();
            }
        }
Ejemplo n.º 8
0
 //---------------------------------------------------------------------
 public override EntityGenerator buildGenerator(EntityGeneratorData generator_data,
                                                List <string> server_param, RouteObjectMgr route_object_mgr)
 {
     return(new RedFishGenerator((RedFishGeneratorData)generator_data, server_param, route_object_mgr));
 }
Ejemplo n.º 9
0
 //---------------------------------------------------------------------
 public RedFishGenerator(RedFishGeneratorData generator_data, List <string> server_param, RouteObjectMgr route_object_mgr)
     : base(generator_data, server_param, route_object_mgr)
 {
 }
        //---------------------------------------------------------------------
        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();
            }
        }
Ejemplo n.º 11
0
 //---------------------------------------------------------------------
 public EntityGenerator(List<string> server_param, RouteObjectMgr route_object_mgr)
 {
     mServerParam = server_param;
     mRouteObjectMgr = route_object_mgr;
     if (mServerParam == null) mServerParam = new List<string>();
 }
Ejemplo n.º 12
0
 public abstract EntityGenerator buildGenerator(EntityGeneratorData generator_data, List<string> server_param, RouteObjectMgr route_object_mgr);
Ejemplo n.º 13
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);
        }
Ejemplo n.º 14
0
 //---------------------------------------------------------------------
 public IntervalDivergenceGenerator(IntervalDivergenceGeneratorData generator_data, List <string> server_param, RouteObjectMgr route_object_mgr)
     : base(generator_data, server_param, route_object_mgr)
 {
     mNeedWave = generator_data.mWaveNumber;
 }
Ejemplo n.º 15
0
        //---------------------------------------------------------------------
        public EntityGenerator buildGenerator(EntityGeneratorData generator_data, List <string> server_param, RouteObjectMgr route_object_mgr)
        {
            string type_name = generator_data.GetType().ToString();

            if (mDicGeneratorFactory.ContainsKey(type_name))
            {
                return(mDicGeneratorFactory[type_name].buildGenerator(generator_data, server_param, route_object_mgr));
            }
            else
            {
                EbLog.Error(@"BaseFishLordMgr::buildGenerator::error::there are no " + type_name + " factory");
                return(null);
            }
        }
Ejemplo n.º 16
0
 //---------------------------------------------------------------------
 public EntityGenerator buildGenerator(EntityGeneratorData generator_data, List<string> server_param, RouteObjectMgr route_object_mgr)
 {
     return mParticleSystemFactory.buildGenerator(generator_data, server_param, route_object_mgr);
 }
Ejemplo n.º 17
0
 public abstract EntityGenerator buildGenerator(EntityGeneratorData generator_data, List <string> server_param, RouteObjectMgr route_object_mgr);
Ejemplo n.º 18
0
 //---------------------------------------------------------------------
 public DivergencePointGenerator(DivergencePointGeneratorData generator_data, List <string> server_param, RouteObjectMgr route_object_mgr)
     : base(generator_data, server_param, route_object_mgr)
 {
 }
Ejemplo n.º 19
0
        //---------------------------------------------------------------------
        public void destroy()
        {
            if (mEntityFactory != null)
            {
                mEntityFactory = null;
            }

            if (mParticleSystemDataPrototype != null)
            {
                mParticleSystemDataPrototype = null;
            }

            if (mRouteObjectMgr != null)
            {
                mRouteObjectMgr = null;
            }

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

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

            if (mBaseEntityKeeper != null)
            {
                mBaseEntityKeeper.destroy();
                mBaseEntityKeeper = null;
            }
        }
Ejemplo n.º 20
0
 //---------------------------------------------------------------------
 public EntityGenerator buildGenerator(EntityGeneratorData generator_data, List <string> server_param, RouteObjectMgr route_object_mgr)
 {
     return(mParticleSystemFactory.buildGenerator(generator_data, server_param, route_object_mgr));
 }