From aeb75789cdcb8f3647b9aad0c506c5233343b8f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Galland?= Date: Mon, 30 Sep 2019 17:25:39 +0800 Subject: [PATCH] [lang] Add setInternalSkill into SREutils. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Stéphane Galland --- .../src/io/sarl/lang/core/SREutils.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/main/coreplugins/io.sarl.lang.core/src/io/sarl/lang/core/SREutils.java b/main/coreplugins/io.sarl.lang.core/src/io/sarl/lang/core/SREutils.java index f14c883666..7bf5ad2381 100644 --- a/main/coreplugins/io.sarl.lang.core/src/io/sarl/lang/core/SREutils.java +++ b/main/coreplugins/io.sarl.lang.core/src/io/sarl/lang/core/SREutils.java @@ -127,6 +127,19 @@ public static S castInternalSkillReference(Agent agent, return agent.$castSkill(type, reference); } + /** Set the internal skill of an agent. + * + * @param agent the agent. + * @param skill the skill instance to attach to the agent. + * @param capacities the list of implemented capacities. This array cannot be {@code null}. + * @return the reference to the skill. + * @since 0.10 + */ + public static ClearableReference setInternalSkill(Agent agent, Skill skill, Class[] capacities) { + assert capacities != null; + return agent.$setSkill(skill, capacities); + } + /** Replies the internal skill of an agent. * * @param the type of the capacity.