RiftMayhem/Assets/Scripts/SaveData/PlayerAccountData.cs
Pedro Gomes 9c136817b3 Updates to rogue-lite mechanics (WIP)
- visual update on riftraids
- ability unlock system through ability tomes
- (possible) bugfix sprite issue
- player reputation level
2025-01-18 23:14:12 +00:00

61 lines
1.7 KiB
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
[System.Serializable]
public class PlayerAccountData
{
public string userName;
public List<string> characterNames = new List<string>();
public int currentReputationLevel;
public float currentReputationExperience;
public PlayerAccountData()
{
userName = "Player1";
characterNames = new List<string>();
currentReputationLevel = 0;
currentReputationExperience = 0;
}
public PlayerAccountData(string userName)
{
this.userName = userName;
characterNames = new List<string>();
currentReputationLevel = 0;
currentReputationExperience = 0;
}
public PlayerAccountData(string userName, List<string> characters)
{
this.userName = userName;
characterNames = characters;
}
public PlayerAccountData(string userName, List<string> characters, int replevel, float repExp)
{
this.userName = userName;
characterNames = characters;
currentReputationLevel = replevel;
currentReputationExperience = repExp;
}
public bool AddCharacterToPlayerAccount(string characterName)
{
if (!PlayerContainsCharacter(characterName))
{
characterNames.Add(characterName);
Debug.Log("Added: " + characterName + " to account with name: " + userName);
return true;
}
else
{
Debug.Log($"Failed to add {characterName} because this account already contains this name on the list");
return false;
}
}
public bool PlayerContainsCharacter(string characterName)
{
return characterNames.Contains(characterName);
}
}