added inspect to perf
This commit is contained in:
parent
fd2b53167e
commit
d0c01800a6
@ -54,6 +54,25 @@ class Peripheral {
|
|||||||
return addr;
|
return addr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function inspect(addr: String): Null<{ types: Array<String>, methods: Array<String>}> {
|
||||||
|
if (!isPresent(addr)) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
var types = getTypes(addr);
|
||||||
|
var methodsMap = cc.Peripheral.getMethods(addr).toArray();
|
||||||
|
var methods: Array<String> = [];
|
||||||
|
|
||||||
|
for (method in methodsMap) {
|
||||||
|
methods.push(method);
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
types: types,
|
||||||
|
methods: methods
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
public function getScreen(addr: String): Null<Screen> {
|
public function getScreen(addr: String): Null<Screen> {
|
||||||
var addr = safeGetAddr(addr, Screen.TYPE_NAME);
|
var addr = safeGetAddr(addr, Screen.TYPE_NAME);
|
||||||
if (addr == null) return null;
|
if (addr == null) return null;
|
||||||
|
Loading…
Reference in New Issue
Block a user