diff mde/content/miscContent.d @ 137:9f035cd139c6

BIG commit. Major change: old Options class is gone, all content values are loaded and saved automatically. All options updated to reflect this, some changed. Content restrutured a lot: New IContent module, Content module includes more functionality. New ContentLoader module to manage content loading/saving/translation. Translation module moved to content dir and cut down to reflect current usage. File format unchanged except renames: FontOptions -> Font, VideoOptions -> Screen. Font render mode and LCD filter options are now enums. GUI loading needs to create content (and set type for enums), but doesn't save/load value. Some setup of mainSchedule moved to mde.mainLoop. Content callbacks are called on content change now. ContentLists are set up implicitly from content symbols. Not as fast but much easier! Bug-fix in the new MTTagReader. Renamed MT *Reader maker functions to avoid confusion in paths.d. New mde.setup.logger module to allow logger setup before any other module's static this().
author Diggory Hardy <diggory.hardy@gmail.com>
date Sat, 07 Feb 2009 12:46:03 +0000
parents 9cff74f68b84
children 620d4ea30228
line wrap: on
line diff
--- a/mde/content/miscContent.d	Sun Feb 01 12:36:21 2009 +0000
+++ b/mde/content/miscContent.d	Sat Feb 07 12:46:03 2009 +0000
@@ -20,64 +20,13 @@
 
 public import mde.content.Content;
 
+/+
     import tango.util.log.Log : Log, Logger;
     private Logger logger;
     static this () {
         logger = Log.getLogger ("mde.content.miscContent");
     }
-
-/** A generic way to handle a list of type IContent. */
-class ContentList : Content, IContentList
-{
-    this (char[] symbol, Content[] list = null) {
-	list_ = list;
-	super (symbol);
-    }
-    this (char[] symbol, Content[char[]] l) {
-	list_.length = l.length;
-	size_t i;
-	foreach (c; l)
-	    list_[i++] = c;
-	super (symbol);
-    }
-    
-    override Content[] list () {
-	return list_;
-    }
-    
-    ContentList append (Content x) {
-        size_t l = list_.length;
-        list_.length = l + 1;
-        list_[l] = x;
-        return this;
-    }
-    ContentList append (Content[] x) {
-        list_ ~= x;
-        return this;
-    }
-    
-protected:
-    final Content[] list_;
-}
-
-/** Created on errors to display and log a message. */
-class ErrorContent : Content
-{
-    this (char[] name, char[] msg) {
-	super (name);
-        this.msg = msg;
-        logger.error (name ~ ": " ~ msg);
-    }
-    
-    override char[] toString (uint i) {
-	return i == 0 ? msg
-	     : i == 1 ? name_
-	     : null;
-    }
-    
-protected:
-    char[] msg;
-}
++/
 
 /** A Content with no value but able to pass on an event.
 *