44using System . Threading ;
55using System . Linq ;
66using C7GameData ;
7- using C7Engine ;
87
98public partial class AnimationTracker {
109 private AnimationManager civ3AnimData ;
@@ -22,7 +21,7 @@ public struct ActiveAnimation {
2221 public C7Animation anim ;
2322 }
2423
25- private Dictionary < string , ActiveAnimation > activeAnims = new Dictionary < string , ActiveAnimation > ( ) ;
24+ public Dictionary < string , ActiveAnimation > activeAnims = new Dictionary < string , ActiveAnimation > ( ) ;
2625
2726 public long getCurrentTimeMS ( )
2827 {
@@ -45,8 +44,9 @@ private void startAnimation(string id, C7Animation anim, AutoResetEvent completi
4544 if ( activeAnims . TryGetValue ( id , out aa ) ) {
4645 // If there's already an animation playing for this unit, end it first before replacing it
4746 // TODO: Consider instead queueing up the new animation until after the first one is completed
48- if ( aa . completionEvent != null )
47+ if ( aa . completionEvent is not null ) {
4948 aa . completionEvent . Set ( ) ;
49+ }
5050 }
5151 aa = new ActiveAnimation { startTimeMS = currentTimeMS , endTimeMS = currentTimeMS + animDurationMS , completionEvent = completionEvent ,
5252 ending = ending , anim = anim } ;
@@ -158,9 +158,6 @@ public MapUnit.Appearance getUnitAppearance(MapUnit unit)
158158 public C7Animation getTileEffect ( Tile tile )
159159 {
160160 ActiveAnimation aa ;
161- if ( activeAnims . TryGetValue ( getTileID ( tile ) , out aa ) )
162- return aa . anim ;
163- else
164- return null ;
161+ return activeAnims . TryGetValue ( getTileID ( tile ) , out aa ) ? aa . anim : null ;
165162 }
166163}
0 commit comments