Michael
ad725ee518
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
Some general refactors: Turns HeroPartySO into a runtime set class. Make runtime set an IEnumerable Simplify name of events Reviewed-on: #17 Reviewed-by: zephyr <zephyr@noreply.localhost> Co-authored-by: Michael <mep053@gmail.com> Co-committed-by: Michael <mep053@gmail.com>
33 lines
826 B
C#
33 lines
826 B
C#
using System.Runtime.CompilerServices;
|
|
using RuntimeSet;
|
|
using UnityEngine;
|
|
using UnityEngine.Assertions;
|
|
|
|
[assembly: InternalsVisibleTo("TestsPlaymode")]
|
|
|
|
/// <summary>
|
|
/// Component that makes a duder a duder.
|
|
/// Manages class, skills, level, attrs, and AI.
|
|
/// </summary>
|
|
public class HeroUnit : MonoBehaviour
|
|
{
|
|
[SerializeField] private new string name;
|
|
[SerializeField] private HeroClassSO class_;
|
|
[SerializeField] private long level;
|
|
[SerializeField] private long xp;
|
|
[SerializeField] private HeroAttributesSO attrs;
|
|
[SerializeField] private HeroUnitRuntimeSetSO _party;
|
|
internal HeroUnitRuntimeSetSO party => _party;
|
|
|
|
private void OnEnable()
|
|
{
|
|
Assert.IsNotNull(_party);
|
|
_party.Add(this);
|
|
}
|
|
|
|
private void OnDisable()
|
|
{
|
|
_party.Remove(this);
|
|
}
|
|
}
|