File tree 1 file changed +4
-4
lines changed
1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -59,19 +59,19 @@ public int CurrentFrame
59
59
/// <param name="gametype">for blitz, others will be ignored</param>
60
60
/// <exception cref="NotImplementedException"></exception>
61
61
/// <exception cref="Exception"></exception>
62
- public Environment ( IReadOnlyList < Event > events , GameType ? gametype )
62
+ public Environment ( IReadOnlyList < Event > ? events , GameType ? gametype )
63
63
{
64
64
IsSelfControlMode = false ;
65
65
_manager = this ;
66
66
_events = events ;
67
67
//todo:implement it in Options
68
68
Kickset = new KicksetSRSPlus ( ) ;
69
69
70
- var eventEnd = ( events . First ( @event => @event . type == EventType . End ) as EventEnd ) ;
71
- if ( eventEnd != null )
70
+ if ( events != null &&
71
+ events . FirstOrDefault ( @event => @event . type == EventType . End ) is EventEnd eventEnd )
72
72
TotalFrame = ( int ) eventEnd . frame ;
73
73
else //TODO: EventExit instead of EventEnd?
74
- throw new NotImplementedException ( ) ;
74
+ throw new Exception ( "no end event detected!" ) ;
75
75
76
76
try
77
77
{
You can’t perform that action at this time.
0 commit comments