summaryrefslogtreecommitdiff
path: root/server/lib/core/methods/character_methods.dart
diff options
context:
space:
mode:
authorJoel Klinghed <the_jk@spawned.biz>2026-11-23 15:38:13 +0100
committerJoel Klinghed <the_jk@spawned.biz>2026-11-23 15:38:13 +0100
commit7ee14396b1f1f96ed0472b5949ce82a7f9313276 (patch)
treecddf00fe4049908155a15e813bb8d226ad710f81 /server/lib/core/methods/character_methods.dart
parent4a45fe143bd050d89183427443dedfd656f507bc (diff)
server: make local variables final (prefer_final_locals)
270 locals across 52 files. Six of them were declared with an unnecessarily nullable type (ModifierDeck? / LootDeckModel?) although the initializer is non-nullable; non-final locals were silently flow-promoted to the initializer's type, but final locals are not, so the nullability is dropped where it was wrong.
Diffstat (limited to 'server/lib/core/methods/character_methods.dart')
-rw-r--r--server/lib/core/methods/character_methods.dart10
1 files changed, 5 insertions, 5 deletions
diff --git a/server/lib/core/methods/character_methods.dart b/server/lib/core/methods/character_methods.dart
index 9c2705a..6cd6c10 100644
--- a/server/lib/core/methods/character_methods.dart
+++ b/server/lib/core/methods/character_methods.dart
@@ -193,7 +193,7 @@ class CharacterMethods {
final list = character.characterState.summonList;
if (list.isNotEmpty && list.first.name == name) {
- int hp = health + character.characterState.level * multiplier;
+ final int hp = health + character.characterState.level * multiplier;
list.first.setMaxHealth(s, hp);
list.first.setHealth(s, hp);
}
@@ -261,7 +261,7 @@ class CharacterMethods {
}
if (name.isNotEmpty) {
- MonsterInstance summon = MonsterInstance.summon(
+ final MonsterInstance summon = MonsterInstance.summon(
_kSpecialSummonStandeeNr,
MonsterType.summon,
name,
@@ -282,7 +282,7 @@ class CharacterMethods {
List<Character> characters, {
GameState? gameState,
}) {
- List<ListItemData> newList = [];
+ final List<ListItemData> newList = [];
final gs = gameState ?? getIt<GameState>();
for (final item in gs.currentList) {
if (item is Character) {
@@ -314,7 +314,7 @@ class CharacterMethods {
GameData? gameData,
}) {
Character? character;
- List<CharacterClass> characters = [];
+ final List<CharacterClass> characters = [];
final gd = gameData ?? getIt<GameData>();
final modelData = gd.modelData;
for (String key in modelData.keys) {
@@ -371,7 +371,7 @@ class CharacterMethods {
}
if (name.isNotEmpty) {
- MonsterInstance summon = MonsterInstance.summon(
+ final MonsterInstance summon = MonsterInstance.summon(
_kSpecialSummonStandeeNr,
MonsterType.summon,
name,