Added support for savemaxpower
This commit is contained in:
@@ -19,6 +19,7 @@ namespace TOOHUCardAPI.Data.Models
|
||||
public bool Ban { get; set; }
|
||||
public int Point { get; set; }
|
||||
public DateTime LastFirstWin { get; set; }
|
||||
public int PowerMaxTotal { get; set; }
|
||||
public List<EncodedCardGroup> EncodedCardGroups { get; set; }
|
||||
public List<CardLevel> CardLevels { get; set; }
|
||||
}
|
||||
|
||||
@@ -29,6 +29,14 @@ namespace TOOHUCardAPI.Data.Services
|
||||
_logger.LogInformation($"User with steamid {user.SteamId} was given {points} points. New total: {user.Point}");
|
||||
}
|
||||
|
||||
public async Task<int> ChangePowerMaxTotal(string steamId, int amt)
|
||||
{
|
||||
User user = await _userRepository.GetUser(steamId);
|
||||
user.PowerMaxTotal = Math.Clamp(user.PowerMaxTotal + amt, 0, int.MaxValue);
|
||||
await _userRepository.UpdateUser(user);
|
||||
return user.PowerMaxTotal;
|
||||
}
|
||||
|
||||
public async Task<int> LevelUpCard(string steamId, string itemName, int levelIncrease)
|
||||
{
|
||||
User user = await _userRepository.GetUser(steamId);
|
||||
|
||||
Reference in New Issue
Block a user