improvements
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
namespace Faraon.Core.Models;
|
||||
|
||||
using Faraon.Core.AI;
|
||||
|
||||
public enum PlayerType
|
||||
{
|
||||
Human = 0,
|
||||
@@ -20,6 +22,8 @@ public class Player
|
||||
public PlayerType Type { get; set; } = PlayerType.Human;
|
||||
public AIDifficulty Difficulty { get; set; } = AIDifficulty.Medium;
|
||||
public string Avatar { get; set; } = "👑";
|
||||
public string? PersonalityId { get; set; }
|
||||
public PlayerEmotion CurrentEmotion { get; set; } = PlayerEmotion.Neutral;
|
||||
public List<Card> Hand { get; } = new();
|
||||
|
||||
public int? FinishedPosition { get; set; }
|
||||
@@ -39,12 +43,39 @@ public class Player
|
||||
|
||||
public Player() { }
|
||||
|
||||
public Player(string name, PlayerType type, string avatar = "👤", AIDifficulty difficulty = AIDifficulty.Medium)
|
||||
public Player(string name, PlayerType type, string avatar = "👤", AIDifficulty difficulty = AIDifficulty.Medium, string? personalityId = null)
|
||||
{
|
||||
Name = name;
|
||||
Type = type;
|
||||
Avatar = avatar;
|
||||
Difficulty = difficulty;
|
||||
PersonalityId = personalityId;
|
||||
}
|
||||
|
||||
public string GetLiveAvatar()
|
||||
{
|
||||
if (Type == PlayerType.AI && !string.IsNullOrEmpty(PersonalityId))
|
||||
{
|
||||
var p = AIPersonality.GetById(PersonalityId);
|
||||
return p.GetAvatarForEmotion(CurrentEmotion);
|
||||
}
|
||||
return Avatar;
|
||||
}
|
||||
|
||||
public string? GetEmotionBadge()
|
||||
{
|
||||
return CurrentEmotion switch
|
||||
{
|
||||
PlayerEmotion.Thinking => "💡",
|
||||
PlayerEmotion.Confident => "✨",
|
||||
PlayerEmotion.Shocked => "💧",
|
||||
PlayerEmotion.Freezing => "❄️",
|
||||
PlayerEmotion.Angry => "🔥",
|
||||
PlayerEmotion.Relieved => "🍀",
|
||||
PlayerEmotion.Desperate => "💀",
|
||||
PlayerEmotion.Celebrating => "🎉",
|
||||
_ => null
|
||||
};
|
||||
}
|
||||
|
||||
public void Reset()
|
||||
@@ -52,5 +83,6 @@ public class Player
|
||||
Hand.Clear();
|
||||
FinishedPosition = null;
|
||||
IsSkipped = false;
|
||||
CurrentEmotion = PlayerEmotion.Neutral;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user