mirror of
				https://github.com/flame-engine/flame.git
				synced 2025-11-04 13:08:09 +08:00 
			
		
		
		
	
		
			
				
	
	
		
			24 lines
		
	
	
		
			455 B
		
	
	
	
		
			Dart
		
	
	
	
	
	
			
		
		
	
	
			24 lines
		
	
	
		
			455 B
		
	
	
	
		
			Dart
		
	
	
	
	
	
import 'dart:ui';
 | 
						|
 | 
						|
import '../timer.dart';
 | 
						|
import 'component.dart';
 | 
						|
 | 
						|
/// Simple component which wraps a [Timer] instance allowing it to be easily used inside a [BaseGame] game.
 | 
						|
class TimerComponent extends Component {
 | 
						|
  Timer timer;
 | 
						|
 | 
						|
  TimerComponent(this.timer);
 | 
						|
 | 
						|
  @override
 | 
						|
  void update(double dt) {
 | 
						|
    super.update(dt);
 | 
						|
    timer.update(dt);
 | 
						|
  }
 | 
						|
 | 
						|
  @override
 | 
						|
  void render(Canvas canvas) {}
 | 
						|
 | 
						|
  @override
 | 
						|
  bool get shouldRemove => timer.finished;
 | 
						|
}
 |