You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: ImperialCommander2/Assets/Scripts/GameCore/DataStore.cs
+3-3Lines changed: 3 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -844,7 +844,7 @@ static List<DeploymentCard> GetCardsByTier( List<DeploymentCard> haystack, int t
844
844
/// </summary>
845
845
publicstaticDeploymentCardGetHero(stringid)
846
846
{
847
-
returnheroCards.Concat(globalImportedCharacters.Where( x =>x.deploymentCard.characterType==CharacterType.Hero).Select( x =>x.deploymentCard)).First( x =>x.id==id)??null;
847
+
returnheroCards.Concat(globalImportedCharacters.Where( x =>x.deploymentCard.characterType==CharacterType.Hero).Select( x =>x.deploymentCard)).FirstOrDefault( x =>x.id==id)??null;
848
848
}
849
849
850
850
/// <summary>
@@ -864,9 +864,9 @@ public static DeploymentCard GetEnemy( string id )
864
864
varimports=globalImportedCharacters.Where( x =>x.deploymentCard.characterType==CharacterType.Imperial||x.deploymentCard.characterType==CharacterType.Villain).Select( x =>x.deploymentCard);
865
865
866
866
if(villainCards.Concat(imports).Any( x =>x.id==id))
867
-
returnvillainCards.Where( x =>x.id==id).First();
867
+
returnvillainCards.Where( x =>x.id==id).FirstOr(null);
868
868
elseif(deploymentCards.Concat(imports).Any( x =>x.id==id))
869
-
returndeploymentCards.Concat(imports).Where( x =>x.id==id).First();
869
+
returndeploymentCards.Concat(imports).Where( x =>x.id==id).FirstOr(null);
t.GetComponent<TileRenderer>().LoadTile(mt,tileDescriptors.Where( x =>x.expansion==mt.expansion.ToString()&&x.id.ToString()==mt.tileID).First());
62
+
t.GetComponent<TileRenderer>().LoadTile(mt,tileDescriptors.Where( x =>x.expansion==mt.expansion.ToString()&&x.id.ToString()==mt.tileID).FirstOr(null));
63
63
mt.tileRenderer=tileRenderer;
64
64
}
65
65
}
@@ -87,7 +87,10 @@ public void CamToTile( Guid tileID, bool immediate = false, Action callback = nu
87
87
88
88
publicvoidCamToSection(Guidguid)
89
89
{
90
-
intidx=mapSections.IndexOf(mapSections.Where( x =>x.GUID==guid).First());
90
+
varselectedSection=mapSections.Where( x =>x.GUID==guid).FirstOr(null);
Copy file name to clipboardExpand all lines: ImperialCommander2/Assets/Scripts/Screens/CampaignScreen/CampaignHeroPrefab.cs
+20-14Lines changed: 20 additions & 14 deletions
Original file line number
Diff line number
Diff line change
@@ -115,28 +115,34 @@ public void AddHeroToUI( CampaignHero hero )
115
115
//skills
116
116
varskills=SagaCampaign.campaignDataSkills.Concat(DataStore.globalImportedCharacters.Where( x =>x.deploymentCard.characterType==CharacterType.Hero).SelectMany( x =>x.heroSkills));
0 commit comments