-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(webui): fancy forms for simple text fields
- Loading branch information
1 parent
93c2ab7
commit 9bd634b
Showing
31 changed files
with
826 additions
and
515 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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
"""Controllers for experience.""" | ||
|
||
from valentina.models import Campaign, User | ||
|
||
|
||
async def total_campaign_experience(campaign: Campaign) -> tuple[int, int, int]: | ||
"""Return the total experience for the campaign.""" | ||
user_id_list = {character.user_owner for character in await campaign.fetch_player_characters()} | ||
available_xp = 0 | ||
total_xp = 0 | ||
cool_points = 0 | ||
|
||
for user_id in user_id_list: | ||
user = await User.get(int(user_id)) | ||
user_available_xp, user_total_xp, user_cool_points = user.fetch_campaign_xp(campaign) | ||
|
||
available_xp += user_available_xp | ||
total_xp += user_total_xp | ||
cool_points += user_cool_points | ||
|
||
return available_xp, total_xp, cool_points |
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
Oops, something went wrong.