diff --git a/src/.idea/.gitignore b/src/.idea/.gitignore new file mode 100644 index 0000000..ab1f416 --- /dev/null +++ b/src/.idea/.gitignore @@ -0,0 +1,10 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Ignored default folder with query files +/queries/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml +# Editor-based HTTP Client requests +/httpRequests/ diff --git a/src/.idea/material_theme_project_new.xml b/src/.idea/material_theme_project_new.xml new file mode 100644 index 0000000..19eb1b3 --- /dev/null +++ b/src/.idea/material_theme_project_new.xml @@ -0,0 +1,12 @@ + + + + + + \ No newline at end of file diff --git a/src/.idea/misc.xml b/src/.idea/misc.xml new file mode 100644 index 0000000..188022c --- /dev/null +++ b/src/.idea/misc.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/src/.idea/vcs.xml b/src/.idea/vcs.xml new file mode 100644 index 0000000..6c0b863 --- /dev/null +++ b/src/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/src/one/digitalinnovation/gof/strategy/ComportamentoFactory.java b/src/one/digitalinnovation/gof/strategy/ComportamentoFactory.java new file mode 100644 index 0000000..27c7ec0 --- /dev/null +++ b/src/one/digitalinnovation/gof/strategy/ComportamentoFactory.java @@ -0,0 +1,12 @@ +package one.digitalinnovation.gof.strategy; + +public class ComportamentoFactory { + + public static Comportamento criar(String tipo) { + return switch (tipo.toLowerCase()) { + case "agressivo" -> new ComportamentoAgressivo(); + case "defensivo" -> new ComportamentoDefensivo(); + default -> new ComportamentoNormal(); + }; + } +} \ No newline at end of file