From 9c0c07e25009199d1a2af1ab3e8abb970ca7459f Mon Sep 17 00:00:00 2001 From: Gabriel Tofvesson Date: Mon, 21 Mar 2016 04:41:02 +0100 Subject: [PATCH] Added files via upload --- bin/com/tofvesson/api/Callback$1.class | Bin 0 -> 601 bytes bin/com/tofvesson/api/Callback.class | Bin 0 -> 1051 bytes bin/com/tofvesson/api/Coordinate.class | Bin 0 -> 814 bytes bin/com/tofvesson/api/ICallback.class | Bin 0 -> 202 bytes bin/com/tofvesson/api/ICoordinate.class | Bin 0 -> 596 bytes bin/com/tofvesson/api/IGridPosition.class | Bin 0 -> 2720 bytes bin/com/tofvesson/api/IMap.class | Bin 0 -> 909 bytes bin/com/tofvesson/api/IRevealable.class | Bin 0 -> 1386 bytes bin/com/tofvesson/api/IServerService.class | Bin 0 -> 1252 bytes bin/com/tofvesson/api/Revealable.class | Bin 0 -> 1405 bytes bin/com/tofvesson/api/Type.class | Bin 0 -> 1120 bytes bin/com/tofvesson/base/Map.class | Bin 0 -> 1507 bytes bin/com/tofvesson/base/Position.class | Bin 0 -> 2605 bytes bin/com/tofvesson/base/Server$1.class | Bin 0 -> 1480 bytes bin/com/tofvesson/base/Server.class | Bin 0 -> 4419 bytes src/com/tofvesson/api/Callback.java | 24 ++++ src/com/tofvesson/api/Coordinate.java | 19 +++ src/com/tofvesson/api/ICallback.java | 7 ++ src/com/tofvesson/api/ICoordinate.java | 16 +++ src/com/tofvesson/api/IGridPosition.java | 50 ++++++++ src/com/tofvesson/api/IMap.java | 13 ++ src/com/tofvesson/api/IRevealable.java | 24 ++++ src/com/tofvesson/api/IServerService.java | 94 +++++++++++++++ src/com/tofvesson/api/Revealable.java | 45 +++++++ src/com/tofvesson/api/Type.java | 5 + src/com/tofvesson/base/Map.java | 57 +++++++++ src/com/tofvesson/base/Position.java | 69 +++++++++++ src/com/tofvesson/base/Server.java | 133 +++++++++++++++++++++ 28 files changed, 556 insertions(+) create mode 100644 bin/com/tofvesson/api/Callback$1.class create mode 100644 bin/com/tofvesson/api/Callback.class create mode 100644 bin/com/tofvesson/api/Coordinate.class create mode 100644 bin/com/tofvesson/api/ICallback.class create mode 100644 bin/com/tofvesson/api/ICoordinate.class create mode 100644 bin/com/tofvesson/api/IGridPosition.class create mode 100644 bin/com/tofvesson/api/IMap.class create mode 100644 bin/com/tofvesson/api/IRevealable.class create mode 100644 bin/com/tofvesson/api/IServerService.class create mode 100644 bin/com/tofvesson/api/Revealable.class create mode 100644 bin/com/tofvesson/api/Type.class create mode 100644 bin/com/tofvesson/base/Map.class create mode 100644 bin/com/tofvesson/base/Position.class create mode 100644 bin/com/tofvesson/base/Server$1.class create mode 100644 bin/com/tofvesson/base/Server.class create mode 100644 src/com/tofvesson/api/Callback.java create mode 100644 src/com/tofvesson/api/Coordinate.java create mode 100644 src/com/tofvesson/api/ICallback.java create mode 100644 src/com/tofvesson/api/ICoordinate.java create mode 100644 src/com/tofvesson/api/IGridPosition.java create mode 100644 src/com/tofvesson/api/IMap.java create mode 100644 src/com/tofvesson/api/IRevealable.java create mode 100644 src/com/tofvesson/api/IServerService.java create mode 100644 src/com/tofvesson/api/Revealable.java create mode 100644 src/com/tofvesson/api/Type.java create mode 100644 src/com/tofvesson/base/Map.java create mode 100644 src/com/tofvesson/base/Position.java create mode 100644 src/com/tofvesson/base/Server.java diff --git a/bin/com/tofvesson/api/Callback$1.class b/bin/com/tofvesson/api/Callback$1.class new file mode 100644 index 0000000000000000000000000000000000000000..bb42882dac21e58ee93aa21cfb3977eebdd97b42 GIT binary patch literal 601 zcmaJ;O;5r=6r80@+YNCewQdTIIt?38<%Y!lT;1BRe z8Q&rX69Y{)yKg%4-puaj*ZT*66I67h7|L!ivg6=!ETSloHh=c)HuwE5cb}?F9ccz@ z$j99Fx$N7w-Jx(}9T|qg482RF%p{MF8m{!&pDhuXSn`BK3 z6UkuQ2TACPOHZZB{a(nC%1je4r0WNfC;QhT9t1rdC5F=cz{+l!p;&YN-&spVFt4N( zVcX|XBqAJ8SdG>am}RNV^jaxeSr~+_(CL(Fg&6h5E6n;ER$nHZHHA(7D7B6P)h1~a ux{eLn88%@}yEG;>VKZ@NLjEgcQ=x_}qNh;AHtlKbU>AFIQkK*J`o00TfPYT_ literal 0 HcmV?d00001 diff --git a/bin/com/tofvesson/api/Callback.class b/bin/com/tofvesson/api/Callback.class new file mode 100644 index 0000000000000000000000000000000000000000..97bf0e518fd4ef437d49ae50bdc6287193ebe1d5 GIT binary patch literal 1051 zcmaJ-Tv~E8R+$W_Rg7@VEHl zi;1LB6CZu>M_JD-OChC7!hAb3-?@Az^ZU>Dp8%fXi2+TZ)ajqtVgLP^69j$FmZz>= zm%UzFc0L%;1(uHGnY4S->)Nl|$4)0SkP;}*q8ekEfbazh%?a?$!1H9g=j;h+?ji3R z0($7XU4Fh3NIi2sH+(LzTDcBXZLz!FKXlSaVA(_#Ie|o_+L{MtOk`jhSP@v8^)$A$ zxtm52Hx%}!z(%F{@7BE$Z`p)_If2Ed>p8CmCvC?+P$LNBn*EOKwWRN=eSD~gM{Yn1 z|05R2?uU%^r96#L2JVt=Hl;Mj+Ei8-1TujWj)!0hmBz?j#l$?)8Qg(oq88=h4?MPa zr`wqkgU%euU_!w&CZ68!5B!ev!c_xh$G6+ci-6hiJjbv1WDqz3B^WmUNv=?taD`Hj zDzj%z@}73NE^_w~IyBaG>l{l~Vu-v|`vs%+37H=#zUAra5T!5dNMMcYLd>iqMP389 zc(yWPz&bX#BUhv>aGT%vpj=3%hJ_EUs3vos=$OR$Faf3m}DerYUerFWR$|?D1|6I zzI;5yqgcUaRsNFX-THjR-tv^aUP!Os`RQv%I{0nwrW8zAU8xxZzs0$6zWx-KPur*MPzLOghg~Wvq z;6oYjOsh4BX{IxCde3+7-08>X+dF_QtfinZl$!pH75JC;yxa9X%ei%}ec$g~xSkX6 z6cP-%mUHh|ZO6N^jvFoB3{ub-=KuQa*vP;hXxKC!8MIy3bAvsGWYxCU>kNr~|AJ?r zVoXN{27_8%uV=t8t|N~L3h46SjHW7u3w=sQ;afjvFlw&HkM3?7ymRU_+MFR@^P5h) z?sQzSkHkc9?RFU!YJY2uOWhItlBgp~39n>cD#sonxvV3FbSR$-VOhtB5HctJU8l(p zT#?&|VH=`Xs8FOzBMF5bB2d2-VWe3jol?3C=Mdi5~)+Lz=ue>RV+kyi)QgHX})0b zi53dtda}RF$scoNsCjA7JUY}&*B)iwrc??g)Xd^576%`R%t633 zkVHzMO#>UqD70lD9p`ooWRYQ2*PqIZ#iTE1*KU6-1xnq(bH_b*<}3b{)WZjVF3|YL zfPnA>l9m%aLp+i5jpA7#dlf8Zo;>%}h~nCoPSk=@EJA{t1yWoZeM2peUZY6&QKVy5 z2;^Y!&J*82;{ht|;}r@5D-<;-TvB*j!wY|EDDy5v12SyQVviEL%$4J2@(LMcu+LAK s$)UP7LRmB0)mXjut8kuf3p{2d+>C~q-@+zps8f(KI3Uu98)O=qpKC&84*&oF literal 0 HcmV?d00001 diff --git a/bin/com/tofvesson/api/IGridPosition.class b/bin/com/tofvesson/api/IGridPosition.class new file mode 100644 index 0000000000000000000000000000000000000000..0381cdd8105f1d2270ad81baa76a3f710ae22683 GIT binary patch literal 2720 zcmcgu-%}e^6#j0q*@a~JQE2#4sBNJwNef9U6}2FWw1sH+VL@7o+Ahh0i)ofg76z(s zWgMUS>Nq~AFU_0djN>@?YkYS6i_|fGce6ke!juPf26pec_nvdlIp6o)&2NAI@C$%z zSk~YZIFqs;#vOZQ)6D1XY}{D4;)#izm7cZpmSfpj4T?bXnz3obGe&kbKC`@LrW^rn z)pX{!*G+*_k!bR85VWG!KoKXRPB)Sj+v(eFlR)KnE#R8|SEW<^jO9{Cc z*3nkJXl%*Z4jr91#aJa5fpay>O^n-iE^TEE#~co!8_#JtEpYm9U&=P>ID@lHfRXRI zIWmoI^yui_n_iR|T+ne5eWeVhjP;`$p5Pjfj^eV0O9E{*j^+*>{TL7km8x+O<_VER zq85ggotL@9bp)V>a210Zo)>65KtMKMC#_y!DMmWYenyhjv>A@xlfEzNcnL3)Lyqm@ zCifEhL%TH)?w;dtqA6)*&FPJY%VuugSk91@ElE3NWEPB^C2em~ao)G`gzz{lb6j$F z)Y$4#TUZoEDQTC2vH{FjUH6FPTS|DAu_YknKPSXCv8l|B2YLAoR)rg>ae5^vqdc); z&M{IS5L`EkhUuE<%d9orWM_!|fg~4<%m&*<3LHaxk^*x&<|RMt7{+t=+u|VcI)=0nd6mWmgL`cwEP#ShLw!5%D&}Yg>sNHH%%FSEK-vQWxA_L;oGje z&k#XHWVn}$$%0YQVVz#4sfMiU>98iU*JYq-Lub0 z`x>qDR74=G?jqvnwwS=>r|9lKv~b0TI|W><3fNW^P~B0BJE{n)or)6ss`z*(Ai{x8 z#m}+bzl$M(Uvd2#7NB5+&lo~{*0a1InmBHUyr&w_$2;{tXSUFc&uJGp|1D1774Dua zH2|Y{l@?op*D%KR)Zsh4j&bfWM%LKQY_m`-7=p@~WtQRyHm?L?*f2vpu?kN-VXdJj+`EVVJAViuUN{1I^ncis1* zR1ocZ7;xW9c*lM7GwZ(ju_NTXPtfXN2~vbuv)RpCo}Mhe953Z#Y10zb(C<~fE4KIB-6K+={udLodtorF@v zpyVuX5RbA&%F3Nkya`dnm1k|CKYzFI$@>Psd)=6uYkQ#(gi5~%9_h|$QnyK vsw?Yf`~mdwBADQhg@ei_t1IiRPMfI7Qp+kk`>ZYG0ly}!O5g#XJ{bQ1MbkYy literal 0 HcmV?d00001 diff --git a/bin/com/tofvesson/api/IMap.class b/bin/com/tofvesson/api/IMap.class new file mode 100644 index 0000000000000000000000000000000000000000..c7534089e9768f4c04b8466fa26fbca389881a4c GIT binary patch literal 909 zcma)4$xa(V5Pjuk1~VpX!H|Uz2#}c|WiGkp22zkEXOTcCfm3_jaT=LvG#>kqZ^{pl z10Rr&LU}zgLW)MRFI8Qw_o`kkf9`(Y0(gheM@7&|>{XoG?_)h2+B83y+7lN+197x=`V zn4jcthfx{+$l9!DQkEb(Ao`vxI1Hx{N)!GkU@vU9XTdd`&{4POEtyt$ny!mkMiWsP zwatX}GCkI6AlR8EEjky}j%-f{Si`!HmSD4FO%G#lVgpaeVgFx?Ew>%>SrgCizrO_# zyl7$>TY|cqCu=NrOsYSPuDUuqRowv>ywb6W8l0)jxOnne%YT@mV54keoHch|Puv9v zw#pz6GKri&v7;=}AB?NkaA*70U92aRSLKZZ4PJ2_9^5tim@9k(^Mw!4ocM*pKf>a~ zFOeziZiRN0?_*}G(67EZxWQuq?Nh-GHmmr>?+RYhdISRjwrN}c;Ml<{MkHbvdk~7? M$QTRuX)AdB7tHhSX#fBK literal 0 HcmV?d00001 diff --git a/bin/com/tofvesson/api/IRevealable.class b/bin/com/tofvesson/api/IRevealable.class new file mode 100644 index 0000000000000000000000000000000000000000..411f09cf77c14b615bf22d25cf35634ffc6c569d GIT binary patch literal 1386 zcmah|O-~b16g{t<&a|bJf>fxWMLwjZKrKQ|U}XpzOsU2a5+e(TcEG{XX{G~lP51+@ zT^Lp@iOZ^Vk6T%|aixF2KR`WG8mTy@i@ta7?Y-xobKl%A=O1eTW^rGEOWqeGPCgj0uR~?ae}>kKf+Q}0ABcPD;j_T*|u&6;D?XeGkQtO?(S@8=BoYR z0zDZcuNK!-Q@8zQP_ka>lo4&yjnwt6l3@~N$nhCl1PciBe`zfO1l-n6naMhT%K|Pv zMfOfSu6%1QlZl-ZotBOe zoC-^cur!l9kOZyTVf|O4mX#1n+QQiH};wTmiId@!ZCXB8DX5#{)#?~5NZ8lW*Eg7 zJ>U#?h-c6B6fwl%VwX>tV9bp{)+R8?InUvJ)5@~f6sGx3`|NyS9dqB3#Pi@T5traS nM^r&d!Hn?NiQ-cr=rltRbnXFt1O0UpbNDj_QWb0p(n%x48MOL)7|OG?>|3(0l*8`$iXEBD}MCNP|??8ktC5ccrP&Ou85CC zOn(Dkm6bvRS)tb3)H@&@v(`3Nv45q9| zCW=ed;$bR=07f<#jMXci<(Td^GB5@c$XkwSRcre;Nm$#I>$E&`zq##M+op{!#7@=S z^BOyN(J5`36^g(*3#4t?jZM?`+-75s&m)C0+{ix?s$6O@m`-~gj65rRs7Uf`Br&$a z6{j+V6fu^5nv-;7|A2>~kX=DFFc`soh_Utc!A;p}oh(tgWM8nA7A9zO{|FlzPE^!m zFpBfRDKJ>Z#xIEIPbeQoyyK?r%+vX|vx_3FD2h7)&Q+BEW2OP*-6)NHQ447Q=g&W% zHTquhtuPqE&j=J?334!o|Bus>LmqiT<4NQxji-?d8k2oSW3ta`Jcm55@dEOq#uR^9 zV~W3`F~wiinBtc-UPij6@pa@I8s9{|rSS?(;=8;Jce3|+7w%!__p{C)p#BhwnO=g` o?0f`|v-8Q|TpOIm!2T4TW%lO-eI0+t=-t1BSD2H*>n!t|zcxt+aR2}S literal 0 HcmV?d00001 diff --git a/bin/com/tofvesson/api/Revealable.class b/bin/com/tofvesson/api/Revealable.class new file mode 100644 index 0000000000000000000000000000000000000000..f7e5d546d4181640775f7a5eefe5885c211c1be1 GIT binary patch literal 1405 zcmchV-%b-j6vn^l?siLCD6lP3DSs`{ZjFsZxj<7dj2dD=V+n~dF)r;2gQeTFOXCCZ zB3^l`iN?glK7cRcTZrGZ4HT$>E0Xrinc4H5J>PHk_urpw0QZnJ5fDg~y@R~(y>GeA zrdP{5b(w$Vwp^#`>{MM7y1?kZ({l1vr?#7av9s@%eG@@}>5IDcQ=vfE{aANum7;9= z0t;`71InK@WaXvTl)m(84+J8cPx>Umhq5O9f`FFEZVTv-y^0%#hLI@3h?p1^n7yRu z5Cq1fFcDH&Jc=QN1Y$*5b2kqUcHG96^2nN^S9Yq~PD84F?@;&mWK&>fz~HAgIrZ?a z>-W!{&SbA*c7(Dseq&ChvgP%6TFhMDNTCsuko<$XKtSH*c3mYa0`mh#Uq8ouxa2$K z4;xOs&+-JL)K`pO3ZBpAn`Glm$4C<`Ob1`|AqcEz}XN$v!axY=u*=c*bT z_BV`uVbX0B>>S4W#KwtuYM|IUFOClsr!d`pvxv~TGAh-ZH*6K#x%RuRHLY;_^_tmU z4Qi{#XG|u|gt4-wtD5N}O(gZwks%UBBKYa}PwuLP3X|5sWD^Yt!Jv~krZ{K{HV3=U z^$})J!Ytl$-NRhRL;*oHXpex(W;nXKw+bsmWHv#~9Pd+Op9mIki&s!O$US P$r4QN+Q2LmUI3YYL>vS{ literal 0 HcmV?d00001 diff --git a/bin/com/tofvesson/api/Type.class b/bin/com/tofvesson/api/Type.class new file mode 100644 index 0000000000000000000000000000000000000000..385c79c5bc5f47a42927783ef484e10a99531ab2 GIT binary patch literal 1120 zcmZ`%T~pIg5IvW)NgJYIl?oJ51hoxFMFBtBVPF`TVJz?v=uF0^O9?fYCY?0J>2L7Q zXnBCqk@49d<+%4!X&!7Jx_dTz_U`W4-+#Ve0a(U64MPmsTF@v)!O5A^Y6X6gH{Iev zr|D=&Fx)=nXT0cfzh2z(+YN@quIoDtn|67}RnvC7ZAG zySAdx_3NdbLN!gfSp!L^DQE&r7|;Yr2{2_KB|ut$hX&FD=mI=8phFejoPl8&3?mhq zaIf7sa>4_Cd0NN#~cn8Ybn4xAY7%FY)RZ*kIle MR%OlCcq8rGzny;P?EnA( literal 0 HcmV?d00001 diff --git a/bin/com/tofvesson/base/Map.class b/bin/com/tofvesson/base/Map.class new file mode 100644 index 0000000000000000000000000000000000000000..37ad1ce7f76ae57be5c91e7e438c8393e1a1b1c3 GIT binary patch literal 1507 zcma)4+iuf95IyU}Nty;)0)$HoO)mi_EpUqJn#X06k>McM8ro$zLdG#4AL#XG0mv*kM6Ob1_VpW$|_(0D{)Bf_JmNLX70 zY6@FMb)H7Dlz*(|wQf{n6{aV)NZI2lFua=CdlF%6lDZ|YgrQ>8>xlwl`D{S9Ri}T* zupq_vnyO!GmY5_h(R-Tj-j&+NG-nk&VW^UBQa%@28xT?(N;4p+HYAhrL|^a@gDwZ~ zi6MXN_B>0xvE_rvQE$8Q`C}dQZ0Og?0$Jq90t?71zlefbF?wHDDQk&VPswZK_1aG? z|DZs_b+Q@S2BqB~TN)+cCPnho6)_DLw@?gewrO7?Se&A$C<>#)kb<5m?u5V{@)D@A z@6tw!mm)}Qg1n2BnaGty-j*!D-K5pBjqTUBY3 gyfunchuEelO`JP;6xW;j7Q3~BOY}~6zpIeuKjvW*vj6}9 literal 0 HcmV?d00001 diff --git a/bin/com/tofvesson/base/Position.class b/bin/com/tofvesson/base/Position.class new file mode 100644 index 0000000000000000000000000000000000000000..7e8ef942c34326ec4cd4d4012bd4948ba02629a4 GIT binary patch literal 2605 zcmah}T~`xV6y2AEM8aSw0jfawYSknL)7oNDXo{lPwBQFKt+gKx$w)`T3@aI^KJ=}B zqz{!o^uf9ctX0?Y2lU_c2lQi~J3|t1SU%*=%*i?D?z8v4_pg8ddw0ZhN-t#1U2Keq?T$g{tYS6>hFRvdUf@F@=$XW#)!mC|$4F zmHkqMsP}ZkQaG{jdge0!nO2BwxOH|4Nhr;^ZmnWFrl<4P&5iIzrA2dtjk?UrBeQHd z-lFYTY^h2Lu^HR3y`sXU%o{cc`&;^ES2)C+Td@*|AY~wlUSiHudV zfs;6<5Wnj@cHAGF4v=O8aU6>ytuXX@QFGh`hLDniQ3D-F$lJJqP8bTw1x|NkbA8pS zEt{)Va@(`umd)ylS+nIk2u8i{ZE}!4G}ZxO$yqv6DjiDEBKngHjI4~DQ)p+VaG{>? z_mpF;S)M4UFp$ZHvd9~g9|a5vAunpKh51p^;R ztW)G|iC;8uN#aq7(*<`tv;3I&10rHIYs)gL3YRnYLtwUgENqO@k}el!r{nk}RJUeI z0!5?}RO^a?Ib5YSWa)BX%bO2Z%<3i~p30Q6p;%gv&b0KJH*g)FQgpLYS$3~I*)W~T zf?fBd$D2E3SER>h20oV_-MYt()+RA~&2ei)G#c8h=|?(6)f9$92y6~7Nj8sM-ST+; z^_ZnlN)L?50&=7a#zKwMs*s;dagTCca1|V5%YbYi)smc_uMBkIxExlqTHdVkPTAK* zUl$_UHwM1NcM5ME5Y0F4%+baTgs+!qX8_YC6Z0wZ-DrfIRauyK)k^DXXpy# z*v5<>oAhH-+-DmZKi22R&g)pOADeoH1ZyWn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av#Ht4IiNgrixGKSrTFuJ`N?(4sxpL!Z#7t0VYHsS}4}n$NCrWwedN8y;c+xF}#*2sV#VeH7>%u8pZPOkjN3rWA8k^ zd5yKEtD90=#J3dt=$i`1Z=h$>B7Q6~o;^mUe{mhFW2Cn=l64yVO5ytL|B!yM(e$^H z;Gu~A^`sE|Kx;*wUBIE2=NVC+Hq#iU%%rFSDU5_(_p@6CSvV0&L1`&;qrUYvdtJg{ zI0la`bl+x6RPxG;*2qo#hHsL!O)|=RovO{$jNUUSCzr{P@$}CrjWS3Dks~4t& z$tcAY%7nbvFc+|mc|Ilh%mzVRA5gIg1CJ;s|b)?LHtutg0e9!_#N zM#k=j8|dw7sL-*yzN=mn(!RMP`D#+J#JlPjv5>$SG18R$E4^7-9bp2fTM9Jm53D#u z7h2Q2_avWgoMD5PQcCKA-NK}TU#Dwu85{8|+uw8i=jeGhx)*Sk&r^7jyuFN9$nhJz z3WNJ}=f4^ygc qLucYPJBC4y4b1Xqh1B=l7OZd>=;IE5<%&A|4S(ldPS0N6`S(AyN5bm> literal 0 HcmV?d00001 diff --git a/src/com/tofvesson/api/Callback.java b/src/com/tofvesson/api/Callback.java new file mode 100644 index 0000000..05c8056 --- /dev/null +++ b/src/com/tofvesson/api/Callback.java @@ -0,0 +1,24 @@ +package com.tofvesson.api; + +public class Callback implements ICallback{ + Runnable r; + int id; + boolean trig=false; + public Callback(Runnable r){this.r=(r!=null)?r:new Runnable(){@Override public void run(){}};} + public Callback(){this(null);} + @Override + public void setCallback(int id){ + this.id=id; + trig=true; + r.run(); + } + @Override + public int getCallback() { + return id; + } + @Override + public boolean hasCallback() { + return trig; + } + +} diff --git a/src/com/tofvesson/api/Coordinate.java b/src/com/tofvesson/api/Coordinate.java new file mode 100644 index 0000000..9322f08 --- /dev/null +++ b/src/com/tofvesson/api/Coordinate.java @@ -0,0 +1,19 @@ +package com.tofvesson.api; + +public class Coordinate implements ICoordinate{ + private int x; + private int y; + + public Coordinate(int x, int y){setX(x); setY(y);} + public Coordinate(){this(0, 0);} + + @Override + public int getX() {return x;} + @Override + public int getY() {return y;} + @Override + public void setX(int x) {this.x=x;} + @Override + public void setY(int y) {this.y=y;} + +} diff --git a/src/com/tofvesson/api/ICallback.java b/src/com/tofvesson/api/ICallback.java new file mode 100644 index 0000000..6f68187 --- /dev/null +++ b/src/com/tofvesson/api/ICallback.java @@ -0,0 +1,7 @@ +package com.tofvesson.api; + +public interface ICallback { + public abstract void setCallback(int id); + public abstract int getCallback(); + public abstract boolean hasCallback(); +} diff --git a/src/com/tofvesson/api/ICoordinate.java b/src/com/tofvesson/api/ICoordinate.java new file mode 100644 index 0000000..8dc44a1 --- /dev/null +++ b/src/com/tofvesson/api/ICoordinate.java @@ -0,0 +1,16 @@ +package com.tofvesson.api; + +public interface ICoordinate { + public abstract int getX(); + public abstract int getY(); + public abstract void setX(int x); + public abstract void setY(int y); + public default void setCoordinate(ICoordinate c){ + setX(c.getX()); + setY(c.getY()); + } + public default void setCoordinate(int x, int y){ + setX(x); + setY(y); + } +} diff --git a/src/com/tofvesson/api/IGridPosition.java b/src/com/tofvesson/api/IGridPosition.java new file mode 100644 index 0000000..be07be6 --- /dev/null +++ b/src/com/tofvesson/api/IGridPosition.java @@ -0,0 +1,50 @@ +package com.tofvesson.api; + +import java.util.ArrayList; +import java.util.List; + +public interface IGridPosition { + public abstract Type getType(); + public default IGridPosition[] getAdjacentOfType(Type type){ + List i = new ArrayList<>(); + int[] posMin=getPosMin(); + int[] posMax=getPosMax(); + for(int x=posMin[0]; x i = new ArrayList<>(); + int[] posMin=getPosMin(); + int[] posMax=getPosMax(); + for(int x=posMin[0]; x getClientList(); + public abstract boolean isClientAuthenticated(int id); + abstract void handleNewClient(Socket s); + abstract void updateTasklist(); + abstract void onNewDataListener(); + abstract void handleNewData(); + abstract void challengeAuth(Socket s); + public abstract ICallback start(Runnable onFinish); + public abstract void stop(); + public abstract IMap getMap(); + public abstract void loadSubMap(Socket s, ICoordinate start, ICoordinate end); +} diff --git a/src/com/tofvesson/api/Revealable.java b/src/com/tofvesson/api/Revealable.java new file mode 100644 index 0000000..b04f170 --- /dev/null +++ b/src/com/tofvesson/api/Revealable.java @@ -0,0 +1,45 @@ +package com.tofvesson.api; + +public class Revealable implements IRevealable{ + + IGridPosition[] expandList; + IGridPosition[] NExpandList; + + public Revealable(){ + expandList=new IGridPosition[0]; + NExpandList=new IGridPosition[0]; + } + + @Override + public IGridPosition[] getExpandList() { + return expandList; + } + + @Override + public IGridPosition[] getNExpandList() { + return NExpandList; + } + + @Override + public void addToExpandList(IGridPosition[] i) { + IGridPosition[] tmp = expandList; + expandList = new IGridPosition[expandList.length+i.length]; + int i1=0; + for(IGridPosition i2 : tmp) + expandList[i1++]=i2; + for(IGridPosition i2 : i) + expandList[i1++]=i2; + } + + @Override + public void addToNExpandList(IGridPosition[] i) { + IGridPosition[] tmp = NExpandList; + NExpandList = new IGridPosition[NExpandList.length+i.length]; + int i1=0; + for(IGridPosition i2 : tmp) + NExpandList[i1++]=i2; + for(IGridPosition i2 : i) + NExpandList[i1++]=i2; + } + +} diff --git a/src/com/tofvesson/api/Type.java b/src/com/tofvesson/api/Type.java new file mode 100644 index 0000000..2f2b796 --- /dev/null +++ b/src/com/tofvesson/api/Type.java @@ -0,0 +1,5 @@ +package com.tofvesson.api; + +public enum Type { + Mine, MineFlagged, Flagged, Unknown, Open +} diff --git a/src/com/tofvesson/base/Map.java b/src/com/tofvesson/base/Map.java new file mode 100644 index 0000000..a6e4b7f --- /dev/null +++ b/src/com/tofvesson/base/Map.java @@ -0,0 +1,57 @@ +package com.tofvesson.base; + +import com.tofvesson.api.ICoordinate; +import com.tofvesson.api.IGridPosition; +import com.tofvesson.api.IMap; + +public class Map implements IMap{ + + ICoordinate size; + double genRatio; + IGridPosition[][] map; + + public Map(ICoordinate size){} + + @Override + public void generate() { + + } + + @Override + public IGridPosition[] getMap() { + return null; + } + + @Override + public ICoordinate getSize() { + return null; + } + + @Override + public IGridPosition getPosition(ICoordinate coord) { + return null; + } + + @Override + public IGridPosition getPosition(int x, int y) { + return null; + } + + @Override + public IGridPosition[][] getSubMap(ICoordinate coord1, ICoordinate coord2) { + return null; + } + + @Override + public IGridPosition[][] getSubMap(int x1, int y1, int x2, int y2) { + + return null; + } + + @Override + public boolean reveal(int x, int y) { + + return false; + } + +} diff --git a/src/com/tofvesson/base/Position.java b/src/com/tofvesson/base/Position.java new file mode 100644 index 0000000..391e2fb --- /dev/null +++ b/src/com/tofvesson/base/Position.java @@ -0,0 +1,69 @@ +package com.tofvesson.base; + +import com.tofvesson.api.Coordinate; +import com.tofvesson.api.ICoordinate; +import com.tofvesson.api.IGridPosition; +import com.tofvesson.api.IMap; +import com.tofvesson.api.IRevealable; +import com.tofvesson.api.Revealable; +import com.tofvesson.api.Type; + +public class Position implements IGridPosition { + + Type type=Type.Unknown; + ICoordinate pos=new Coordinate(); + final IMap map; + int adjacentMines; + + public Position(ICoordinate pos, IMap map){this.pos=pos; this.map=map;} + public Position(int x, int y, IMap map){this.pos=new Coordinate(x, y); this.map=map;} + + @Override + public Type getType() {return this.type;} + + @Override + public void overrideType(Type type) {this.type=type;} + + @Override + public Type flag() { + if(type==Type.Flagged) + type=Type.Unknown; + else if(type==Type.MineFlagged) + type=Type.Mine; + else if(type==Type.Unknown) + type=Type.Flagged; + else if(type==Type.Mine) + type=Type.MineFlagged; + return type; + } + + @Override + public IRevealable reveal(ICoordinate[] ignore) { + if(type==Type.Mine||type==Type.MineFlagged) + return null; + Revealable r = new Revealable(); + r.addToExpandList(getAdjacentOfValue(0)); + for(int i=1; i<9; ++i) + r.addToNExpandList(getAdjacentOfValue(i)); + return r; + } + + @Override + public IGridPosition setPos(int x, int y) { + pos = new Coordinate(x, y); + return this; + } + @Override + public ICoordinate getPos() {return pos;} + @Override + public IMap getMap() {return map;} + @Override + public int getValue() { + return adjacentMines; + } + @Override + public void calculateAdjacentMines() { + adjacentMines=getAdjacentOfType(Type.Mine).length+getAdjacentOfType(Type.MineFlagged).length; + } + +} diff --git a/src/com/tofvesson/base/Server.java b/src/com/tofvesson/base/Server.java new file mode 100644 index 0000000..6f34bf8 --- /dev/null +++ b/src/com/tofvesson/base/Server.java @@ -0,0 +1,133 @@ +package com.tofvesson.base; + +import java.io.BufferedReader; +import java.io.InputStreamReader; +import java.io.PrintWriter; +import java.net.Socket; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import com.tofvesson.api.Callback; +import com.tofvesson.api.ICallback; +import com.tofvesson.api.ICoordinate; +import com.tofvesson.api.IMap; +import com.tofvesson.api.IServerService; + +public class Server implements IServerService{ + + public boolean economicMode=false; + private int eco=0; + Thread clientListener; + Map clients; + List tasklist; + Map auth; + Callback onFinished; + boolean active=false; + final int port; + final Runnable r = new Runnable(){ + @Override + public void run() { + try{ + while(active){ + for(Socket s : clients.values()) + if(new BufferedReader(new InputStreamReader(s.getInputStream())).ready()) ; + } + }catch(Exception e){ + active=false; + onFinished.setCallback(ID_CRASH); + } + } + }; + + public Server(int port){this.port=port; active=true;} + public Server(){this(DEFAULT_PORT);} + + @Override + public void run() { + clientListener = new Thread(r); + clients = new HashMap<>(); + tasklist = new ArrayList<>(); + auth = new HashMap<>(); + } + + @Override + public String[] getTasklist() { + return (String[]) tasklist.toArray(); + } + + @Override + public Map getClientList() { + return clients; + } + + @Override + public boolean isClientAuthenticated(int id) { + return auth.get((Integer)id); + } + + @Override + public void handleNewClient(Socket s) { + updateClientList(s, false); + try{ + new PrintWriter(s.getOutputStream()).println(SRV_AUTH_CHAL); + }catch(Exception e){e.printStackTrace();} + } + + @Override + public void updateTasklist() { + + } + + @Override + public void onNewDataListener() { + + } + + @Override + public void handleNewData() { + + } + + @Override + public void challengeAuth(Socket s) { + + } + @Override + public ICallback start(Runnable onFinish) { + return onFinished = new Callback(onFinish); + } + @Override + public void stop() { + if(clientListener.isAlive()) active=false; + try{ + for(Socket s : clients.values()) + if(!s.isClosed()) + new PrintWriter(s.getOutputStream()).println(SRV_GLOBAL_STOP); + }catch(Exception e){e.printStackTrace();} + } + @Override + public IMap getMap() { + // TODO Auto-generated method stub + return null; + } + @Override + public void loadSubMap(Socket s, ICoordinate start, ICoordinate end) { + // TODO Auto-generated method stub + + } + + private void updateClientList(Socket newClient, boolean overrideEco){ + if(!economicMode || (economicMode && eco==4) || overrideEco){ + Map cli = new HashMap<>(); + int i=0; + for(Socket s : clients.values()) + if(!s.isClosed()) + cli.put(i++, s); + clients=cli; + } + clients.put(clients.size(), newClient); + if(economicMode) eco=(eco+1)%5; + } + +}