override public bool Init(ObjectInitParam param) { CropsInitParam cropsParam = (CropsInitParam)param; if (!DataManager.NPCTable.ContainsKey(cropsParam.crops_res_id)) { return(false); } mRes = DataManager.NPCTable[cropsParam.crops_res_id] as NPCTableItem; mModelResID = mRes.model; if (!base.Init(param)) { return(false); } resid = mRes.resID; mBattleUintAI = AIFactory.Instance.CreateAIObject(this, mRes.ai); if (mBattleUintAI == null) { return(false); } if (cropsParam.talk_id >= 0) { mTalkID = cropsParam.talk_id; } else { mTalkID = mRes.talkID; } if (cropsParam.league != LeagueDef.InvalidLeague) { SetLeague(cropsParam.league); } else { SetLeague(mRes.league); } mDestroyWaiting = true; mMaxDisappearTime = mRes.DisappearTime; mMaxWaitDisappearTime = mRes.WaitDisappearTime; mSummonerAttr = cropsParam.summonerAttr; InitProperty(cropsParam); if (mRes.bossHpUnit < 0 && mRes.showHp) { mBloodNode = BloodUIManager.Instance.CreateBloodUI(); } GetCrySound(); return(true); }
/// <summary> /// コンストラクタ /// </summary> /// <param name="wp">対象のプロセスメモリ</param> /// <param name="type">血統ラインタイプ</param> /// <param name="blood_num">起点にする血統番号</param> public BloodLineTree( KOEI.WP7_2012.WP7 wp, BloodLineType type, UInt32 blood_num ) { this.wp_ = wp; this.type_ = type; this.tree_ = new BloodNode() { blood_num = blood_num, childNode = null, nextBrother = null, }; this.Tree.childNode = this.CreateChildNode( this.tree_ ); }
override public bool Init(ObjectInitParam param) { NpcInitParam npcParam = (NpcInitParam)param; if (!DataManager.NPCTable.ContainsKey(npcParam.npc_res_id)) { return(false); } mRes = DataManager.NPCTable[npcParam.npc_res_id] as NPCTableItem; mModelResID = mRes.model; if (!base.Init(param)) { return(false); } mBattleUintAI = AIFactory.Instance.CreateAIObject(this, mRes.ai); if (mBattleUintAI == null) { return(false); } if (npcParam.talk_id >= 0) { mTalkID = npcParam.talk_id; } else { mTalkID = mRes.talkID; } InitTalk(); SetLeague(mRes.league); mDestroyWaiting = true; mMaxDisappearTime = mRes.DisappearTime; mMaxWaitDisappearTime = mRes.WaitDisappearTime; mLifeTime = npcParam.lifeTime; mSummonerAttr = npcParam.summonerAttr; InitProperty(); if (mRes.bossHpUnit < 0 && mRes.showHp) { mBloodNode = BloodUIManager.Instance.CreateBloodUI(); } GetCrySound(); return(true); }
override public void Destroy() { if (mBloodNode != null) { BloodUIManager.Instance.ReleaseBloodUI(mBloodNode); mBloodNode = null; } if (mBornEffectID != uint.MaxValue) { Scene.RemoveEffect(mBornEffectID); } base.Destroy(); }
public BloodNode CreateBloodUI() { BloodNode node = null; if (mCacheQueue.Count > 0) { node = mCacheQueue.Dequeue() as BloodNode; } else { node = new BloodNode(); node.Init(); } return(node); }
public void ReleaseBloodUI(BloodNode node) { node.Hide(); mCacheQueue.Enqueue(node); }
private void NodeEachSub( BloodNode node, Object obj, EachCallback func, int indentLevel ) { var currentNode = node; while( true ) { var is_last_child = currentNode.childNode == null; var is_last_brother = currentNode.nextBrother == null; if( func( currentNode.blood_num, obj, indentLevel, is_last_brother, is_last_child ) == EachStatus.BREAK ) { throw new EachBreakException(); } // 子血統があるなら、再帰で子血統ノードを解析する if( currentNode.childNode != null ) { var childNode = currentNode.childNode; this.NodeEachSub( childNode, obj, func, indentLevel + 1 ); } // もう兄弟ノードがないなら抜ける if( currentNode.nextBrother == null ) { break; } // 次の兄弟ノード currentNode = currentNode.nextBrother; } }
/// <summary> /// 血統のノードを再帰で構築する /// </summary> /// <param name="tree">親ノード</param> /// <returns>子ノード</returns> private BloodNode CreateChildNode( BloodNode tree ) { BloodNode childNode = null; BloodNode prevChildNode = null; var data = new KOEI.WP7_2012.Datastruct.HBloodData(); for( var i=0; i<this.wp_.HBloodTable.RecordCount; ++i ) { this.wp_.HBloodTable.GetData( (uint)i, ref data ); if( data.mother_num == 0 ) { continue; } var num = this.type_ == BloodLineType.SIRE ? data.father_num : data.mother_num; if( num == tree.blood_num ) { var currentChildNode = new BloodNode() { blood_num = (uint)i, nextBrother = prevChildNode, }; currentChildNode.childNode = this.CreateChildNode( currentChildNode ); prevChildNode = currentChildNode; childNode = currentChildNode; } } return childNode; }