Stop switching different source files into Environment.as's place. Instead build tiny swc's with the player-specific Environment.as and the thane-specific one. Then compile naryalib.swc with one of these tiny swc's as an external library. When we compile the final executables we'll do a inclusive linking to get the right implementation into place.

git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5182 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Par Winzell
2008-06-13 03:39:26 +00:00
parent cfee03318b
commit b88cee2be7
5 changed files with 417 additions and 48 deletions
@@ -22,8 +22,7 @@
package com.threerings.util.env {
import flash.utils.describeType;
import com.threerings.util.ClassUtil;
import flash.utils.getDefinitionByName;
/**
* Flash Player specific implementation of Environment.
@@ -69,7 +68,7 @@ public class Environment
var exts :XMLList = typeInfo.child("extendsClass").attribute("type");
var type :String;
for each (type in exts) {
if (asClass == ClassUtil.getClassByName(type)) {
if (asClass == getClassByName(type)) {
return true;
}
}
@@ -78,12 +77,22 @@ public class Environment
var imps :XMLList = typeInfo.child("implementsInterface")
.attribute("type");
for each (type in imps) {
if (asClass == ClassUtil.getClassByName(type)) {
if (asClass == getClassByName(type)) {
return true;
}
}
return false;
}
private static function getClassByName (cname :String) :Class
{
try {
return (getDefinitionByName(cname.replace("::", ".")) as Class);
} catch (error :ReferenceError) { }
return null;
}
}
}