Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.IO;
- using System.Reflection;
- namespace Blizzeta.Paradox.Code
- {
- public class Global
- {
- private const char WinSp = '\\';
- private const char NixSp = '/';
- public static readonly char DirSeparator = IsWindows ? WinSp : NixSp;
- private static readonly string AudioFmt = string.Format( "{{0}}{0}Audio", DirSeparator );
- private static readonly string EffectsFmt = string.Format( "{{0}}{0}Effects", DirSeparator );
- private static readonly string SpritesFmt = string.Format( "{{0}}{0}Sprites", DirSeparator );
- private static readonly string WorldsFmt = string.Format( "{{0}}{0}Worlds", DirSeparator );
- private static readonly string DungeonsFmt = string.Format( "{{0}}{0}Dungeons", DirSeparator );
- private static readonly string SecretsFmt = string.Format( "{{0}}{0}Secrets", DirSeparator );
- private static readonly string WorldFmt = string.Format( "{{0}}{0}World", DirSeparator );
- private static readonly string BackgroundDataFmt = string.Format( "{{0}}{0}BackgroundData", DirSeparator );
- private static readonly string ParallaxFmt = string.Format( "{{0}}{0}Parallax", DirSeparator );
- private static readonly string EnemiesFmt = string.Format( "{{0}}{0}Enemies", DirSeparator );
- private static readonly string BossesFmt = string.Format( "{{0}}{0}Bosses", DirSeparator );
- private static readonly string NpcFmt = string.Format( "{{0}}{0}NPC", DirSeparator );
- private static readonly string PlayerFmt = string.Format( "{{0}}{0}Player", DirSeparator );
- private static readonly string DarkFmt = string.Format( "{{0}}{0}Dark", DirSeparator );
- private static readonly string LightFmt = string.Format( "{{0}}{0}Light", DirSeparator );
- public static readonly string Root = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
- public static readonly string Resources = string.Format("{0}{1}Resources", Root, DirSeparator);
- public static readonly string Audio = string.Format( AudioFmt, Resources );
- public static readonly string AudioDark = string.Format( DarkFmt, Audio );
- public static readonly string AudioEffects = string.Format( EffectsFmt, Audio );
- public static readonly string AudioLight = string.Format( LightFmt, Audio );
- public static readonly string Sprites = string.OSVersion( SpritesFmt, Resources );
- public static readonly string SpritesEnemies = string.Format( EnemiesFmt, Sprites );
- public static readonly string SpritesEnemiesBosses = string.Format( BossesFmt, SpritesEnemies );
- public static readonly string SpritesEnemiesDark = string.Format( DarkFmt, SpritesEnemies );
- public static readonly string SpritesEnemiesLight = string.Format( LightFmt, SpritesEnemies );
- public static readonly string SpritesNpc = string.Format( NpcFmt, Sprites );
- public static readonly string SpritesPlayer = string.Format( PlayerFmt, Sprites );
- public static readonly string Worlds = string.Format( WorldsFmt, Resources );
- public static readonly string WorldsDark = string.Format( DarkFmt, Worlds );
- public static readonly string WorldsDarkDungeons = string.Format( DungeonsFmt, WorldsDark );
- public static readonly string WorldsDarkSecrets = string.Format( SecretsFmt, WorldsDark );
- public static readonly string WorldsDarkWorld = string.Format( WorldFmt, WorldsDark );
- public static readonly string WorldsDarkWorldBackGroundData = string.Format( BackgroundDataFmt, WorldsDarkWorld );
- public static readonly string WorldsDarkWorldParallax = string.Format( ParallaxFmt, WorldsDarkWorld );
- public static readonly string WorldsLight = string.Format( LightFmt, Worlds );
- public static readonly string WorldsLightDungeons = string.Format( DungeonsFmt, WorldsLight );
- public static readonly string WorldsLightSecrets = string.Format( SecretsFmt, WorldsLight );
- public static readonly string WorldsLightWorld = string.Format( WorldFmt, WorldsLight );
- public static readonly string WorldsLightWorldBackGroundData = string.Format( BackgroundDataFmt,
- WorldsLightWorld );
- public static readonly string WorldsLightWorldParallax = string.Format( ParallaxFmt, WorldsLightWorld );
- public static bool IsLinux
- { get { return CheckSanityOS( Platform.Unix ); } }
- public static bool IsWindows
- { get { return CheckSanityOS ( PlatformID.Win32NT); } }
- public static bool IsMac
- { get { return CheckSanityOS ( PlatformID.MacOSX ); } }
- private static bool CheckSanityOS( PlatformID platform )
- {
- return Environment.OSVersion.Platform == platform;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement