From 7a0cc579b69088913c6a43bc7fedcf152844dc5e Mon Sep 17 00:00:00 2001 From: Justin Senn Date: Mon, 6 Feb 2023 16:28:35 +0100 Subject: [PATCH] update --- src/main/java/Snake/SnakeView.java | 10 ++++++++++ target/classes/Snake/SnakeView.class | Bin 635 -> 1332 bytes 2 files changed, 10 insertions(+) diff --git a/src/main/java/Snake/SnakeView.java b/src/main/java/Snake/SnakeView.java index 847cff4..89c10aa 100644 --- a/src/main/java/Snake/SnakeView.java +++ b/src/main/java/Snake/SnakeView.java @@ -15,6 +15,16 @@ public class SnakeView implements Drawable{ this.cellSize = cellSize; } + public void setPositions(ArrayList newPositions) + { + positions.clear(); + for(var newPosition : newPositions) + { + Point positionInGrid = newPosition; + positions.add(new Point((int)positionInGrid.getX()*cellSize, + (int)positionInGrid.getY()*cellSize)); + } + } @Override public void draw(Graphics g) { diff --git a/target/classes/Snake/SnakeView.class b/target/classes/Snake/SnakeView.class index 7921841d3c29c3deb9b030221ac20ecd40bf5704..4d43df80e6363d99502e6c8ad8659d2cd6007594 100644 GIT binary patch literal 1332 zcmZux%Tg0T6g>?gL&5+dgg44Vkt96g3q^t`55Y)4s-h_DnlJ?oaY9W75kJDcU*Os* zfl{h0H*Q?|IhLiKo)Cx>i`=<=`##P+eQ$pJ`SKOOeJlo1fl32D6IJjFgtp{snaD|d zBk^=?%gVX}{&8h1cS4{t8e29{EzsyW?Yb(Lm~Ao2m_S?)W9@QYoZSI0`(bN zZd(aYE-PzKAh44!C|Bj}fknAnl;L*Y|fI7 zwzQgPLpxoSYdO-*I|9woSXt)Oi9K0^PFyl@*+dt*1;S^=OD+P&rYtO4Z`d?@UDXl2 zCa&PBfY0{Kky7q5hLQ%Z3DkM{j6O$?RHE839I z++Sx`(Nrq7th>5t;udZ*M6R!ssA#dD@|v+#19w=p$ncCK_vBiRJOwgp!0l&d|&`a%WRz3m$B-!7aGpP9T`c?>bp)R_WI$K93&# zVLcw`;c!<#V1zQPXPi4&p?8J0yPiIZO6pa(M>$5zbDk^sZHga3#E)UD93gOkV7%i1 zp^sijk}?b*Wi6#nR*wim7^kJV7|cbV;E8FxqFg6Dz(d~Y5Mo}j}68mE6RcVQA!)VdI*#}s=ftW)swnDLl;M61ab^xX_b zsm)R+v%mG9Pv?9)nlY6b)O^rX)47TZGJCHcNtaUw3;BcdEN`8y}*Tku7?_> delta 185 zcmdnO^_zw3)W2Q(7#J9A8B`{6tz>3r5S@ICapq(N=6H1x1||j}AQT2lGcoWn@G~$n zh=JMSKt3Y_D}w}(l$^YbS&dO@@>yo_3~8XO7*LLZL6kv;K^91ZSRfM^fl!V?9;6;9 lW(ve0Rg4?K3@ISV29yG6Mi{{eH-eEtfk6>$gc4Z2G5|#X5nccQ