diff --git a/Shared/ExtensionMethods.cs b/Shared/ExtensionMethods.cs index b781156..fa5d6a4 100644 --- a/Shared/ExtensionMethods.cs +++ b/Shared/ExtensionMethods.cs @@ -1,11 +1,19 @@ using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Content; using Microsoft.Xna.Framework.Graphics; +using System.IO; // All extension methods on built-in types (of C# or MonoGame) go in this file. // Methods are ordered alphabetically by type name. namespace SemiColinGames { static class ExtensionMethods { + // ContentManager + public static string LoadString(this ContentManager content, string path) { + string fullPath = Path.Combine(content.RootDirectory, path); + return File.ReadAllText(fullPath); + } + // Point public static void Deconstruct(this Point point, out int x, out int y) => (x, y) = (point.X, point.Y); diff --git a/Shared/Sprites.cs b/Shared/Sprites.cs index 2662ec4..5676490 100644 --- a/Shared/Sprites.cs +++ b/Shared/Sprites.cs @@ -83,7 +83,7 @@ namespace SemiColinGames { public static void Load(ContentManager content) { Executioner = new Sprite( - Textures.Executioner, content.Load("sprites/ccg/executioner_female_json")); + Textures.Executioner, content.LoadString("sprites/ccg/executioner_female.json")); } } }