-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: Player tuple to object and enlargen lobby rectangle (#88)
* feat: Player id * Refactor player tuple to object and enlargen lobby rectangle * Fix missing buttons * dispose last * super.dispose last --------- Co-authored-by: Erick Zanardo <[email protected]>
- Loading branch information
1 parent
dbc0d67
commit 83c0e2a
Showing
8 changed files
with
268 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,33 @@ | ||
import 'package:flame/extensions.dart'; | ||
import 'dart:ui'; | ||
|
||
import 'package:lightrunners/ui/palette.dart'; | ||
|
||
class Player { | ||
int? playerId; | ||
final Color color; | ||
final int slotNumber; | ||
final int? playerId; | ||
final String? gamepadId; | ||
final String? username; | ||
|
||
Player({ | ||
required this.color, | ||
required this.slotNumber, | ||
this.playerId, | ||
this.gamepadId, | ||
this.username, | ||
}); | ||
|
||
Color get color => GamePalette.shipValues[slotNumber]; | ||
|
||
Player copyWith({ | ||
int? slotNumber, | ||
int? playerId, | ||
String? gamepadId, | ||
String? username, | ||
}) { | ||
return Player( | ||
slotNumber: slotNumber ?? this.slotNumber, | ||
playerId: playerId ?? this.playerId, | ||
gamepadId: gamepadId ?? this.gamepadId, | ||
username: username ?? this.username, | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.