getId
getId: (ObjectComposition) -> numberThe loc id.
client:getObjectDefinition(…)| Method | Returns | Description |
|---|---|---|
getId() | number | The loc id. |
getName() | string | Its name ("null" for an unnamed loc, as the cache stores it). |
getActions() | { n: number, [number]: string? } | Its five menu actions, nil where there is none. Holes are nil and the array carries n, its length: walk it for i = 1, actions.n. `t… |
getOps() | EntityOps | Its menu ops: getActions()'s, each as the menu shows it now (an op with a conditional text answers that text while its varbit or varp is… |
getImpostorIds() | {number}? | The loc ids it can turn into, or nil when it is not a multiloc. |
getImpostor() | ObjectComposition? | The loc it is now, chosen by its varbit (or varp) as the client chooses it, or nil (not a multiloc, or the choice is -1). |
getVarbitId() | number | The varbit that chooses the impostor, or -1. |
getVarPlayerId() | number | The varp that chooses the impostor, or -1. |
getSizeX() | number | Its width in tiles, unrotated. |
getSizeY() | number | Its length in tiles, unrotated. |
equals(any) | boolean | Whether other equals this ObjectComposition, as == answers it (false for a value of another class). |
| Method | Returns | Description |
|---|---|---|
Client.getObjectDefinition | ObjectComposition | Loc type id's definition. |
getIdgetId: (ObjectComposition) -> numberThe loc id.
getNamegetName: (ObjectComposition) -> stringIts name ("null" for an unnamed loc, as the cache stores it).
getActionsgetActions: (ObjectComposition) -> { n: number, [number]: string? }Its five menu actions, nil where there is none. Holes are nil and the array carries n, its length: walk it for i = 1, actions.n. table.find stops at the first hole, so search it with your own contains(actions, x) that walks to n.
getOpsgetOps: (ObjectComposition) -> EntityOpsIts menu ops: getActions()'s, each as the menu shows it now (an op with a conditional text answers that text while its varbit or varp is in range), and the sub-ops under each (getSubOps). Raises on a build whose op layout is not matched (EntityOps).
getImpostorIdsgetImpostorIds: (ObjectComposition) -> {number}?The loc ids it can turn into, or nil when it is not a multiloc.
getImpostorgetImpostor: (ObjectComposition) -> ObjectComposition?The loc it is now, chosen by its varbit (or varp) as the client chooses it, or nil (not a multiloc, or the choice is -1).
getVarbitIdgetVarbitId: (ObjectComposition) -> numberThe varbit that chooses the impostor, or -1.
getVarPlayerIdgetVarPlayerId: (ObjectComposition) -> numberThe varp that chooses the impostor, or -1.
getSizeXgetSizeX: (ObjectComposition) -> numberIts width in tiles, unrotated.
getSizeYgetSizeY: (ObjectComposition) -> numberIts length in tiles, unrotated.
equalsequals: (ObjectComposition, any) -> booleanWhether other equals this ObjectComposition, as == answers it (false for a value of another class).