forked from hajsdfgj/modular-overhaul
-
Notifications
You must be signed in to change notification settings - Fork 0
/
IProfession.cs
38 lines (28 loc) · 1.35 KB
/
IProfession.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
namespace DaLion.Overhaul.Modules.Professions;
#region using directives
using System.Collections.Generic;
using System.Linq;
using DaLion.Shared.Extensions;
#endregion using directives
/// <summary>Interface for all of the <see cref="Farmer"/>'s professions.</summary>
public interface IProfession
{
/// <summary>Gets a string that uniquely identifies this profession.</summary>
string StringId { get; }
/// <summary>Gets the index used in-game to track professions acquired by the player.</summary>
int Id { get; }
/// <summary>Gets the localized and gendered title for this profession.</summary>
string Title { get; }
/// <summary>Gets the localized description text for this profession.</summary>
string Description { get; }
/// <summary>Gets the level at which this profession is offered.</summary>
/// <remarks>Either 5 or 10.</remarks>
int Level { get; }
/// <summary>Gets the <see cref="ISkill"/> which offers this profession.</summary>
ISkill ParentSkill { get; }
/// <summary>Gets get the professions which branch off from this profession, if any.</summary>
IEnumerable<IProfession> BranchingProfessions =>
this.Level != 5 || !this.ParentSkill.ProfessionPairs.TryGetValue(this.Id, out var pair)
? Enumerable.Empty<IProfession>()
: pair.First.Collect(pair.Second);
}