public static void AddInstanceName(string instance, string className, string displayName, string desc) { InstanceName_t instanceName = new InstanceName_t(); Debug.Check(!string.IsNullOrEmpty(instance)); Debug.Check(!string.IsNullOrEmpty(className)); instanceName.name_ = instance; instanceName.className_ = className; instanceName.displayName_ = displayName; instanceName.desc_ = desc; _instanceNamesDict[instance] = instanceName; }
public static List<InstanceName_t> GetLocalInstanceNames(Behavior behavior) { List<InstanceName_t> instanceNames = new List<InstanceName_t>(); if (behavior != null && behavior.AgentType != null) { foreach (PropertyDef prop in behavior.AgentType.GetProperties()) { if (Plugin.IsDerived(prop.Type, typeof(Agent))) { InstanceName_t instanceName = new InstanceName_t(); instanceName.name_ = prop.BasicName; instanceName.className_ = prop.AgentType.AgentTypeName; instanceName.agentType_ = Plugin.GetAgentType(prop.Type); instanceName.displayName_ = prop.DisplayName; instanceName.desc_ = prop.BasicDescription; instanceNames.Add(instanceName); } } } return instanceNames; }