Skip to content

Commit

Permalink
refactor(agents): Add defaultAgentMeta and tsdocs to InstanceAgentsImpl
Browse files Browse the repository at this point in the history
  • Loading branch information
jcowman2 committed Sep 3, 2019
1 parent 59ce4ed commit 09554ce
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/agents/impl/instance-agents-impl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import {
} from "./active-agent-proxy";
import { STATIC_AGENT_PK_PROVIDER } from "./agent-keys";
import { buildAgentManager } from "./agent-manager-impl";
import { agentMetaWithID } from "./agent-meta-transformers";
import { agentMetaWithID, defaultAgentMeta } from "./agent-meta-transformers";
import {
getGameInstancePK,
isAgentActive,
Expand Down Expand Up @@ -54,6 +54,8 @@ export const buildInstanceAgents = (
class InstanceAgentsImpl implements InstanceAgentsInternal {
/** The internal `Agent` `PKProvider`. */
private _pkProvider: PKProvider<Agent>;

/** The internal `PrototypeRegistry` for non-static agents. */
private _prototypeRegistry: PrototypeRegistry;

constructor(
Expand Down Expand Up @@ -209,7 +211,7 @@ class InstanceAgentsImpl implements InstanceAgentsInternal {
: new AgentReference(value.meta.id);
} else if (value instanceof Array) {
(value as any).meta = agentMetaWithID(this.reserveNewId())(
{} as any // TODO - make meta for array
defaultAgentMeta()
);
value = this.game.using(value);
value = new AgentArrayReference(value.meta.id);
Expand Down

0 comments on commit 09554ce

Please sign in to comment.