//--------------------------------------------------------------------- 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; } }
//--------------------------------------------------------------------- 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); }
//--------------------------------------------------------------------- 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); }
//--------------------------------------------------------------------- public EntityGenerator(List <string> server_param, RouteObjectMgr route_object_mgr) { mServerParam = server_param; mRouteObjectMgr = route_object_mgr; if (mServerParam == null) { mServerParam = new List <string>(); } }
//--------------------------------------------------------------------- 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 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; } }
//--------------------------------------------------------------------- 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(); } }
//--------------------------------------------------------------------- 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)); }
//--------------------------------------------------------------------- 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(); } }
//--------------------------------------------------------------------- public EntityGenerator(List<string> server_param, RouteObjectMgr route_object_mgr) { mServerParam = server_param; mRouteObjectMgr = route_object_mgr; if (mServerParam == null) mServerParam = new List<string>(); }
public abstract EntityGenerator buildGenerator(EntityGeneratorData generator_data, List<string> server_param, RouteObjectMgr route_object_mgr);
//--------------------------------------------------------------------- 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 IntervalDivergenceGenerator(IntervalDivergenceGeneratorData generator_data, List <string> server_param, RouteObjectMgr route_object_mgr) : base(generator_data, server_param, route_object_mgr) { mNeedWave = generator_data.mWaveNumber; }
//--------------------------------------------------------------------- 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); } }
//--------------------------------------------------------------------- public EntityGenerator buildGenerator(EntityGeneratorData generator_data, List<string> server_param, RouteObjectMgr route_object_mgr) { return mParticleSystemFactory.buildGenerator(generator_data, server_param, route_object_mgr); }
public abstract EntityGenerator buildGenerator(EntityGeneratorData generator_data, List <string> server_param, RouteObjectMgr route_object_mgr);
//--------------------------------------------------------------------- public DivergencePointGenerator(DivergencePointGeneratorData generator_data, List <string> server_param, RouteObjectMgr route_object_mgr) : base(generator_data, server_param, route_object_mgr) { }
//--------------------------------------------------------------------- public EntityGenerator buildGenerator(EntityGeneratorData generator_data, List <string> server_param, RouteObjectMgr route_object_mgr) { return(mParticleSystemFactory.buildGenerator(generator_data, server_param, route_object_mgr)); }