-
-
Notifications
You must be signed in to change notification settings - Fork 262
/
VillagerSprite.cs
32 lines (30 loc) · 1.04 KB
/
VillagerSprite.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
using System.Drawing;
using NHSE.Core;
using NHSE.Sprites.Properties;
namespace NHSE.Sprites
{
/// <summary>
/// Provides sprites for Villagers.
/// </summary>
public static class VillagerSprite
{
/// <summary>
/// Gets the Villager's 128x128 sprite based on the input parameters.
/// </summary>
/// <param name="species">Species of Villager</param>
/// <param name="variant">Variant of Villager</param>
public static Image? GetVillagerSprite(VillagerSpecies species, int variant)
{
var asset = VillagerUtil.GetInternalVillagerName(species, variant);
return GetVillagerSprite(asset);
}
/// <summary>
/// Gets the sprite for the Villager based on its internal name.
/// </summary>
/// <param name="asset">Internal name of the villager (3char, 2digit)</param>
public static Image? GetVillagerSprite(string asset)
{
return (Image?)Resources.ResourceManager.GetObject(asset);
}
}
}