blob: 9ffb2799f3565b637fcce03677c468612bbf8aea (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
import '../state/game_state.dart';
import 'command_l10n.dart';
class SetInitCommand extends Command {
final GameState _gameState;
final String _characterId;
final int _init;
SetInitCommand(this._characterId, this._init, {required GameState gameState})
: _gameState = gameState;
@override
void execute() {
//add new character on top of list
for (final item in _gameState.currentList) {
if (item.id == _characterId && item is Character) {
item.characterState.setInitiative(stateAccess, _init);
}
}
}
@override
String describe() {
return commandL10n.cmdSetInitiative(_characterId);
}
}
|