Skip to content

Commit

Permalink
[FIX] Formatting issues
Browse files Browse the repository at this point in the history
  • Loading branch information
doc-bok committed Dec 8, 2023
1 parent b9e2411 commit 1034d99
Showing 1 changed file with 26 additions and 17 deletions.
43 changes: 26 additions & 17 deletions src/main/java/com/bokmcdok/butterflies/world/ButterflyData.java
Expand Up @@ -29,16 +29,37 @@ public enum Speed {
public static int LIFESPAN_MEDIUM = 24000 * 4;
public static int LIFESPAN_LONG = 24000 * 7;

// Helper maps.
private static final Map<String, Integer> ENTITY_ID_TO_INDEX_MAP = new HashMap<>();
private static final Map<Integer, Entry> BUTTERFLY_ENTRIES = new HashMap<>();

/**
* Class to hold all the data for a specific butterfly.
*/
public static class Entry {
public final String entityId;
public final Size size;
public final Speed speed;

public final int caterpillarLifespan;
public final int chrysalisLifespan;
public final int butterflyLifespan;

/**
* Construction
* @param entityId The id of the butterfly species.
* @param size The size of the butterfly.
* @param speed The speed of the butterfly.
* @param caterpillarLifespan How long it remains in the caterpillar stage.
* @param chrysalisLifespan How long it takes for a chrysalis to hatch.
* @param butterflyLifespan How long it lives as a butterfly.
*/
private Entry(String entityId,
Size size,
Speed speed,
int caterpillarLifespan,
int chrysalisLifespan,
int butterflyLifespan) {
Size size,
Speed speed,
int caterpillarLifespan,
int chrysalisLifespan,
int butterflyLifespan) {
this.entityId = entityId;
this.size = size;
this.speed = speed;
Expand All @@ -47,20 +68,8 @@ private Entry(String entityId,
this.chrysalisLifespan = chrysalisLifespan;
this.butterflyLifespan = butterflyLifespan * 2;
}

public final String entityId;
public final Size size;
public final Speed speed;

public final int caterpillarLifespan;
public final int chrysalisLifespan;
public final int butterflyLifespan;
}

// Helper maps.
private static final Map<String, Integer> ENTITY_ID_TO_INDEX_MAP = new HashMap<>();
private static final Map<Integer, Entry> BUTTERFLY_ENTRIES = new HashMap<>();

/**
* Create new butterfly data.
* @param index The butterfly index.
Expand Down

0 comments on commit 1034d99

Please sign in to comment.