Skip to content

Commit

Permalink
Tilemap updates (assets)
Browse files Browse the repository at this point in the history
  • Loading branch information
TheRealEmissions committed Mar 19, 2024
1 parent 497fe44 commit bf71adf
Show file tree
Hide file tree
Showing 12 changed files with 20 additions and 225 deletions.
2 changes: 1 addition & 1 deletion assets/map/bird_common_black_animations.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<tileset version="1.10" tiledversion="1.10.2" name="bird_common_black_animations" tilewidth="16" tileheight="16" tilecount="32" columns="4">
<image source="animals/bird_common_black_animations.png" width="64" height="128"/>
<image source="../../Downloads/town full/animals/bird_common_black_animations.png" width="64" height="128"/>
</tileset>
4 changes: 0 additions & 4 deletions assets/map/bird_robin_animations.tsx

This file was deleted.

2 changes: 1 addition & 1 deletion assets/map/buildings.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<tileset version="1.10" tiledversion="1.10.2" name="buildings" tilewidth="16" tileheight="16" tilecount="5472" columns="72">
<image source="buildings/buildings_all.png" width="1152" height="1216"/>
<image source="../../Downloads/town full/buildings/buildings_all.png" width="1152" height="1216"/>
</tileset>
2 changes: 1 addition & 1 deletion assets/map/cosy_town_tiles.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<tileset version="1.10" tiledversion="1.10.2" name="tiles" tilewidth="16" tileheight="16" tilecount="3015" columns="45">
<image source="tiles/tiles.png" width="720" height="1072"/>
<image source="../../Downloads/town full/tiles/tiles.png" width="720" height="1072"/>
</tileset>
2 changes: 1 addition & 1 deletion assets/map/interior.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<tileset version="1.10" tiledversion="1.10.2" name="interior" tilewidth="16" tileheight="16" tilecount="9035" columns="139">
<image source="interior/interior.png" width="2224" height="1040"/>
<image source="../../Downloads/town full/interior/interior.png" width="2224" height="1040"/>
</tileset>
4 changes: 0 additions & 4 deletions assets/map/items_inventory.tsx

This file was deleted.

202 changes: 0 additions & 202 deletions assets/map/map.tmx

This file was deleted.

5 changes: 2 additions & 3 deletions core/src/uk/ac/york/student/assets/skins/SkinManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
import com.badlogic.gdx.scenes.scene2d.ui.Skin;
import lombok.Getter;
import lombok.experimental.UtilityClass;
import uk.ac.york.student.utils.EnumSupplierMap;
import uk.ac.york.student.utils.SupplierMap;
import uk.ac.york.student.utils.EnumMapOfSuppliers;

import java.util.function.Supplier;

Expand All @@ -14,7 +13,7 @@ public class SkinManager {
private static final Supplier<Skin> craftacular = () -> new Skin(Gdx.files.internal("skins/craftacular/skin/craftacular-ui.json"));

@Getter
private static final EnumSupplierMap<Skins, Skin> skins = new EnumSupplierMap<>(Skins.class);
private static final EnumMapOfSuppliers<Skins, Skin> skins = new EnumMapOfSuppliers<>(Skins.class);

static {
skins.put(Skins.CRAFTACULAR, craftacular);
Expand Down
4 changes: 2 additions & 2 deletions core/src/uk/ac/york/student/audio/sound/SoundManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import lombok.Getter;
import uk.ac.york.student.audio.AudioManager;
import uk.ac.york.student.audio.sound.elements.ButtonClickSound;
import uk.ac.york.student.utils.EnumSupplierMap;
import uk.ac.york.student.utils.EnumMapOfSuppliers;

import java.util.EnumMap;
import java.util.function.Supplier;
Expand All @@ -22,7 +22,7 @@ public class SoundManager implements AudioManager {
@Getter
private static final EnumMap<Sounds, GameSound> sounds = new EnumMap<>(Sounds.class);
@Getter
private static final EnumSupplierMap<Sounds, GameSound> supplierSounds = new EnumSupplierMap<>(Sounds.class);
private static final EnumMapOfSuppliers<Sounds, GameSound> supplierSounds = new EnumMapOfSuppliers<>(Sounds.class);
static {
sounds.put(Sounds.BUTTON_CLICK, buttonClickSound.get());
supplierSounds.put(Sounds.BUTTON_CLICK, buttonClickSound);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
import java.util.EnumMap;
import java.util.function.Supplier;

public class EnumSupplierMap<T extends Enum<T>, U> extends EnumMap<T, Supplier<U>> {
public EnumSupplierMap(Class<T> keyType) {
public class EnumMapOfSuppliers<T extends Enum<T>, U> extends EnumMap<T, Supplier<U>> {
public EnumMapOfSuppliers(Class<T> keyType) {
super(keyType);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import java.util.HashMap;
import java.util.function.Supplier;

public class SupplierMap<T, U> extends HashMap<T, Supplier<U>> {
public class MapOfSuppliers<T, U> extends HashMap<T, Supplier<U>> {
public U getResult(T key) {
Supplier<U> uSupplier = get(key);
return uSupplier == null ? null : uSupplier.get();
Expand Down
12 changes: 9 additions & 3 deletions core/src/uk/ac/york/student/utils/Wait.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package uk.ac.york.student.utils;

import com.badlogic.gdx.Gdx;
import lombok.experimental.UtilityClass;
import org.jetbrains.annotations.Contract;
import org.jetbrains.annotations.NotNull;
Expand All @@ -8,18 +9,23 @@
import java.util.concurrent.TimeUnit;

@UtilityClass
public class Wait {
public final class Wait {
public static void sync(long time, @NotNull TimeUnit timeUnit) {
try {
timeUnit.sleep(time);
} catch (InterruptedException e) {
e.printStackTrace();
Gdx.app.error("Wait", "Interrupted", e);
}
}

@Contract("_, _ -> new")
public static @NotNull CompletableFuture<Void> async(long time, @NotNull TimeUnit timeUnit) {
return CompletableFuture.runAsync(() -> sync(time, timeUnit));
return CompletableFuture
.runAsync(() -> sync(time, timeUnit))
.exceptionally(e -> {
Gdx.app.error("Wait", "Async Exception", e);
return null;
});
}

public static void asyncBlocking(long time, TimeUnit timeUnit) {
Expand Down

0 comments on commit bf71adf

Please sign in to comment.