diff --git a/src/as/com/threerings/io/Translations.as b/src/as/com/threerings/io/Translations.as index 9ae1a0762..c03daaeae 100644 --- a/src/as/com/threerings/io/Translations.as +++ b/src/as/com/threerings/io/Translations.as @@ -35,5 +35,6 @@ public class Translations // initialize some standard classes addTranslation("Object", "java.lang.Object"); + addTranslation("com.threerings.util.langBoolean", "java.lang.Boolean"); } } diff --git a/src/as/com/threerings/util/langBoolean.as b/src/as/com/threerings/util/langBoolean.as new file mode 100644 index 000000000..87d4138ed --- /dev/null +++ b/src/as/com/threerings/util/langBoolean.as @@ -0,0 +1,44 @@ +package com.threerings.util { + +import com.threerings.io.ObjectInputStream; +import com.threerings.io.ObjectOutputStream; +import com.threerings.io.Streamable; + +/** + * Equivalent to java.lang.Boolean. + */ +public class langBoolean + implements Equalable, Streamable +{ + public var value :Boolean; + + public static function valueOf (val :Boolean) :langBoolean + { + return new langBoolean(val); + } + + public function langBoolean (value :Boolean = false) + { + this.value = value; + } + + // from Equalable + public function equals (other :Object) :Boolean + { + return (other is langBoolean) && + (value === (other as langBoolean).value); + } + + // from Streamable + public function writeObject (out :ObjectOutputStream) :void + { + out.writeBoolean(value); + } + + // from Streamable + public function readObject (ins :ObjectInputStream) :void + { + value = ins.readBoolean(); + } +} +}