From 80ab9c9f23a0efa805c7f7934da0dd905ae35edc Mon Sep 17 00:00:00 2001 From: "sigonasr2, Sig, Sigo" Date: Thu, 23 Sep 2021 04:34:36 +0000 Subject: [PATCH] Add sorted block gets on row and col blocks --- Meteo_Engine.jar | Bin 12431 -> 13094 bytes src/sig/BlockClump.java | 8 +++++++- src/sig/Board.java | 11 ++++------- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/Meteo_Engine.jar b/Meteo_Engine.jar index 77cac55ce18f44b76a8ec996361a5d2310e26633..1e43711c50a7af1ce9e6447242fea8b6925f9713 100644 GIT binary patch delta 6043 zcmZ9QbyO5k*Y1%936UO38e!;81tetX98$WGp_@Ts7-FcQyGsNCkwzLuT0&`t?iLUb zufBKPb>HvXf9z*HYoF(={patTM5}UpB5e>BHU$PgK0XEkTQZR}=HLFh{cmr?eKdph zSCKs=bWlZCA2$e}jjNTHSD6ukzy2)c!>X&hPyidVP*Nn(BW!w(mtYE>N0Dq{SOky4 zG0W!yP%Y7OYH>gc8%&yw`B)1 z6Fa%DP{EC{Mt7>gh};fCn5nIQUhc9<{D&3|*zex+z#@jzo@j9jG(rL#DUKdf%1mg! zIW_DUi(d4ogjcv{pcxc`Dn53A2HHb50~57ZcZDGg%C+Fsi);pIsZT!{Ut6A|wHqbq=&{Ssp^)<)m-59=z^xUH(D;)ODTMN)V zfOT%xO*iG0yV;4Bw=Z4l6)=(AdRq;LvL|>VJ3G4<-THk>+eS!jRV~Mcz{UpZ9-X{U z?brW0Ytnu{PnI{ZptB&a&gRpdaTN0QuDHz!d^u=!vgZLg_Tko?dLavFB5@M=0hLpT z#=k3m9-)zJe_v?S z%5JNt)uvHT7?xRpe62r~uAZelxZ~|&4f0G32Zf_C_sbK@EX}~>Zt;p0n+M@6)UMK6ljWPO_obhmKFF0Oelm(BC-HR+5Slg0T4>@6 zH|odo=xk=Kp5Vp~o_mUu#;SwBrs;woT0bv5RgF0qO150E=WQGQr9fqA+VEo5sRr>H zm9gCod{P6*o*L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=TQBpeC&@g%Kwl&V}UD+$XbiD|6BRo0qWqvF7n?mZgMF75&x%4)SoW@ d>6(=LAM*buhNDFov8H+9_adx#8vK79{0~&0N#p getBlocks() { return blocks; } + public List getSortedBlocksOnRow(int row) { + return getBlocks().stream().filter((block)->block.y==row).sorted((b1,b2)->b1.x-b2.x).collect(Collectors.toList()); + } + public List getSortedBlocksOnCol(int col) { + return getBlocks().stream().filter((block)->block.x==col).sorted((b1,b2)->b1.y-b2.y).collect(Collectors.toList()); + } private void updateBlockCollisionRangeWithBlock(Block b) { if (collisionColumnRanges[b.x][0]==-1||collisionColumnRanges[b.x][0]>b.y) { collisionColumnRanges[b.x][0]=b.y; diff --git a/src/sig/Board.java b/src/sig/Board.java index 9757332..e20b23a 100644 --- a/src/sig/Board.java +++ b/src/sig/Board.java @@ -112,13 +112,10 @@ public class Board { //Start from one block and work our way across, seeing if we can make a match of 3 or more. Go to the next row, repeat. Then do the columns. Once all blocks marked for ignition, ignite them and send them. //Lowest block is used as the block clump starting point. for (int y=0;y bl = blocks.getBlocks().stream().filter((block)->block.x==xx&&block.y==yy).collect(Collectors.toList()); - if (bl.size()>0) { - //System.out.println("Found a block at ("+x+","+y+")"); - } - } + System.out.println(blocks.getSortedBlocksOnRow(y)); + } + for (int x=0;x