mirror of https://github.com/flutter/pinball.git
parent
6207ed3a49
commit
18de0d73d6
@ -0,0 +1,10 @@
|
|||||||
|
import 'package:flame/components.dart';
|
||||||
|
import 'package:pinball_components/pinball_components.dart';
|
||||||
|
import 'package:pinball_flame/pinball_flame.dart';
|
||||||
|
|
||||||
|
class SignPostProgressingBehavior extends Component with ParentIsA<Signpost> {
|
||||||
|
@override
|
||||||
|
Future<void> onLoad() async {
|
||||||
|
await super.onLoad();
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,14 @@
|
|||||||
|
import 'package:bloc/bloc.dart';
|
||||||
|
|
||||||
|
part 'signpost_state.dart';
|
||||||
|
|
||||||
|
class SignpostCubit extends Cubit<SignpostState> {
|
||||||
|
SignpostCubit() : super(SignpostState.inactive);
|
||||||
|
|
||||||
|
void progress() {
|
||||||
|
final index = SignpostState.values.indexOf(state);
|
||||||
|
emit(
|
||||||
|
SignpostState.values[(index + 1) % SignpostState.values.length],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,17 @@
|
|||||||
|
// ignore_for_file: public_member_api_docs
|
||||||
|
|
||||||
|
part of 'signpost_cubit.dart';
|
||||||
|
|
||||||
|
enum SignpostState {
|
||||||
|
/// Signpost with no active dashes.
|
||||||
|
inactive,
|
||||||
|
|
||||||
|
/// Signpost with a single sign of lit up dashes.
|
||||||
|
active1,
|
||||||
|
|
||||||
|
/// Signpost with two signs of lit up dashes.
|
||||||
|
active2,
|
||||||
|
|
||||||
|
/// Signpost with all signs of lit up dashes.
|
||||||
|
active3,
|
||||||
|
}
|
Loading…
Reference in new issue