Mercurial > projects > mde
diff mde/input/Config.d @ 74:cee261eba249
Minor tweaks.
author | Diggory Hardy <diggory.hardy@gmail.com> |
---|---|
date | Mon, 07 Jul 2008 15:54:47 +0100 |
parents | 7fc0a8295c83 |
children | 61ea26abe4dd |
line wrap: on
line diff
--- a/mde/input/Config.d Mon Jul 07 15:53:58 2008 +0100 +++ b/mde/input/Config.d Mon Jul 07 15:54:47 2008 +0100 @@ -141,10 +141,8 @@ file.dataSecCreator = delegate MT.IDataSection (MT.ID) { return new Config; }; - // D2.0: enum MT.ID CONFIGS = "Configs"; - const MT.ID CONFIGS = cast(MT.ID)"Configs"; // Restrict config sections if this tag exists: - auto file_configs_p = CONFIGS in file.dataset.header._charAA; + auto file_configs_p = cast(MT.ID)"Configs" in file.dataset.header._charAA; MT.ID[] file_configs = null; if (file_configs_p) { file_configs = cast(MT.ID[]) *file_configs_p; @@ -178,17 +176,13 @@ } } - // D2.0: private enum QUEUE : MT.ID { BUTTON = "B", AXIS = "A", MOUSE = "M" } - private struct QUEUE { - static const MT.ID BUTTON = cast(MT.ID)"B", AXIS = cast(MT.ID)"A", MOUSE = cast(MT.ID)"M"; - } private this() {} // Private since this class should only be created from here. void addTag (char[] tp, MT.ID id, char[] dt) { if (tp == "uint[][uint]") { - if (id == QUEUE.BUTTON) button = cast(outQueue[][uint]) parseTo!(uint[][][uint]) (dt); - else if (id == QUEUE.AXIS) axis = cast(outQueue[][uint]) parseTo!(uint[][][uint]) (dt); - else if (id == QUEUE.MOUSE) relMotion = cast(outQueue[][uint]) parseTo!(uint[][][uint]) (dt); + if (id == "B") button = cast(outQueue[][uint]) parseTo!(uint[][][uint]) (dt); + else if (id == "A") axis = cast(outQueue[][uint]) parseTo!(uint[][][uint]) (dt); + else if (id == "M") relMotion = cast(outQueue[][uint]) parseTo!(uint[][][uint]) (dt); else logger.warn ("Unexpected tag encountered with ID " ~ cast(char[])id); } // FIXME: add support for name and inheritants. }