コード例 #1
0
 void writeToRecords(EnemyCaptureResult enemyComponent, int corrospondIndex)
 {
     //If this type of component is in the record
     if (corrospondIndex > -1)
     {
         if (enemyComponent.CapturedComponentScore.IsScoreHigherThen(Records[corrospondIndex].CapturedComponentScore))
         {
             Records[corrospondIndex] = enemyComponent;
         }
     }
     else
     {
         Records.Add(enemyComponent);
         Records.OrderBy(p => p.CapturedComponentID.ComponentID);
     }
 }
コード例 #2
0
 int getCorronspondingEnemyIndex(EnemyCaptureResult record)
 {
     return(Records.FindIndex(p => p.CapturedComponentID.Equals(record.CapturedComponentID)));
 }
コード例 #3
0
        public void AddNewRecord(EnemyCaptureResult enemyComponent)
        {
            int corrospondIndex = getCorronspondingEnemyIndex(enemyComponent);

            writeToRecords(enemyComponent, corrospondIndex);
        }