public static void recordAllIndex(HeroTeam heroTeam, BattleIndexRecord record) { record.TargetSide = heroTeam.battlingActorSize(); foreach (HeroPoint _point in heroTeam.BattlingHeroArr) { addSinglePointToCheckList(record, _point); } foreach (HeroPoint _point in heroTeam.WaitingHeroList) { addSinglePointToCheckList(record, _point); } }
public static void recordFillIndex(HeroTeam heroTeam, BattleIndexRecord record) { foreach (HeroPoint _point in heroTeam.WaitingHeroList) { addSinglePointToFillList(record, _point); } }
public virtual void finishIndexRecord() { StringBuilder _sb = new StringBuilder(); foreach (PointRecord _point in curIndexRecord.AllPointList) { _sb.Append(string.Format("index:{0:D}; color:{1:D}", _point.Index, _point.Color)); } Console.WriteLine(_sb.ToString()); curIndexRecord = null; }
protected internal static void addSinglePointToCheckList(BattleIndexRecord record, HeroPoint point) { //JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final': //ORIGINAL LINE: final int _index = point.getFighter().getIndex(); int _index = point.Fighter.Index; //JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final': //ORIGINAL LINE: final int _color = point.getColor().getIndex(); int _color = point.Color.Index; record.addPointList(_index, _color); }
/// <summary> /// Show record of hero's color and index. /// </summary> /// <param name="battleIndexRecord">Battle index record</param> public void showBattleIndexRecord(BattleIndexRecord battleIndexRecord) { Logger.Log("[-----RECORD-----] - battle index record: " + battleIndexRecord); var battleModelLocator = BattleModelLocator.Instance; // first time battle set all colors according to fill point list, which contains everything. if (battleModelLocator.NextList == null) { battleModelLocator.NextList = battleIndexRecord.FillPointList; // fill in all character list colors. SetColors(TeamController.CharacterList); // init next foot manager's on stage color list. footManager.OnStageColorList = attackWaitList.Select(item => item.ColorIndex).ToList(); footManager.Initialize(); } else { battleModelLocator.NextList = battleIndexRecord.FillPointList; // Remove redurant colors that already taken last round. // New colors are only left for selected characters. // Server send client colors that including waiting list color (we known) plus selected list color (unknown). for (var i = 0; i < TeamController.Total - TeamController.VisibleCount; ++i) { battleModelLocator.NextList.RemoveAt(0); } // init next foot manager's waiting color list. footManager.WaitingColorList = battleModelLocator.NextList.Select(item => item.Color).ToList(); } if (battleIndexRecord.prop.ContainsKey(BattleRecordConstants.BATTLE_HERO_TOTAL_HP)) { characterValue = battleIndexRecord.getIntProp(BattleRecordConstants.BATTLE_HERO_TOTAL_HP); // init total hp value the first time. if (hpController.TotalValue <= characterValue) { hpController.TotalValue = characterValue; } hpController.ShowForgroundBar(characterValue); } if (battleIndexRecord.prop.ContainsKey(BattleRecordConstants.BATTLE_HERO_TOTAL_MP)) { // init total mp value the first time. if (mpController.TotalValue <= 0) { mpController.TotalValue = battleIndexRecord.getIntProp(BattleRecordConstants.BATTLE_HERO_TOTAL_MP); } mpController.ShowForgroundBar(0); } recordIndex++; DealWithRecord(); }