Implemented database basic functions, added ToFormattedString to Card class, improved commands sending to the guild manager on discord, added toString to user class

This commit is contained in:
Samuele Lorefice
2023-11-07 04:34:04 +01:00
parent 57ddbbf115
commit 85450824a6
4 changed files with 197 additions and 17 deletions

15
Card.cs
View File

@@ -13,8 +13,16 @@ public class Card {
public int CurrentHealth { get; set; }
public User Owner { get; set; }
public override string ToString() {
return $"{Name} ATK: {Attack} DEF: {Defense} HP: {CurrentHealth}/{MaxHealth}";
public override string ToString() => $"{Name} - Atk {Attack} Def {Defense} HP {CurrentHealth}/{MaxHealth}";
public string ToFormattedString() {
var cardStr = $"**{Name}**\n" +
$"**Class:** *COMING SOON*\n"+
$"**ATK:** {Attack}\n" +
$"**DEF:** {Defense}\n" +
$"**HP:** {CurrentHealth}/{MaxHealth}\n";
return cardStr;
}
public Card(string name, int attack, int defense, int maxHealth) {
@@ -24,5 +32,4 @@ public class Card {
MaxHealth = maxHealth;
CurrentHealth = maxHealth;
}
}
}