public OldPerson(Texture2D texture, Vector2 location, NPCEnum type) { width = height = 16; Location = new Rectangle((int)location.X, (int)location.Y, (int)(width * Game1.Scale), (int)(height * Game1.Scale)); Texture = texture; Type = type; List <Rectangle> sources = SpritesheetHelper.GetFramesH(xOffset, yOffset, width, height, 3); typeRectMap = new Dictionary <NPCEnum, Rectangle> { { NPCEnum.OldMan1, sources[0] }, { NPCEnum.OldMan2, sources[1] }, { NPCEnum.OldWoman, sources[2] } }; }
public static string GetName(this NPCEnum npc) => Enum.GetName(npc.GetType(), npc);