66 lines
1.7 KiB
C#
66 lines
1.7 KiB
C#
namespace RpgRoller.Components.Pages;
|
|
|
|
public sealed class FormState<TModel> where TModel : new()
|
|
{
|
|
public void ResetValidation()
|
|
{
|
|
Errors.Clear();
|
|
ErrorMessage = null;
|
|
}
|
|
|
|
public TModel Model { get; } = new();
|
|
public Dictionary<string, string> Errors { get; } = [];
|
|
public string? ErrorMessage { get; set; }
|
|
}
|
|
|
|
public sealed class RegisterFormModel
|
|
{
|
|
public string Username { get; set; } = string.Empty;
|
|
public string DisplayName { get; set; } = string.Empty;
|
|
public string Password { get; set; } = string.Empty;
|
|
}
|
|
|
|
public sealed class LoginFormModel
|
|
{
|
|
public string Username { get; set; } = string.Empty;
|
|
public string Password { get; set; } = string.Empty;
|
|
}
|
|
|
|
public sealed class CampaignFormModel
|
|
{
|
|
public string Name { get; set; } = string.Empty;
|
|
public string RulesetId { get; set; } = string.Empty;
|
|
}
|
|
|
|
public sealed class CharacterFormModel
|
|
{
|
|
public string Name { get; set; } = string.Empty;
|
|
public string CampaignId { get; set; } = string.Empty;
|
|
public string OwnerUsername { get; set; } = string.Empty;
|
|
}
|
|
|
|
public sealed class SkillFormModel
|
|
{
|
|
public string Name { get; set; } = string.Empty;
|
|
public string DiceRollDefinition { get; set; } = string.Empty;
|
|
public string SkillGroupId { get; set; } = string.Empty;
|
|
public int WildDice { get; set; }
|
|
public bool AllowFumble { get; set; }
|
|
}
|
|
|
|
public sealed class SkillGroupFormModel
|
|
{
|
|
public string Name { get; set; } = string.Empty;
|
|
public string DiceRollDefinition { get; set; } = string.Empty;
|
|
public int WildDice { get; set; }
|
|
public bool AllowFumble { get; set; }
|
|
}
|
|
|
|
public enum HomeViewMode
|
|
{
|
|
Loading,
|
|
Anonymous,
|
|
Workspace,
|
|
Admin
|
|
}
|