diff options
| author | ilotterytea <iltsu@alright.party> | 2024-10-07 02:35:36 +0500 |
|---|---|---|
| committer | ilotterytea <iltsu@alright.party> | 2024-10-07 02:35:36 +0500 |
| commit | 2451b7d78a1f0bd9df1d01f254c30a14b731688a (patch) | |
| tree | 3d36f3c4ff1788dc7c1f43ee205e38285fc54544 /core/src/kz/ilotterytea/maxon/pets | |
| parent | 3de9d004e99851f38f8700839fa2f7aa6f1c0172 (diff) | |
upd: splitToTextureRegions returns now ArrayList because default arrays fucking suck
Diffstat (limited to 'core/src/kz/ilotterytea/maxon/pets')
| -rw-r--r-- | core/src/kz/ilotterytea/maxon/pets/Pet.java | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/core/src/kz/ilotterytea/maxon/pets/Pet.java b/core/src/kz/ilotterytea/maxon/pets/Pet.java index 7c69a0b..521df0c 100644 --- a/core/src/kz/ilotterytea/maxon/pets/Pet.java +++ b/core/src/kz/ilotterytea/maxon/pets/Pet.java @@ -11,6 +11,9 @@ import kz.ilotterytea.maxon.ui.AnimatedImage; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.util.ArrayList; +import java.util.List; + public class Pet { private final String id, name, description; private final double price, multiplier; @@ -30,7 +33,7 @@ public class Pet { public static Pet create(String id, double price, double multiplier, int iconColumns, int iconRows) { MaxonGame game = MaxonGame.getInstance(); - TextureRegion[] regions; + ArrayList<TextureRegion> regions; try { Texture texture = game.assetManager.get("sprites/pets/" + id + ".png", Texture.class); @@ -44,7 +47,7 @@ public class Pet { } catch (GdxRuntimeException e) { logger.warn("Failed to load icon spritesheet for ID {}", id); - regions = new TextureRegion[]{new TextureRegion(MaxonConstants.MISSING_TEXTURE)}; + regions = new ArrayList<>(List.of(new TextureRegion(MaxonConstants.MISSING_TEXTURE))); } AnimatedImage icon = new AnimatedImage(regions, 5); @@ -59,7 +62,7 @@ public class Pet { description = "pet." + id + ".desc"; } - Decal decal = Decal.newDecal(0.5f, 0.5f, regions[0], true); + Decal decal = Decal.newDecal(0.5f, 0.5f, regions.get(0), true); return new Pet(id, name, description, price, multiplier, icon, decal); } |
