|
@ -1,11 +1,19 @@ |
|
|
using Microsoft.Xna.Framework; |
|
|
using Microsoft.Xna.Framework; |
|
|
|
|
|
using Microsoft.Xna.Framework.Content; |
|
|
using Microsoft.Xna.Framework.Graphics; |
|
|
using Microsoft.Xna.Framework.Graphics; |
|
|
|
|
|
using System.IO; |
|
|
|
|
|
|
|
|
// All extension methods on built-in types (of C# or MonoGame) go in this file.
|
|
|
// All extension methods on built-in types (of C# or MonoGame) go in this file.
|
|
|
// Methods are ordered alphabetically by type name.
|
|
|
// Methods are ordered alphabetically by type name.
|
|
|
|
|
|
|
|
|
namespace SemiColinGames { |
|
|
namespace SemiColinGames { |
|
|
static class ExtensionMethods { |
|
|
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
|
|
|
// Point
|
|
|
public static void Deconstruct(this Point point, out int x, out int y) => |
|
|
public static void Deconstruct(this Point point, out int x, out int y) => |
|
|
(x, y) = (point.X, point.Y); |
|
|
(x, y) = (point.X, point.Y); |
|
|