Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import top.ellan.mahjong.render.snapshot.TableRenderSnapshot;
import top.ellan.mahjong.render.snapshot.TableSeatRenderSnapshot;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.EnumMap;
import java.util.List;
Expand Down Expand Up @@ -195,11 +196,8 @@ private static List<TilePlacement> precomputeWall(Point displayCenter, TableRend
}

List<DeadWallPlacement> deadWallPlacements = deadWallPlacements(displayCenter, snapshot);
List<TilePlacement> placements = new ArrayList<>(TOTAL_WALL_TILES);
List<TilePlacement> placements = Arrays.asList(new TilePlacement[TOTAL_WALL_TILES]);
boolean[] occupiedSlots = new boolean[TOTAL_WALL_TILES];
for (int i = 0; i < TOTAL_WALL_TILES; i++) {
placements.add(null);
}
int breakTileIndex = wallBreakTileIndex(snapshot);
int firstLiveWallSlot = Math.floorMod(breakTileIndex + frontDrawCount, TOTAL_WALL_TILES);
int wallSlot = firstLiveWallSlot;
Expand Down Expand Up @@ -229,7 +227,7 @@ private static List<TilePlacement> precomputeWall(Point displayCenter, TableRend
Point point = settledWallPoint(placement.point(), placement.wallSlot(), occupiedSlots, WALL_TILES_PER_SIDE);
placements.set(placement.wallSlot(), new TilePlacement(point, placement.yaw(), MahjongTile.UNKNOWN, DisplayEntities.TileRenderPose.FLAT_FACE_DOWN));
}
return Collections.unmodifiableList(new ArrayList<>(placements));
return Collections.unmodifiableList(placements);
}

private static List<TilePlacement> precomputeLiveWallWithoutDeadWall(Point displayCenter, TableRenderSnapshot snapshot) {
Expand All @@ -242,11 +240,8 @@ private static List<TilePlacement> precomputeLiveWallWithoutDeadWall(Point displ
);
int frontDrawCount = wallCapacity - remainingWallCount - supplementDrawCount;
int breakTileIndex = wallBreakTileIndex(snapshot);
List<TilePlacement> placements = new ArrayList<>(wallCapacity);
List<TilePlacement> placements = Arrays.asList(new TilePlacement[wallCapacity]);
boolean[] occupiedSlots = new boolean[wallCapacity];
for (int i = 0; i < wallCapacity; i++) {
placements.add(null);
}
int firstLiveWallSlot = Math.floorMod(breakTileIndex + frontDrawCount, wallCapacity);
int wallSlot = firstLiveWallSlot;
for (int i = 0; i < remainingWallCount; i++) {
Expand All @@ -261,7 +256,7 @@ private static List<TilePlacement> precomputeLiveWallWithoutDeadWall(Point displ
placements.set(wallSlot, new TilePlacement(point, seatYaw(wind), MahjongTile.UNKNOWN, DisplayEntities.TileRenderPose.FLAT_FACE_DOWN));
wallSlot = nextWallSlot(wallSlot, wallCapacity);
}
return Collections.unmodifiableList(new ArrayList<>(placements));
return Collections.unmodifiableList(placements);
}

private static int exposedFlowerCount(TableRenderSnapshot snapshot) {
Expand Down
Loading