1 module pixelperfectengine.system.exc; 2 /* 3 * Copyright (C) 2015-2017, by Laszlo Szeremi under the Boost license. 4 * 5 * Pixel Perfect Engine, exceptions 6 */ 7 8 /* 9 * NOTE: Rework exception system with local classes where they will be thrown from. 10 */ 11 /** 12 * Base class for all exception thrown by this library. 13 */ 14 public class PPEException : Exception { 15 /// 16 @nogc @safe pure nothrow this(string msg, string file = __FILE__, size_t line = __LINE__, Throwable nextInChain = null) 17 { 18 super(msg, file, line, nextInChain); 19 } 20 /// 21 @nogc @safe pure nothrow this(string msg, Throwable nextInChain, string file = __FILE__, size_t line = __LINE__) 22 { 23 super(msg, file, line, nextInChain); 24 } 25 } 26 27 public class AudioInitializationException : Exception{ 28 public this(string msg, string file = __FILE__, size_t line = __LINE__, Throwable next = null) { 29 super(msg, file, line, next); 30 } 31 32 } 33 34 public class GraphicsInitializationException : Exception{ 35 public this(string msg, string file = __FILE__, size_t line = __LINE__, Throwable next = null) { 36 super(msg, file, line, next); 37 } 38 39 } 40 41 public class VideoModeException : Exception{ 42 public this(string msg, string file = __FILE__, size_t line = __LINE__, Throwable next = null) { 43 super(msg, file, line, next); 44 } 45 46 } 47 48 //public class VideoException 49 50 public class FileAccessException : Exception{ 51 public this(string msg, string file = __FILE__, size_t line = __LINE__, Throwable next = null) @safe pure @nogc { 52 super(msg, file, line, next); 53 } 54 55 } 56 57 public class TileFormatException : PPEException { 58 public this(string msg, string file = __FILE__, size_t line = __LINE__, Throwable next = null) @safe pure @nogc { 59 super(msg, file, line, next); 60 } 61 62 } 63 64 public class BitmapFormatException : Exception{ 65 public this(string msg, string file = __FILE__, size_t line = __LINE__, Throwable next = null) @safe pure @nogc { 66 super(msg, file, line, next); 67 } 68 } 69 70 public class ConfigFileException : Exception{ 71 public this(string msg, string file = __FILE__, size_t line = __LINE__, Throwable next = null) @safe pure @nogc { 72 super(msg, file, line, next); 73 } 74 } 75 76 public class MapFileException : PPEException { 77 public this(string msg, string file = __FILE__, size_t line = __LINE__, Throwable next = null) @safe pure @nogc { 78 super(msg, file, line, next); 79 } 80 } 81 82 public class MapFormatException : PPEException { 83 public this(string msg, string file = __FILE__, size_t line = __LINE__, Throwable next = null) @safe pure @nogc { 84 super(msg, file, line, next); 85 } 86 } 87 88 public class SpriteLayerException : Exception{ 89 public this(string msg, string file = __FILE__, size_t line = __LINE__, Throwable next = null) @safe pure @nogc { 90 super(msg, file, line, next); 91 } 92 } 93 94 public class SpritePriorityException : SpriteLayerException{ 95 public this(string msg, string file = __FILE__, size_t line = __LINE__, Throwable next = null) @safe pure @nogc { 96 super(msg, file, line, next); 97 } 98 }