From 2451b7d78a1f0bd9df1d01f254c30a14b731688a Mon Sep 17 00:00:00 2001 From: ilotterytea Date: Mon, 7 Oct 2024 02:35:36 +0500 Subject: upd: splitToTextureRegions returns now ArrayList because default arrays fucking suck --- core/src/kz/ilotterytea/maxon/player/DecalPlayer.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'core/src/kz/ilotterytea/maxon/player') diff --git a/core/src/kz/ilotterytea/maxon/player/DecalPlayer.java b/core/src/kz/ilotterytea/maxon/player/DecalPlayer.java index 5ce2abe..d7cb680 100644 --- a/core/src/kz/ilotterytea/maxon/player/DecalPlayer.java +++ b/core/src/kz/ilotterytea/maxon/player/DecalPlayer.java @@ -11,20 +11,22 @@ import com.badlogic.gdx.math.collision.BoundingBox; import com.badlogic.gdx.math.collision.Ray; import kz.ilotterytea.maxon.MaxonGame; +import java.util.ArrayList; + public class DecalPlayer { - private final TextureRegion[] regions; + private final ArrayList regions; private int regionIndex; private final Decal decal; private final BoundingBox box; private final Savegame savegame; - public DecalPlayer(Savegame savegame, TextureRegion[] regions) { + public DecalPlayer(Savegame savegame, ArrayList regions) { this.savegame = savegame; this.regions = regions; this.regionIndex = 0; - this.decal = Decal.newDecal(this.regions[this.regionIndex]); + this.decal = Decal.newDecal(this.regions.get(this.regionIndex)); this.decal.setScale(0.025f); this.decal.setPosition(2.0f, 1.75f, 2.0f); @@ -67,11 +69,11 @@ public class DecalPlayer { private void updateTextureRegion() { this.regionIndex++; - if (this.regions[this.regionIndex] == null) { + if (this.regions.get(this.regionIndex) == null) { this.regionIndex = 0; } - this.decal.setTextureRegion(this.regions[this.regionIndex]); + this.decal.setTextureRegion(this.regions.get(this.regionIndex)); } public Decal getDecal() { -- cgit v1.2.3