diff --git a/.idea/codeStyles/codeStyleConfig.xml b/.idea/codeStyles/codeStyleConfig.xml deleted file mode 100644 index 79ee123..0000000 --- a/.idea/codeStyles/codeStyleConfig.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - \ No newline at end of file diff --git a/.idea/compiler.xml b/.idea/compiler.xml deleted file mode 100644 index 750d86b..0000000 --- a/.idea/compiler.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Maven__aopalliance_aopalliance_1_0.xml b/.idea/libraries/Maven__aopalliance_aopalliance_1_0.xml deleted file mode 100644 index 30ff5cb..0000000 --- a/.idea/libraries/Maven__aopalliance_aopalliance_1_0.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Maven__ch_qos_logback_logback_classic_1_1_2.xml b/.idea/libraries/Maven__ch_qos_logback_logback_classic_1_1_2.xml deleted file mode 100644 index a8b0d9c..0000000 --- a/.idea/libraries/Maven__ch_qos_logback_logback_classic_1_1_2.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Maven__ch_qos_logback_logback_core_1_1_2.xml b/.idea/libraries/Maven__ch_qos_logback_logback_core_1_1_2.xml deleted file mode 100644 index 1c76d0b..0000000 --- a/.idea/libraries/Maven__ch_qos_logback_logback_core_1_1_2.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Maven__com_codahale_metrics_metrics_annotation_3_0_2.xml b/.idea/libraries/Maven__com_codahale_metrics_metrics_annotation_3_0_2.xml deleted file mode 100644 index b871e8c..0000000 --- a/.idea/libraries/Maven__com_codahale_metrics_metrics_annotation_3_0_2.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Maven__com_codahale_metrics_metrics_core_3_0_2.xml b/.idea/libraries/Maven__com_codahale_metrics_metrics_core_3_0_2.xml deleted file mode 100644 index 2564235..0000000 --- a/.idea/libraries/Maven__com_codahale_metrics_metrics_core_3_0_2.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Maven__com_codahale_metrics_metrics_healthchecks_3_0_2.xml b/.idea/libraries/Maven__com_codahale_metrics_metrics_healthchecks_3_0_2.xml deleted file mode 100644 index a495932..0000000 --- a/.idea/libraries/Maven__com_codahale_metrics_metrics_healthchecks_3_0_2.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Maven__com_codahale_metrics_metrics_jersey_3_0_2.xml b/.idea/libraries/Maven__com_codahale_metrics_metrics_jersey_3_0_2.xml deleted file mode 100644 index 9297d44..0000000 --- a/.idea/libraries/Maven__com_codahale_metrics_metrics_jersey_3_0_2.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Maven__com_codahale_metrics_metrics_jetty9_3_0_2.xml b/.idea/libraries/Maven__com_codahale_metrics_metrics_jetty9_3_0_2.xml deleted file mode 100644 index ccffc7c..0000000 --- a/.idea/libraries/Maven__com_codahale_metrics_metrics_jetty9_3_0_2.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Maven__com_codahale_metrics_metrics_json_3_0_2.xml b/.idea/libraries/Maven__com_codahale_metrics_metrics_json_3_0_2.xml deleted file mode 100644 index 01af1b0..0000000 --- a/.idea/libraries/Maven__com_codahale_metrics_metrics_json_3_0_2.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Maven__com_codahale_metrics_metrics_jvm_3_0_2.xml b/.idea/libraries/Maven__com_codahale_metrics_metrics_jvm_3_0_2.xml deleted file mode 100644 index 556b4b7..0000000 --- a/.idea/libraries/Maven__com_codahale_metrics_metrics_jvm_3_0_2.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Maven__com_codahale_metrics_metrics_logback_3_0_2.xml b/.idea/libraries/Maven__com_codahale_metrics_metrics_logback_3_0_2.xml deleted file mode 100644 index fe4df91..0000000 --- a/.idea/libraries/Maven__com_codahale_metrics_metrics_logback_3_0_2.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Maven__com_codahale_metrics_metrics_servlets_3_0_2.xml b/.idea/libraries/Maven__com_codahale_metrics_metrics_servlets_3_0_2.xml deleted file mode 100644 index a189759..0000000 --- a/.idea/libraries/Maven__com_codahale_metrics_metrics_servlets_3_0_2.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Maven__com_fasterxml_classmate_1_0_0.xml b/.idea/libraries/Maven__com_fasterxml_classmate_1_0_0.xml deleted file mode 100644 index c693e24..0000000 --- a/.idea/libraries/Maven__com_fasterxml_classmate_1_0_0.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Maven__com_fasterxml_jackson_core_jackson_core_2_8_8.xml b/.idea/libraries/Maven__com_fasterxml_jackson_core_jackson_core_2_8_8.xml deleted file mode 100644 index dc8e04d..0000000 --- a/.idea/libraries/Maven__com_fasterxml_jackson_core_jackson_core_2_8_8.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Maven__com_fasterxml_jackson_core_jackson_databind_2_8_8.xml b/.idea/libraries/Maven__com_fasterxml_jackson_core_jackson_databind_2_8_8.xml deleted file mode 100644 index 247589e..0000000 --- a/.idea/libraries/Maven__com_fasterxml_jackson_core_jackson_databind_2_8_8.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Maven__com_fasterxml_jackson_datatype_jackson_datatype_guava_2_3_3.xml b/.idea/libraries/Maven__com_fasterxml_jackson_datatype_jackson_datatype_guava_2_3_3.xml deleted file mode 100644 index ae967a5..0000000 --- a/.idea/libraries/Maven__com_fasterxml_jackson_datatype_jackson_datatype_guava_2_3_3.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Maven__com_fasterxml_jackson_datatype_jackson_datatype_joda_2_3_3.xml b/.idea/libraries/Maven__com_fasterxml_jackson_datatype_jackson_datatype_joda_2_3_3.xml deleted file mode 100644 index d5aaa16..0000000 --- a/.idea/libraries/Maven__com_fasterxml_jackson_datatype_jackson_datatype_joda_2_3_3.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Maven__com_fasterxml_jackson_jaxrs_jackson_jaxrs_base_2_3_3.xml b/.idea/libraries/Maven__com_fasterxml_jackson_jaxrs_jackson_jaxrs_base_2_3_3.xml deleted file mode 100644 index 926c37b..0000000 --- a/.idea/libraries/Maven__com_fasterxml_jackson_jaxrs_jackson_jaxrs_base_2_3_3.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Maven__com_fasterxml_jackson_jaxrs_jackson_jaxrs_json_provider_2_3_3.xml b/.idea/libraries/Maven__com_fasterxml_jackson_jaxrs_jackson_jaxrs_json_provider_2_3_3.xml deleted file mode 100644 index d8b05f2..0000000 --- a/.idea/libraries/Maven__com_fasterxml_jackson_jaxrs_jackson_jaxrs_json_provider_2_3_3.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Maven__com_fasterxml_jackson_module_jackson_module_afterburner_2_3_3.xml b/.idea/libraries/Maven__com_fasterxml_jackson_module_jackson_module_afterburner_2_3_3.xml deleted file mode 100644 index 62a1c61..0000000 --- a/.idea/libraries/Maven__com_fasterxml_jackson_module_jackson_module_afterburner_2_3_3.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Maven__com_fasterxml_jackson_module_jackson_module_jaxb_annotations_2_3_3.xml b/.idea/libraries/Maven__com_fasterxml_jackson_module_jackson_module_jaxb_annotations_2_3_3.xml deleted file mode 100644 index 8a8e4a2..0000000 --- a/.idea/libraries/Maven__com_fasterxml_jackson_module_jackson_module_jaxb_annotations_2_3_3.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Maven__com_google_code_findbugs_jsr305_2_0_3.xml b/.idea/libraries/Maven__com_google_code_findbugs_jsr305_2_0_3.xml deleted file mode 100644 index 61b0f4b..0000000 --- a/.idea/libraries/Maven__com_google_code_findbugs_jsr305_2_0_3.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Maven__com_google_guava_guava_17_0.xml b/.idea/libraries/Maven__com_google_guava_guava_17_0.xml deleted file mode 100644 index 2a9069c..0000000 --- a/.idea/libraries/Maven__com_google_guava_guava_17_0.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Maven__com_google_inject_extensions_guice_servlet_3_0.xml b/.idea/libraries/Maven__com_google_inject_extensions_guice_servlet_3_0.xml deleted file mode 100644 index f8024fe..0000000 --- a/.idea/libraries/Maven__com_google_inject_extensions_guice_servlet_3_0.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Maven__com_google_inject_guice_3_0.xml b/.idea/libraries/Maven__com_google_inject_guice_3_0.xml deleted file mode 100644 index b5a7a25..0000000 --- a/.idea/libraries/Maven__com_google_inject_guice_3_0.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Maven__com_hubspot_dropwizard_dropwizard_guice_0_7_0_2.xml b/.idea/libraries/Maven__com_hubspot_dropwizard_dropwizard_guice_0_7_0_2.xml deleted file mode 100644 index b2c121b..0000000 --- a/.idea/libraries/Maven__com_hubspot_dropwizard_dropwizard_guice_0_7_0_2.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Maven__com_sun_jersey_contribs_jersey_guice_1_18_1.xml b/.idea/libraries/Maven__com_sun_jersey_contribs_jersey_guice_1_18_1.xml deleted file mode 100644 index 542bb25..0000000 --- a/.idea/libraries/Maven__com_sun_jersey_contribs_jersey_guice_1_18_1.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Maven__com_sun_jersey_jersey_core_1_18_1.xml b/.idea/libraries/Maven__com_sun_jersey_jersey_core_1_18_1.xml deleted file mode 100644 index f8602c3..0000000 --- a/.idea/libraries/Maven__com_sun_jersey_jersey_core_1_18_1.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Maven__com_sun_jersey_jersey_server_1_18_1.xml b/.idea/libraries/Maven__com_sun_jersey_jersey_server_1_18_1.xml deleted file mode 100644 index d172f33..0000000 --- a/.idea/libraries/Maven__com_sun_jersey_jersey_server_1_18_1.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Maven__com_sun_jersey_jersey_servlet_1_18_1.xml b/.idea/libraries/Maven__com_sun_jersey_jersey_servlet_1_18_1.xml deleted file mode 100644 index 52607e5..0000000 --- a/.idea/libraries/Maven__com_sun_jersey_jersey_servlet_1_18_1.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Maven__commons_lang_commons_lang_2_6.xml b/.idea/libraries/Maven__commons_lang_commons_lang_2_6.xml deleted file mode 100644 index 2ec8376..0000000 --- a/.idea/libraries/Maven__commons_lang_commons_lang_2_6.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Maven__dom4j_dom4j_1_6_1.xml b/.idea/libraries/Maven__dom4j_dom4j_1_6_1.xml deleted file mode 100644 index 14681ee..0000000 --- a/.idea/libraries/Maven__dom4j_dom4j_1_6_1.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Maven__io_dropwizard_dropwizard_assets_0_7_1.xml b/.idea/libraries/Maven__io_dropwizard_dropwizard_assets_0_7_1.xml deleted file mode 100644 index 0f87558..0000000 --- a/.idea/libraries/Maven__io_dropwizard_dropwizard_assets_0_7_1.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Maven__io_dropwizard_dropwizard_configuration_0_7_1.xml b/.idea/libraries/Maven__io_dropwizard_dropwizard_configuration_0_7_1.xml deleted file mode 100644 index acde5c9..0000000 --- a/.idea/libraries/Maven__io_dropwizard_dropwizard_configuration_0_7_1.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Maven__io_dropwizard_dropwizard_core_0_7_1.xml b/.idea/libraries/Maven__io_dropwizard_dropwizard_core_0_7_1.xml deleted file mode 100644 index a965106..0000000 --- a/.idea/libraries/Maven__io_dropwizard_dropwizard_core_0_7_1.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Maven__io_dropwizard_dropwizard_jackson_0_7_1.xml b/.idea/libraries/Maven__io_dropwizard_dropwizard_jackson_0_7_1.xml deleted file mode 100644 index 983ff8a..0000000 --- a/.idea/libraries/Maven__io_dropwizard_dropwizard_jackson_0_7_1.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Maven__io_dropwizard_dropwizard_jersey_0_7_1.xml b/.idea/libraries/Maven__io_dropwizard_dropwizard_jersey_0_7_1.xml deleted file mode 100644 index 4f4e64d..0000000 --- a/.idea/libraries/Maven__io_dropwizard_dropwizard_jersey_0_7_1.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Maven__io_dropwizard_dropwizard_jetty_0_7_1.xml b/.idea/libraries/Maven__io_dropwizard_dropwizard_jetty_0_7_1.xml deleted file mode 100644 index f785279..0000000 --- a/.idea/libraries/Maven__io_dropwizard_dropwizard_jetty_0_7_1.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Maven__io_dropwizard_dropwizard_lifecycle_0_7_1.xml b/.idea/libraries/Maven__io_dropwizard_dropwizard_lifecycle_0_7_1.xml deleted file mode 100644 index 0388dba..0000000 --- a/.idea/libraries/Maven__io_dropwizard_dropwizard_lifecycle_0_7_1.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Maven__io_dropwizard_dropwizard_logging_0_7_1.xml b/.idea/libraries/Maven__io_dropwizard_dropwizard_logging_0_7_1.xml deleted file mode 100644 index 3ea88dc..0000000 --- a/.idea/libraries/Maven__io_dropwizard_dropwizard_logging_0_7_1.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Maven__io_dropwizard_dropwizard_metrics_0_7_1.xml b/.idea/libraries/Maven__io_dropwizard_dropwizard_metrics_0_7_1.xml deleted file mode 100644 index 22d26ae..0000000 --- a/.idea/libraries/Maven__io_dropwizard_dropwizard_metrics_0_7_1.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Maven__io_dropwizard_dropwizard_servlets_0_7_1.xml b/.idea/libraries/Maven__io_dropwizard_dropwizard_servlets_0_7_1.xml deleted file mode 100644 index 21fead8..0000000 --- a/.idea/libraries/Maven__io_dropwizard_dropwizard_servlets_0_7_1.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Maven__io_dropwizard_dropwizard_util_0_7_1.xml b/.idea/libraries/Maven__io_dropwizard_dropwizard_util_0_7_1.xml deleted file mode 100644 index f6a6302..0000000 --- a/.idea/libraries/Maven__io_dropwizard_dropwizard_util_0_7_1.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Maven__io_dropwizard_dropwizard_validation_0_7_1.xml b/.idea/libraries/Maven__io_dropwizard_dropwizard_validation_0_7_1.xml deleted file mode 100644 index c702d6f..0000000 --- a/.idea/libraries/Maven__io_dropwizard_dropwizard_validation_0_7_1.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Maven__javassist_javassist_3_12_1_GA.xml b/.idea/libraries/Maven__javassist_javassist_3_12_1_GA.xml deleted file mode 100644 index e5be13e..0000000 --- a/.idea/libraries/Maven__javassist_javassist_3_12_1_GA.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Maven__javax_el_javax_el_api_2_2_5.xml b/.idea/libraries/Maven__javax_el_javax_el_api_2_2_5.xml deleted file mode 100644 index e49cc63..0000000 --- a/.idea/libraries/Maven__javax_el_javax_el_api_2_2_5.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Maven__javax_inject_javax_inject_1.xml b/.idea/libraries/Maven__javax_inject_javax_inject_1.xml deleted file mode 100644 index 93cf65a..0000000 --- a/.idea/libraries/Maven__javax_inject_javax_inject_1.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Maven__javax_validation_validation_api_1_1_0_Final.xml b/.idea/libraries/Maven__javax_validation_validation_api_1_1_0_Final.xml deleted file mode 100644 index 940ce73..0000000 --- a/.idea/libraries/Maven__javax_validation_validation_api_1_1_0_Final.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Maven__javax_ws_rs_jsr311_api_1_1_1.xml b/.idea/libraries/Maven__javax_ws_rs_jsr311_api_1_1_1.xml deleted file mode 100644 index a0c4d76..0000000 --- a/.idea/libraries/Maven__javax_ws_rs_jsr311_api_1_1_1.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Maven__junit_junit_4_13_beta_3.xml b/.idea/libraries/Maven__junit_junit_4_13_beta_3.xml deleted file mode 100644 index d0c720f..0000000 --- a/.idea/libraries/Maven__junit_junit_4_13_beta_3.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Maven__net_sourceforge_argparse4j_argparse4j_0_4_3.xml b/.idea/libraries/Maven__net_sourceforge_argparse4j_argparse4j_0_4_3.xml deleted file mode 100644 index b8e4946..0000000 --- a/.idea/libraries/Maven__net_sourceforge_argparse4j_argparse4j_0_4_3.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Maven__org_eclipse_jetty_jetty_continuation_9_0_7_v20131107.xml b/.idea/libraries/Maven__org_eclipse_jetty_jetty_continuation_9_0_7_v20131107.xml deleted file mode 100644 index b8aa67d..0000000 --- a/.idea/libraries/Maven__org_eclipse_jetty_jetty_continuation_9_0_7_v20131107.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Maven__org_eclipse_jetty_jetty_http_9_0_7_v20131107.xml b/.idea/libraries/Maven__org_eclipse_jetty_jetty_http_9_0_7_v20131107.xml deleted file mode 100644 index d2c286f..0000000 --- a/.idea/libraries/Maven__org_eclipse_jetty_jetty_http_9_0_7_v20131107.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Maven__org_eclipse_jetty_jetty_io_9_0_7_v20131107.xml b/.idea/libraries/Maven__org_eclipse_jetty_jetty_io_9_0_7_v20131107.xml deleted file mode 100644 index 7c5bb3d..0000000 --- a/.idea/libraries/Maven__org_eclipse_jetty_jetty_io_9_0_7_v20131107.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Maven__org_eclipse_jetty_jetty_security_9_0_7_v20131107.xml b/.idea/libraries/Maven__org_eclipse_jetty_jetty_security_9_0_7_v20131107.xml deleted file mode 100644 index 933a612..0000000 --- a/.idea/libraries/Maven__org_eclipse_jetty_jetty_security_9_0_7_v20131107.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Maven__org_eclipse_jetty_jetty_server_9_0_7_v20131107.xml b/.idea/libraries/Maven__org_eclipse_jetty_jetty_server_9_0_7_v20131107.xml deleted file mode 100644 index 99192ba..0000000 --- a/.idea/libraries/Maven__org_eclipse_jetty_jetty_server_9_0_7_v20131107.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Maven__org_eclipse_jetty_jetty_servlet_9_0_7_v20131107.xml b/.idea/libraries/Maven__org_eclipse_jetty_jetty_servlet_9_0_7_v20131107.xml deleted file mode 100644 index 440a02a..0000000 --- a/.idea/libraries/Maven__org_eclipse_jetty_jetty_servlet_9_0_7_v20131107.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Maven__org_eclipse_jetty_jetty_servlets_9_0_7_v20131107.xml b/.idea/libraries/Maven__org_eclipse_jetty_jetty_servlets_9_0_7_v20131107.xml deleted file mode 100644 index ecc8014..0000000 --- a/.idea/libraries/Maven__org_eclipse_jetty_jetty_servlets_9_0_7_v20131107.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Maven__org_eclipse_jetty_jetty_util_9_0_7_v20131107.xml b/.idea/libraries/Maven__org_eclipse_jetty_jetty_util_9_0_7_v20131107.xml deleted file mode 100644 index 1783067..0000000 --- a/.idea/libraries/Maven__org_eclipse_jetty_jetty_util_9_0_7_v20131107.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Maven__org_eclipse_jetty_orbit_javax_servlet_3_0_0_v201112011016.xml b/.idea/libraries/Maven__org_eclipse_jetty_orbit_javax_servlet_3_0_0_v201112011016.xml deleted file mode 100644 index 7dc899a..0000000 --- a/.idea/libraries/Maven__org_eclipse_jetty_orbit_javax_servlet_3_0_0_v201112011016.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Maven__org_eclipse_jetty_toolchain_setuid_jetty_setuid_java_1_0_2.xml b/.idea/libraries/Maven__org_eclipse_jetty_toolchain_setuid_jetty_setuid_java_1_0_2.xml deleted file mode 100644 index b1b090b..0000000 --- a/.idea/libraries/Maven__org_eclipse_jetty_toolchain_setuid_jetty_setuid_java_1_0_2.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Maven__org_glassfish_web_javax_el_2_2_6.xml b/.idea/libraries/Maven__org_glassfish_web_javax_el_2_2_6.xml deleted file mode 100644 index b4a2f67..0000000 --- a/.idea/libraries/Maven__org_glassfish_web_javax_el_2_2_6.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Maven__org_hamcrest_hamcrest_core_1_3.xml b/.idea/libraries/Maven__org_hamcrest_hamcrest_core_1_3.xml deleted file mode 100644 index f58bbc1..0000000 --- a/.idea/libraries/Maven__org_hamcrest_hamcrest_core_1_3.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Maven__org_hibernate_hibernate_validator_5_1_1_Final.xml b/.idea/libraries/Maven__org_hibernate_hibernate_validator_5_1_1_Final.xml deleted file mode 100644 index d606865..0000000 --- a/.idea/libraries/Maven__org_hibernate_hibernate_validator_5_1_1_Final.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Maven__org_jboss_logging_jboss_logging_3_1_3_GA.xml b/.idea/libraries/Maven__org_jboss_logging_jboss_logging_3_1_3_GA.xml deleted file mode 100644 index 815ab4d..0000000 --- a/.idea/libraries/Maven__org_jboss_logging_jboss_logging_3_1_3_GA.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Maven__org_mockito_mockito_core_1_9_0.xml b/.idea/libraries/Maven__org_mockito_mockito_core_1_9_0.xml deleted file mode 100644 index 84cb2fc..0000000 --- a/.idea/libraries/Maven__org_mockito_mockito_core_1_9_0.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Maven__org_objenesis_objenesis_1_0.xml b/.idea/libraries/Maven__org_objenesis_objenesis_1_0.xml deleted file mode 100644 index c79fa27..0000000 --- a/.idea/libraries/Maven__org_objenesis_objenesis_1_0.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Maven__org_projectlombok_lombok_1_16_20.xml b/.idea/libraries/Maven__org_projectlombok_lombok_1_16_20.xml deleted file mode 100644 index bcbf2ac..0000000 --- a/.idea/libraries/Maven__org_projectlombok_lombok_1_16_20.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Maven__org_reflections_reflections_0_9_8.xml b/.idea/libraries/Maven__org_reflections_reflections_0_9_8.xml deleted file mode 100644 index 5b96f30..0000000 --- a/.idea/libraries/Maven__org_reflections_reflections_0_9_8.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Maven__org_slf4j_jcl_over_slf4j_1_7_6.xml b/.idea/libraries/Maven__org_slf4j_jcl_over_slf4j_1_7_6.xml deleted file mode 100644 index 5b6dace..0000000 --- a/.idea/libraries/Maven__org_slf4j_jcl_over_slf4j_1_7_6.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Maven__org_slf4j_jul_to_slf4j_1_7_6.xml b/.idea/libraries/Maven__org_slf4j_jul_to_slf4j_1_7_6.xml deleted file mode 100644 index 20a04c1..0000000 --- a/.idea/libraries/Maven__org_slf4j_jul_to_slf4j_1_7_6.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Maven__org_slf4j_log4j_over_slf4j_1_7_6.xml b/.idea/libraries/Maven__org_slf4j_log4j_over_slf4j_1_7_6.xml deleted file mode 100644 index f4f64e4..0000000 --- a/.idea/libraries/Maven__org_slf4j_log4j_over_slf4j_1_7_6.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Maven__xml_apis_xml_apis_1_0_b2.xml b/.idea/libraries/Maven__xml_apis_xml_apis_1_0_b2.xml deleted file mode 100644 index c36e717..0000000 --- a/.idea/libraries/Maven__xml_apis_xml_apis_1_0_b2.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml deleted file mode 100644 index a7df3cb..0000000 --- a/.idea/misc.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml deleted file mode 100644 index 35eb1dd..0000000 --- a/.idea/vcs.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/LICENSE b/LICENSE deleted file mode 100644 index 261eeb9..0000000 --- a/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/README.md b/README.md deleted file mode 100644 index 26b9cc8..0000000 --- a/README.md +++ /dev/null @@ -1,34 +0,0 @@ -# chess -This is a self playing game of chess. - - -A simple algorithm to decide which move to play * Define significance order for each piece * Check if opponent can kill any of your piece in his next move. * Move to save your piece in the order of significance specified * Kill opponents piece to in order of significance and check if your move is not exposing any of your more significant piece to your opponent * Make a random move - - - - -Algorithm to implement checkmate - - Get the Kings position - Check each of the opponents pieces - can they move to this position in a single step (including opponents king) - if it is true for any of the pieces then - - check by moving any of my pieces, can I protect the king - if yes - move that piece - else - check what all positions the king can move to - check if moving to all of these possible king's positions, the king would still be under attack from the opponent - if no - move the king to this safe position - if yes - that means there are no positions left where king can move to safely on its own. - Declare checkmate - - - - -A simple algorithm to decide which move to play - * Define significance order for each piece - * Check if opponent can kill any of your piece in his next move. - * Move to save your piece in the order of significance specified - * Kill opponents piece to in order of significance and check if your move is not exposing any of your more significant piece to your opponent - * Make a random move - - - diff --git a/pom.xml b/pom.xml deleted file mode 100644 index bae07c5..0000000 --- a/pom.xml +++ /dev/null @@ -1,108 +0,0 @@ - - - 4.0.0 - - likedriving - likedriving - 1.0-SNAPSHOT - - - - org.apache.maven.plugins - maven-compiler-plugin - - 8 - 8 - - - - - - - 6.7.0 - - - - - junit - junit - RELEASE - compile - - - - org.mockito - mockito-core - 1.9.0 - - - org.hamcrest - hamcrest-core - - - - - - org.projectlombok - lombok - 1.16.20 - - - - javax.validation - validation-api - 1.1.0.Final - - - - javax.ws.rs - jsr311-api - 1.1.1 - - - - javax.inject - javax.inject - 1 - - - - com.fasterxml.jackson.core - jackson-core - 2.8.8 - - - - com.fasterxml.jackson.core - jackson-databind - 2.8.8 - - - - io.dropwizard - dropwizard-core - 0.7.1 - - - - io.dropwizard - dropwizard-assets - 0.7.1 - - - - com.google.inject - guice - 3.0 - - - - com.hubspot.dropwizard - dropwizard-guice - 0.7.0.2 - - - - \ No newline at end of file diff --git a/src/main/java/com/example/generated/PlayerMovement.java b/src/main/java/com/example/generated/PlayerMovement.java new file mode 100644 index 0000000..98ebacc --- /dev/null +++ b/src/main/java/com/example/generated/PlayerMovement.java @@ -0,0 +1,51 @@ +import javax.swing.*; +import java.awt.*; +import java.awt.event.KeyAdapter; +import java.awt.event.KeyEvent; + +public class PlayerMovement extends JPanel { + private int playerX = 100; + private int playerY = 100; + private final int playerSize = 20; + + public PlayerMovement() { + setFocusable(true); + addKeyListener(new KeyAdapter() { + @Override + public void keyPressed(KeyEvent e) { + switch (e.getKeyCode()) { + case KeyEvent.VK_UP: + playerY -= 5; // Move up + break; + case KeyEvent.VK_DOWN: + playerY += 5; // Move down + break; + case KeyEvent.VK_LEFT: + playerX -= 5; // Move left + break; + case KeyEvent.VK_RIGHT: + playerX += 5; // Move right + break; + } + repaint(); // Repaint the panel to update the player's position + } + }); + } + + @Override + protected void paintComponent(Graphics g) { + super.paintComponent(g); + g.setColor(Color.BLUE); + g.fillRect(playerX, playerY, playerSize, playerSize); // Draw the player + } + + public static void main(String[] args) { + JFrame frame = new JFrame("Player Movement"); + PlayerMovement playerMovement = new PlayerMovement(); + frame.add(playerMovement); + frame.setSize(400, 400); + frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + frame.setVisible(true); + playerMovement.requestFocusInWindow(); // Request focus for key events + } +} \ No newline at end of file diff --git a/src/main/java/likedriving/design/Chess/Board.java b/src/main/java/likedriving/design/Chess/Board.java deleted file mode 100644 index 7ca9040..0000000 --- a/src/main/java/likedriving/design/Chess/Board.java +++ /dev/null @@ -1,111 +0,0 @@ -package likedriving.design.Chess; - -import com.google.inject.Singleton; -import likedriving.design.Chess.Pieces.Piece; -import likedriving.design.Chess.Pieces.PiecePosition; -import likedriving.design.Chess.Pieces.PieceStore; -import likedriving.design.Chess.Pieces.PieceType; -import lombok.Data; -import org.junit.Test; - -import java.util.Iterator; -import java.util.List; - -@Data -@Singleton -public class Board { - - private static Cell [][] lastState; - - private static Cell [][] board = new Cell[Constants.EIGHT][Constants.EIGHT]; - - public static Cell getCell(Position position){ - return board[position.getX()][position.getY()]; - } - - public static void undoLastMove(){ - if(lastState == null){ - System.out.println("Last state not available"); - return; - } - board = lastState; - lastState = null; - } - - public static void storeLastState(){ - lastState = board; - } - - public static boolean exists(int x, int y){ - return x >=0 && x < Constants.EIGHT && y >=0 && y piecePositionList = null; - for(Color color: Color.values()) { - for (PieceType pieceType : PieceType.values()) { - List pieces = PieceStore.get(color, pieceType); - piecePositionList = PiecePosition.get(pieces.get(0)); - setPosition(pieces, piecePositionList); - } - } - } - - private static void setPosition(List pieceList, List positionList){ - - for(int i=0; i !p.equals(player)).findFirst().get(); - } -} diff --git a/src/main/java/likedriving/design/Chess/Moves.java b/src/main/java/likedriving/design/Chess/Moves.java deleted file mode 100644 index 59212f6..0000000 --- a/src/main/java/likedriving/design/Chess/Moves.java +++ /dev/null @@ -1,41 +0,0 @@ -package likedriving.design.Chess; - -public interface Moves { - - - - Cell nextRightPosition(Position currentPosition, DirectionOfAttack direction); - - Cell nextLeftPosition(Position currentPosition, DirectionOfAttack direction); - - - Cell next(Position currentPosition, DirectionOfAttack direction); - Cell previous(Position currentPosition, DirectionOfAttack direction); - - Cell left(Position currentPosition, DirectionOfAttack direction); - Cell right(Position currentPosition, DirectionOfAttack direction); - - - - - Cell diagonalLeft(Position currentPosition, DirectionOfAttack direction); - Cell diagonalRight(Position currentPosition, DirectionOfAttack direction); - - Cell diagonalLeftBack(Position currentPosition, DirectionOfAttack direction); - Cell diagonalRightBack(Position currentPosition, DirectionOfAttack direction); - - - //With jump - Cell jumpUpLeft(Position currentPosition, DirectionOfAttack direction); - Cell jumpUpRight(Position currentPosition, DirectionOfAttack direction); - Cell jumpDownLeft(Position currentPosition, DirectionOfAttack direction); - Cell jumpDownRight(Position currentPosition, DirectionOfAttack direction); - - Cell jumpLeftUp(Position currentPosition, DirectionOfAttack direction); - Cell jumpLeftDown(Position currentPosition, DirectionOfAttack direction); - - Cell jumpRightUp(Position currentPosition, DirectionOfAttack direction); - Cell jumpRightDown(Position currentPosition, DirectionOfAttack direction); - - -} diff --git a/src/main/java/likedriving/design/Chess/Navigation.java b/src/main/java/likedriving/design/Chess/Navigation.java deleted file mode 100644 index e3c43bc..0000000 --- a/src/main/java/likedriving/design/Chess/Navigation.java +++ /dev/null @@ -1,213 +0,0 @@ -package likedriving.design.Chess; -import java.util.logging.Logger; - -public class Navigation{ - - public static Cell next(Position currentPosition, DirectionOfAttack direction) { - - switch (direction) { - case INCREASING: - return Board.getCell(currentPosition.getX() + 1, currentPosition.getY()); - case DECREASING: - return Board.getCell(currentPosition.getX() - 1, currentPosition.getY()); - default: - Logger.getLogger(Navigation.class.getName()).severe("Direction of attack other than increasing or decresing"); - throw new IllegalArgumentException("Direction of attack other than increasing or decresing"); - } - } - - public static Cell left(Position currentPosition, DirectionOfAttack direction) { - - switch (direction) { - case INCREASING: - return Board.getCell(currentPosition.getX(), currentPosition.getY()-1); - case DECREASING: - return Board.getCell(currentPosition.getX(), currentPosition.getY()+1); - default: - Logger.getLogger(Navigation.class.getName()).severe("Direction of attack other than increasing or decresing"); - throw new IllegalArgumentException("Direction of attack other than increasing or decresing"); - } - } - - public static Cell right(Position currentPosition, DirectionOfAttack direction) { - - switch (direction) { - case INCREASING: - return Board.getCell(currentPosition.getX(), currentPosition.getY()+1); - case DECREASING: - return Board.getCell(currentPosition.getX(), currentPosition.getY()-1); - default: - Logger.getLogger(Navigation.class.getName()).severe("Direction of attack other than increasing or decresing"); - throw new IllegalArgumentException("Direction of attack other than increasing or decresing"); - } - } - - public static Cell previous(Position currentPosition, DirectionOfAttack direction) { - - switch (direction) { - case INCREASING: - return Board.getCell(currentPosition.getX() - 1, currentPosition.getY()); - case DECREASING: - return Board.getCell(currentPosition.getX() + 1, currentPosition.getY()); - default: - Logger.getLogger(Navigation.class.getName()).severe("Direction of attack other than increasing or decresing"); - throw new IllegalArgumentException("Direction of attack other than increasing or decresing"); - } - } - - public static Cell diagonalLeft(Position currentPosition, DirectionOfAttack direction) { - - switch (direction) { - case INCREASING: - return Board.getCell(currentPosition.getX()+1, currentPosition.getY()-1); - case DECREASING: - return Board.getCell(currentPosition.getX()-1, currentPosition.getY()+1); - default: - Logger.getLogger(Navigation.class.getName()).severe("Direction of attack other than increasing or decresing"); - throw new IllegalArgumentException("Direction of attack other than increasing or decresing"); - } - } - - public static Cell diagonalRight(Position currentPosition, DirectionOfAttack direction) { - - switch (direction) { - case INCREASING: - return Board.getCell(currentPosition.getX()+1, currentPosition.getY()+1); - case DECREASING: - return Board.getCell(currentPosition.getX()-1, currentPosition.getY()-1); - default: - Logger.getLogger(Navigation.class.getName()).severe("Direction of attack other than increasing or decresing"); - throw new IllegalArgumentException("Direction of attack other than increasing or decresing"); - } - } - - public static Cell diagonalLeftBack(Position currentPosition, DirectionOfAttack direction) { - - switch (direction) { - case INCREASING: - return Board.getCell(currentPosition.getX()-1, currentPosition.getY()-1); - case DECREASING: - return Board.getCell(currentPosition.getX()+1, currentPosition.getY()+1); - default: - Logger.getLogger(Navigation.class.getName()).severe("Direction of attack other than increasing or decresing"); - throw new IllegalArgumentException("Direction of attack other than increasing or decresing"); - } - } - - public static Cell diagonalRightBack(Position currentPosition, DirectionOfAttack direction) { - - switch (direction) { - case INCREASING: - return Board.getCell(currentPosition.getX()-1, currentPosition.getY()+1); - case DECREASING: - return Board.getCell(currentPosition.getX()+1, currentPosition.getY()-1); - default: - Logger.getLogger(Navigation.class.getName()).severe("Direction of attack other than increasing or decresing"); - throw new IllegalArgumentException("Direction of attack other than increasing or decresing"); - } - } - - public static Cell jumpUpLeftPosition(Position currentPosition, DirectionOfAttack direction) { - - switch (direction) { - case INCREASING: - return Board.getCell(currentPosition.getX()+2, currentPosition.getY()-1); - case DECREASING: - return Board.getCell(currentPosition.getX()-2, currentPosition.getY()+1); - default: - Logger.getLogger(Navigation.class.getName()).severe("Direction of attack other than increasing or decresing"); - throw new IllegalArgumentException("Direction of attack other than increasing or decresing"); - } - } - - public static Cell jumpUpRightPosition(Position currentPosition, DirectionOfAttack direction) { - - switch (direction) { - case INCREASING: - return Board.getCell(currentPosition.getX()+2, currentPosition.getY()+1); - case DECREASING: - return Board.getCell(currentPosition.getX()-2, currentPosition.getY()-1); - default: - Logger.getLogger(Navigation.class.getName()).severe("Direction of attack other than increasing or decresing"); - throw new IllegalArgumentException("Direction of attack other than increasing or decresing"); - } - } - - public static Cell jumpDownLeftPosition(Position currentPosition, DirectionOfAttack direction) { - - switch (direction) { - case INCREASING: - return Board.getCell(currentPosition.getX()-2, currentPosition.getY()-1); - case DECREASING: - return Board.getCell(currentPosition.getX()+2, currentPosition.getY()+1); - default: - Logger.getLogger(Navigation.class.getName()).severe("Direction of attack other than increasing or decresing"); - throw new IllegalArgumentException("Direction of attack other than increasing or decresing"); - } - } - - public static Cell jumpDownRightPosition(Position currentPosition, DirectionOfAttack direction) { - - switch (direction) { - case INCREASING: - return Board.getCell(currentPosition.getX()-2, currentPosition.getY()+1); - case DECREASING: - return Board.getCell(currentPosition.getX()+2, currentPosition.getY()-1); - default: - Logger.getLogger(Navigation.class.getName()).severe("Direction of attack other than increasing or decresing"); - throw new IllegalArgumentException("Direction of attack other than increasing or decresing"); - } - } - - public static Cell jumpLeftUpPosition(Position currentPosition, DirectionOfAttack direction) { - - switch (direction) { - case INCREASING: - return Board.getCell(currentPosition.getX()+1, currentPosition.getY()-2); - case DECREASING: - return Board.getCell(currentPosition.getX()-1, currentPosition.getY()+2); - default: - Logger.getLogger(Navigation.class.getName()).severe("Direction of attack other than increasing or decresing"); - throw new IllegalArgumentException("Direction of attack other than increasing or decresing"); - } - } - - public static Cell jumpRightUpPosition(Position currentPosition, DirectionOfAttack direction) { - - switch (direction) { - case INCREASING: - return Board.getCell(currentPosition.getX()+1, currentPosition.getY()+2); - case DECREASING: - return Board.getCell(currentPosition.getX()-1, currentPosition.getY()-2); - default: - Logger.getLogger(Navigation.class.getName()).severe("Direction of attack other than increasing or decresing"); - throw new IllegalArgumentException("Direction of attack other than increasing or decresing"); - } - } - - public static Cell jumpLeftDownPosition(Position currentPosition, DirectionOfAttack direction) { - - switch (direction) { - case INCREASING: - return Board.getCell(currentPosition.getX()-1, currentPosition.getY()-2); - case DECREASING: - return Board.getCell(currentPosition.getX()+1, currentPosition.getY()+2); - default: - Logger.getLogger(Navigation.class.getName()).severe("Direction of attack other than increasing or decresing"); - throw new IllegalArgumentException("Direction of attack other than increasing or decresing"); - } - } - - public static Cell jumpRightDownPosition(Position currentPosition, DirectionOfAttack direction) { - - switch (direction) { - case INCREASING: - return Board.getCell(currentPosition.getX()-1, currentPosition.getY()+2); - case DECREASING: - return Board.getCell(currentPosition.getX()+1, currentPosition.getY()-2); - default: - Logger.getLogger(Navigation.class.getName()).severe("Direction of attack other than increasing or decresing"); - throw new IllegalArgumentException("Direction of attack other than increasing or decresing"); - } - } -} diff --git a/src/main/java/likedriving/design/Chess/Pieces/Bishop.java b/src/main/java/likedriving/design/Chess/Pieces/Bishop.java deleted file mode 100644 index 2da0cb9..0000000 --- a/src/main/java/likedriving/design/Chess/Pieces/Bishop.java +++ /dev/null @@ -1,34 +0,0 @@ -package likedriving.design.Chess.Pieces; - -import likedriving.design.Chess.Cell; -import likedriving.design.Chess.Color; -import likedriving.design.Chess.Direction; -import likedriving.design.Chess.Navigation; - -public class Bishop extends Piece{ - - private Cell diagonalLeftCell = null; - private Cell diagonalRightCell = null; - private Cell diagonalLeftBackCell = null; - private Cell diagonalRightBackCell = null; - - public Bishop(Color color){ - super(PieceType.BISHOP, color); - } - - @Override - protected Direction[] myMoveOrder() { - Direction [] directions = {Direction.DIAGONAL_LEFT, Direction.DIAGONAL_RIGHT, - Direction.DIAGONAL_LEFT_BACK, Direction.DIAGONAL_RIGHT_BACK}; - return directions; - } - - @Override - public boolean canAttack() { - diagonalLeftCell = Navigation.diagonalLeft(getCurrentPosition(), getDirectionOfAttack()); - diagonalRightCell = Navigation.diagonalRight(getCurrentPosition(), getDirectionOfAttack()); - diagonalLeftBackCell = Navigation.diagonalLeftBack(getCurrentPosition(), getDirectionOfAttack()); - diagonalRightBackCell = Navigation.diagonalRightBack(getCurrentPosition(), getDirectionOfAttack()); - return canAttackHere(diagonalLeftCell) || canAttackHere(diagonalRightCell) || canAttackHere(diagonalLeftBackCell) || canAttackHere(diagonalRightBackCell); - } -} diff --git a/src/main/java/likedriving/design/Chess/Pieces/King.java b/src/main/java/likedriving/design/Chess/Pieces/King.java deleted file mode 100644 index ab02944..0000000 --- a/src/main/java/likedriving/design/Chess/Pieces/King.java +++ /dev/null @@ -1,94 +0,0 @@ -package likedriving.design.Chess.Pieces; - -import likedriving.design.Chess.Cell; -import likedriving.design.Chess.Color; -import likedriving.design.Chess.Direction; -import likedriving.design.Chess.Navigation; - -import static likedriving.design.Chess.Utils.logPieceStatus; - -public class King extends Piece{ - - private Cell nextCell = null; - private Cell previousCell = null; - private Cell leftCell = null; - private Cell rightCell = null; - - private Cell diagonalLeftCell = null; - private Cell diagonalRightCell = null; - private Cell diagonalLeftBackCell = null; - private Cell diagonalRightBackCell = null; - - public King(Color color){ - super(PieceType.KING, color); - } - - @Override - protected Direction[] myMoveOrder(){ - Direction [] directions = {Direction.NEXT, Direction.DIAGONAL_LEFT, Direction.LEFT, Direction.RIGHT, Direction.DIAGONAL_RIGHT, - Direction.DIAGONAL_LEFT_BACK,Direction.DIAGONAL_RIGHT_BACK, Direction.PREVIOUS}; - return directions; - } - - @Override - public boolean canAttack() { - nextCell = Navigation.next(getCurrentPosition(), getDirectionOfAttack()); - previousCell = Navigation.previous(getCurrentPosition(), getDirectionOfAttack()); - leftCell = Navigation.left(getCurrentPosition(), getDirectionOfAttack()); - rightCell = Navigation.right(getCurrentPosition(), getDirectionOfAttack()); - - diagonalLeftCell = Navigation.diagonalLeft(getCurrentPosition(), getDirectionOfAttack()); - diagonalRightCell = Navigation.diagonalRight(getCurrentPosition(), getDirectionOfAttack()); - diagonalLeftBackCell = Navigation.diagonalLeftBack(getCurrentPosition(), getDirectionOfAttack()); - diagonalRightBackCell = Navigation.diagonalRightBack(getCurrentPosition(), getDirectionOfAttack()); - - return canAttackHere(nextCell) || canAttackHere(diagonalLeftCell) || - canAttackHere(previousCell) || canAttackHere(diagonalRightCell) || canAttackHere(diagonalLeftBackCell) || - canAttackHere(leftCell) || canAttackHere(rightCell) || canAttackHere(diagonalRightBackCell); - - } - - @Override - public void move() { - Cell tempCell = null; - boolean ownPiece = false; - - Cell updatedCell = null; - - for(int i=0; i getPossibleMoves() { - - List possibleMoves = new ArrayList<>(); - Cell tempCell = null; - - for (int i = 0; i < myMoveOrder().length; i++) { - tempCell = navigateOneStepInMyDirection(myMoveOrder()[i], getCurrentPosition()); - while (tempCell != null && (canCapture(tempCell) || tempCell.isAvailable())) { - possibleMoves.add(tempCell); - if(!tempCell.isAvailable()) { - break; - } - tempCell = navigateOneStepInMyDirection(myMoveOrder()[i], tempCell.getPosition()); - } - } - return possibleMoves; - } -} diff --git a/src/main/java/likedriving/design/Chess/Pieces/PieceFactory.java b/src/main/java/likedriving/design/Chess/Pieces/PieceFactory.java deleted file mode 100644 index 2b5c767..0000000 --- a/src/main/java/likedriving/design/Chess/Pieces/PieceFactory.java +++ /dev/null @@ -1,73 +0,0 @@ -package likedriving.design.Chess.Pieces; - -import likedriving.design.Chess.Color; - -import java.util.*; - -public final class PieceFactory { - - final static AbstractMap pieceCountMap; - - static { - pieceCountMap = new HashMap(); - pieceCountMap.put(PieceType.PAWN, (byte)8); - pieceCountMap.put(PieceType.ROOK, (byte)2); - pieceCountMap.put(PieceType.BISHOP, (byte)2); - pieceCountMap.put(PieceType.KNIGHT, (byte)2); - pieceCountMap.put(PieceType.QUEEN, (byte)1); - pieceCountMap.put(PieceType.KING, (byte)1); - } - - private static Piece buildPiece(PieceType pieceType, Color color){ - switch (pieceType){ - case PAWN: - return new Pawn(color); - case BISHOP: - return new Bishop(color); - case ROOK: - return new Rook(color); - case KNIGHT: - return new Knight(color); - case QUEEN: - return new Queen(color); - case KING: - return new King(color); - default: - throw new IllegalArgumentException("Unknown piece type"); - } - } - - public static Piece [] getAllPieces() { - Piece [] pieces = new Piece[32]; - - int i=0; - for(Color color: Color.values()) { - for (PieceType pieceType : PieceType.values()) { - byte pieceCount = pieceCountMap.get(pieceType); - while (pieceCount >= 0) { - pieces[i] = buildPiece(pieceType, Color.values()[i%2]); - pieceCount--; - } - i++; - } - } - return pieces; - } - - public static Map> getPieceMap() { - Map> pieceMap = new LinkedHashMap<>(); - - for(Color color: Color.values()) { - for (PieceType pieceType : PieceType.values()) { - byte pieceCount = pieceCountMap.get(pieceType); - List pieces = new ArrayList<>(); - while (pieceCount > 0) { - pieces.add(buildPiece(pieceType, color)); - pieceCount--; - } - pieceMap.put(new PieceKey(color, pieceType), pieces); - } - } - return pieceMap; - } -} diff --git a/src/main/java/likedriving/design/Chess/Pieces/PieceKey.java b/src/main/java/likedriving/design/Chess/Pieces/PieceKey.java deleted file mode 100644 index 0d1749e..0000000 --- a/src/main/java/likedriving/design/Chess/Pieces/PieceKey.java +++ /dev/null @@ -1,23 +0,0 @@ -package likedriving.design.Chess.Pieces; - -import likedriving.design.Chess.Color; -import lombok.AllArgsConstructor; -import lombok.Data; - -@AllArgsConstructor -@Data -public class PieceKey extends Object{ - private Color color; - private PieceType pieceType; - - @Override - public boolean equals(Object pieceKey){ - return ((PieceKey)pieceKey).getColor() == this.getColor() - && ((PieceKey)pieceKey).getPieceType() == this.pieceType; - } - - @Override - public int hashCode(){ - return this.getPieceType().hashCode() + this.getColor().hashCode(); - } -} diff --git a/src/main/java/likedriving/design/Chess/Pieces/PiecePosition.java b/src/main/java/likedriving/design/Chess/Pieces/PiecePosition.java deleted file mode 100644 index 594983a..0000000 --- a/src/main/java/likedriving/design/Chess/Pieces/PiecePosition.java +++ /dev/null @@ -1,90 +0,0 @@ -package likedriving.design.Chess.Pieces; - -import likedriving.design.Chess.Color; -import likedriving.design.Chess.Position; -import org.junit.Test; - -import java.util.*; - -public class PiecePosition { - private static Map> piecePosition = null; - - static { - piecePosition = new LinkedHashMap<>(); - piecePosition.put(new PieceKey(Color.WHITE, PieceType.ROOK), - Arrays.asList(new Position((byte)0,(byte)0), new Position((byte)0,(byte)7))); - - piecePosition.put(new PieceKey(Color.WHITE, PieceType.KNIGHT), - Arrays.asList(new Position((byte)0,(byte)1), new Position((byte)0,(byte)6))); - - piecePosition.put(new PieceKey(Color.WHITE, PieceType.BISHOP), - Arrays.asList(new Position((byte)0,(byte)2), new Position((byte)0,(byte)5))); - - piecePosition.put(new PieceKey(Color.WHITE, PieceType.KING), - Arrays.asList(new Position((byte)0,(byte)3))); - - piecePosition.put(new PieceKey(Color.WHITE, PieceType.QUEEN), - Arrays.asList(new Position((byte)0,(byte)4))); - - piecePosition.put(new PieceKey(Color.WHITE, PieceType.PAWN), - Arrays.asList(new Position((byte)1,(byte)0), - new Position((byte)1,(byte)1), - new Position((byte)1,(byte)2), - new Position((byte)1,(byte)3), - new Position((byte)1,(byte)4), - new Position((byte)1,(byte)5), - new Position((byte)1,(byte)6), - new Position((byte)1,(byte)7))); - - piecePosition.put(new PieceKey(Color.BLACK, PieceType.ROOK), - Arrays.asList(new Position((byte)7,(byte)0), new Position((byte)7,(byte)7))); - - piecePosition.put(new PieceKey(Color.BLACK, PieceType.KNIGHT), - Arrays.asList(new Position((byte)7,(byte)1), new Position((byte)7,(byte)6))); - - piecePosition.put(new PieceKey(Color.BLACK, PieceType.BISHOP), - Arrays.asList(new Position((byte)7,(byte)2), new Position((byte)7,(byte)5))); - - piecePosition.put(new PieceKey(Color.BLACK, PieceType.KING), - Arrays.asList(new Position((byte)7,(byte)4))); - - piecePosition.put(new PieceKey(Color.BLACK, PieceType.QUEEN), - Arrays.asList(new Position((byte)7,(byte)3))); - - piecePosition.put(new PieceKey(Color.BLACK, PieceType.PAWN), - Arrays.asList(new Position((byte)6,(byte)0), - new Position((byte)6,(byte)1), - new Position((byte)6,(byte)2), - new Position((byte)6,(byte)3), - new Position((byte)6,(byte)4), - new Position((byte)6,(byte)5), - new Position((byte)6,(byte)6), - new Position((byte)6,(byte)7))); - } - - public static List get(Color color, PieceType pieceType){ - return piecePosition.get(new PieceKey(color, pieceType)); - } - - public static List get(Piece piece){ - return piecePosition.get(new PieceKey(piece.getColor(), piece.getPieceType())); - } - - public static Iterator getPosition(Piece piece){ - return PiecePosition.get(piece.getColor(), piece.getPieceType()).iterator(); - } - - @Test - public void piecePositionTest(){ - for(Map.Entry pp :piecePosition.entrySet()){ - System.out.println(pp.getKey()); - } - System.out.println(piecePosition.get(new PieceKey(Color.BLACK, PieceType.PAWN))); - System.out.println(piecePosition.get(new PieceKey(Color.WHITE, PieceType.PAWN))); - System.out.println(piecePosition.get(new PieceKey(Color.BLACK, PieceType.KING))); - System.out.println(piecePosition.get(new PieceKey(Color.WHITE, PieceType.KING))); - System.out.println(piecePosition.get(new PieceKey(Color.BLACK, PieceType.QUEEN))); - System.out.println(piecePosition.get(new PieceKey(Color.WHITE, PieceType.BISHOP))); - System.out.println(piecePosition.get(new PieceKey(Color.WHITE, PieceType.KNIGHT))); - } -} diff --git a/src/main/java/likedriving/design/Chess/Pieces/PieceStore.java b/src/main/java/likedriving/design/Chess/Pieces/PieceStore.java deleted file mode 100644 index c048446..0000000 --- a/src/main/java/likedriving/design/Chess/Pieces/PieceStore.java +++ /dev/null @@ -1,39 +0,0 @@ -package likedriving.design.Chess.Pieces; - -import likedriving.design.Chess.Color; -import org.junit.Test; - -import java.util.List; -import java.util.Map; - -public class PieceStore { - private static Piece [] pieces = null; - private static Map> pieceMap = null; - public static Piece[] getPieces(){ - if(pieces == null){ - pieces = new Piece[32]; - pieces = PieceFactory.getAllPieces(); - } - return pieces; - } - - public static Map> getPieceMap(){ - if(pieceMap == null){ - pieceMap = PieceFactory.getPieceMap(); - } - return pieceMap; - } - - public static List get(Color color, PieceType pieceType){ - getPieceMap(); - return pieceMap.get(new PieceKey(color, pieceType)); - } - - @Test - public void piecePositionTest(){ - getPieceMap(); - for(Map.Entry pp :pieceMap.entrySet()){ - System.out.println(pp.getValue()); - } - } -} diff --git a/src/main/java/likedriving/design/Chess/Pieces/PieceType.java b/src/main/java/likedriving/design/Chess/Pieces/PieceType.java deleted file mode 100644 index a07997d..0000000 --- a/src/main/java/likedriving/design/Chess/Pieces/PieceType.java +++ /dev/null @@ -1,10 +0,0 @@ -package likedriving.design.Chess.Pieces; - -public enum PieceType { - KING, - QUEEN, - KNIGHT, - ROOK, - BISHOP, - PAWN -} diff --git a/src/main/java/likedriving/design/Chess/Pieces/Queen.java b/src/main/java/likedriving/design/Chess/Pieces/Queen.java deleted file mode 100644 index b6c4847..0000000 --- a/src/main/java/likedriving/design/Chess/Pieces/Queen.java +++ /dev/null @@ -1,47 +0,0 @@ -package likedriving.design.Chess.Pieces; - -import likedriving.design.Chess.Cell; -import likedriving.design.Chess.Color; -import likedriving.design.Chess.Direction; -import likedriving.design.Chess.Navigation; - -public class Queen extends Piece{ - - private Cell nextCell = null; - private Cell previousCell = null; - private Cell leftCell = null; - private Cell rightCell = null; - - private Cell diagonalLeftCell = null; - private Cell diagonalRightCell = null; - private Cell diagonalLeftBackCell = null; - private Cell diagonalRightBackCell = null; - - public Queen(Color color){ - super(PieceType.QUEEN, color); - } - - @Override - protected Direction[] myMoveOrder() { - Direction [] directions = {Direction.NEXT, Direction.DIAGONAL_LEFT, Direction.LEFT, Direction.RIGHT, Direction.DIAGONAL_RIGHT, - Direction.DIAGONAL_LEFT_BACK,Direction.DIAGONAL_RIGHT_BACK, Direction.PREVIOUS}; - return directions; - } - - @Override - public boolean canAttack() { - nextCell = Navigation.next(getCurrentPosition(), getDirectionOfAttack()); - previousCell = Navigation.previous(getCurrentPosition(), getDirectionOfAttack()); - leftCell = Navigation.left(getCurrentPosition(), getDirectionOfAttack()); - rightCell = Navigation.right(getCurrentPosition(), getDirectionOfAttack()); - - diagonalLeftCell = Navigation.diagonalLeft(getCurrentPosition(), getDirectionOfAttack()); - diagonalRightCell = Navigation.diagonalRight(getCurrentPosition(), getDirectionOfAttack()); - diagonalLeftBackCell = Navigation.diagonalLeftBack(getCurrentPosition(), getDirectionOfAttack()); - diagonalRightBackCell = Navigation.diagonalRightBack(getCurrentPosition(), getDirectionOfAttack()); - - return canAttackHere(nextCell) || canAttackHere(diagonalLeftCell) || - canAttackHere(previousCell) || canAttackHere(diagonalRightCell) || canAttackHere(diagonalLeftBackCell) || - canAttackHere(leftCell) || canAttackHere(rightCell) || canAttackHere(diagonalRightBackCell); - } -} diff --git a/src/main/java/likedriving/design/Chess/Pieces/Rook.java b/src/main/java/likedriving/design/Chess/Pieces/Rook.java deleted file mode 100644 index 2ff02f0..0000000 --- a/src/main/java/likedriving/design/Chess/Pieces/Rook.java +++ /dev/null @@ -1,69 +0,0 @@ -package likedriving.design.Chess.Pieces; - -import likedriving.design.Chess.*; - -public class Rook extends Piece{ - - private Cell nextCell = null; - private Cell previousCell = null; - private Cell leftCell = null; - private Cell rightCell = null; - - public Rook(Color color){ - super(PieceType.ROOK, color); - } - - @Override - public boolean canAttack() { - nextCell = Navigation.next(getCurrentPosition(), getDirectionOfAttack()); - previousCell = Navigation.previous(getCurrentPosition(), getDirectionOfAttack()); - leftCell = Navigation.left(getCurrentPosition(), getDirectionOfAttack()); - rightCell = Navigation.right(getCurrentPosition(), getDirectionOfAttack()); - return canAttackHere(nextCell) || canAttackHere(previousCell) || canAttackHere(leftCell) || canAttackHere(rightCell); - } - - @Override - protected Direction [] myMoveOrder(){ - Direction [] directions = {Direction.NEXT, Direction.LEFT, Direction.RIGHT, Direction.PREVIOUS}; - return directions; - } - - public boolean canMoveTo(Position position){ - - if(getCurrentPosition().getY() != position.getY() - && getCurrentPosition().getX() != position.getX()){ - return false; - } - - boolean reached = false; - if (getCurrentPosition().getX() == position.getX()) { - - Direction [] possibleDirections = {Direction.LEFT, Direction.RIGHT}; - reached = reachedPosition(position, possibleDirections); - } - else if(getCurrentPosition().getY() == position.getY()){ - Direction [] possibleDirections = {Direction.NEXT, Direction.PREVIOUS}; - reached = reachedPosition(position, possibleDirections); - }else { - System.out.println("unexpected case: (can move to)"); - } - return reached; - } - - private boolean reachedPosition(Position position, Direction [] possibleDirections){ - - for(Direction direction: possibleDirections) { - - System.out.println("Both are on same horizontal line"); - Cell tempCell = navigateOneStepInMyDirection(direction, getCurrentPosition()); - while (tempCell != null && tempCell.isAvailable() - && !tempCell.getPosition().equals(position)) { - tempCell = navigateOneStepInMyDirection(direction, tempCell.getPosition()); - } - if (tempCell != null && tempCell.getPosition().equals(position)) { - return true; - } - } - return false; - } -} diff --git a/src/main/java/likedriving/design/Chess/Player.java b/src/main/java/likedriving/design/Chess/Player.java deleted file mode 100644 index 66a5172..0000000 --- a/src/main/java/likedriving/design/Chess/Player.java +++ /dev/null @@ -1,156 +0,0 @@ -package likedriving.design.Chess; - -import lombok.Data; -import lombok.NoArgsConstructor; -import likedriving.design.Chess.Pieces.Piece; -import likedriving.design.Chess.Pieces.PieceKey; -import likedriving.design.Chess.Pieces.PieceStore; -import likedriving.design.Chess.Pieces.PieceType; - -import java.util.*; -import java.util.stream.Collectors; - -@Data -@NoArgsConstructor -public class Player { - private String id; - private Color color; - - public Player(Color color){ - this.color = color; - } - - public boolean isCheckMate(Player opponent){ - if(isMyKingBeUnderThreat(opponent)){ - List myPieces = getMyPieces().stream() - .filter(piece -> piece.canAttack()).collect(Collectors.toList()); - - for(Piece piece: myPieces){ - for(Cell newCell: piece.getPossibleMoves()){ - Board.storeLastState(); - if(!newCell.isAvailable()) { - Utils.logPieceStatus(newCell.getPiecePlaced()); - } - piece.logUpdatedPosition(newCell); - if(!isMyKingBeUnderThreat(opponent)){ - System.out.println("King is saved, Not a checkmate"); - return false; - } - else { - System.out.println("King is still under threat, reverting to old position, " + - "will try other moves"); - Board.undoLastMove(); - } - } - } - return true; - } - return false; - } - - private boolean isMyKingBeUnderThreat(Player opponent){ - if(getMyKing().isPresent()) { - return opponentCanCapture(opponent, getMyKing().get().getCurrentPosition()); - } - System.out.println("Illegal Game: King not present in the game, should have been terminated"); - return false; - } - - private Optional getMyKing(){ - return getMyPieces().stream().filter(piece -> piece.getPieceType() == PieceType.KING).findFirst(); - } - - private boolean opponentCanCapture(Player opponent, Position myKingsPosition){ - List opponentPieces = opponent.getMyPieces(); - for(Piece piece: opponentPieces) { - if(piece.canMoveTo(myKingsPosition)){ - return true; - } - } - return false; - } - - public List getMyPieces(){ - List myPieces = new ArrayList<>(); - List myCapturedPieces = new ArrayList<>(); - for (Map.Entry> pieceEntry : PieceStore.getPieceMap().entrySet()) { - if (pieceEntry.getKey().getColor() == getColor()) { - for (Piece piece : pieceEntry.getValue()) { - if(!piece.isCaptured()) { - myPieces.add(piece); - }else { - myCapturedPieces.add(piece); - } - - } - } - } - if(myCapturedPieces.size() > 0) { - System.out.print("My " + myCapturedPieces.size() + " pieces captured: "); - myCapturedPieces.forEach(p -> System.out.print(p.getPieceType() + "-" + p.getId()+", ")); - } - return myPieces; - } - - public void printMyPiecesPosition() { - for (Piece piece : getMyPieces()) { - System.out.println(piece); - } - } - - void play(){ - System.out.println("\n\n"+color +" is playing ..."); - //System.out.println("Lost: "+ (16 - getMyPieces().size()) + " pieces"); - - while (true) { - Piece selectedPiece = selectPiece(); - if (selectedPiece != null) { - System.out.print("\n" + selectedPiece.getPieceType() + "-" + selectedPiece.getId() + " " + " is attacking"); - System.out.print(" from " + selectedPiece.getCurrentPosition()); - - Board.storeLastState(); - selectedPiece.move(); - - if (isMyKingBeUnderThreat(Game.getOpponent(this))) { - System.out.println("King is still under threat, reverting my move, " + - "will try other moves"); - Board.undoLastMove(); - } - else { - System.out.println("Piece moved"); - break; - } - } else { - System.out.println("No piece selected to attack"); - break; - } - } - } - - public List eligibleToMove(){ - List eligibleAttackers = new ArrayList<>(); - for(Piece piece: getMyPieces()){ - if(piece.canAttack()){ - eligibleAttackers.add(piece); - } - } - return eligibleAttackers; - } - - // Randomly select one piece out of many pieces to move - public Piece selectPiece(){ - List eligiblePieces = eligibleToMove(); - try { - Random random = new Random(); - return eligiblePieces.get(random.nextInt(eligiblePieces.size())); - } - catch (IllegalArgumentException e){ - if(eligiblePieces.size() == 0) { - System.out.println(color +" has no pieces to move"); - }else { - System.out.println("Unable to select eligible pieces"); - } - return null; - } - } -} diff --git a/src/main/java/likedriving/design/Chess/Players.java b/src/main/java/likedriving/design/Chess/Players.java deleted file mode 100644 index 8d0ef38..0000000 --- a/src/main/java/likedriving/design/Chess/Players.java +++ /dev/null @@ -1,24 +0,0 @@ -package likedriving.design.Chess; -import org.junit.Test; - -public class Players { - - private static Player [] players = new Player[2]; - - public static Player[] getPlayers(){ - if(players[0] == null || players[1] == null) { - players[0] = new Player(Color.WHITE); - players[1] = new Player(Color.BLACK); - } - return players; - } - - @Test - public void printPlayerPosition(){ - Player [] players = getPlayers(); - System.out.println("\nPlayer 1 piece deployement\n"); - players[0].printMyPiecesPosition(); - System.out.println("\nPlayer 2 piece deployement\n"); - players[1].printMyPiecesPosition(); - } -} diff --git a/src/main/java/likedriving/design/Chess/Position.java b/src/main/java/likedriving/design/Chess/Position.java deleted file mode 100644 index c33515c..0000000 --- a/src/main/java/likedriving/design/Chess/Position.java +++ /dev/null @@ -1,15 +0,0 @@ -package likedriving.design.Chess; - -import lombok.AllArgsConstructor; -import lombok.Data; - -@AllArgsConstructor -@Data -public class Position { - private int x; - private int y; - - public boolean equals(Object object){ - return this.getX() == ((Position)object).getX() && this.getY() == ((Position)object).getY(); - } -} diff --git a/src/main/java/likedriving/design/Chess/TerminalCondition.java b/src/main/java/likedriving/design/Chess/TerminalCondition.java deleted file mode 100644 index edaef28..0000000 --- a/src/main/java/likedriving/design/Chess/TerminalCondition.java +++ /dev/null @@ -1,9 +0,0 @@ -package likedriving.design.Chess; - -public enum TerminalCondition { - CHECK_MATE, - DRAW, - STALE_MATE, - INSUFFICIENT_MATERIAL, - THREE_SAME_MOVES -} \ No newline at end of file diff --git a/src/main/java/likedriving/design/Chess/Utils.java b/src/main/java/likedriving/design/Chess/Utils.java deleted file mode 100644 index 4314ceb..0000000 --- a/src/main/java/likedriving/design/Chess/Utils.java +++ /dev/null @@ -1,11 +0,0 @@ -package likedriving.design.Chess; - -import likedriving.design.Chess.Pieces.Piece; - -public class Utils { - - public static void logPieceStatus(Piece capturedPiece){ - capturedPiece.setCaptured(true); - System.out.print(" and has captured "+capturedPiece.getPieceType()+"-"+capturedPiece.getId()); - } -}