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:
src/as/com/threerings/util/env/Environment.as-fp → src/player/com/threerings/util/env/Environment.as
Vendored
+13
-4
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user