load JSON files directly instead of embedding in XML.

This commit is contained in:
Colin McMillen 2020-03-04 16:16:41 -05:00
parent 4bcb0d9b95
commit 654bb7fe97
2 changed files with 9 additions and 1 deletions

View File

@ -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);

View File

@ -83,7 +83,7 @@ namespace SemiColinGames {
public static void Load(ContentManager content) {
Executioner = new Sprite(
Textures.Executioner, content.Load<string>("sprites/ccg/executioner_female_json"));
Textures.Executioner, content.LoadString("sprites/ccg/executioner_female.json"));
}
}
}