Fill on serverworld and clear out tiles on new day
This commit is contained in:
@@ -51,6 +51,8 @@ export interface PlacedTile {
|
||||
// where the schematic's lowest corner goes, before it's turned around it
|
||||
position: Position;
|
||||
rotation: 0 | 90 | 180 | 270;
|
||||
// the blocks it takes up once it's turned, its outer walls too
|
||||
box: Box;
|
||||
}
|
||||
|
||||
// a doorway in the world, once. connected when it has a tile on both sides, otherwise it leads nowhere and gets
|
||||
@@ -131,7 +133,7 @@ export function plan_interior(rng: { next(): number }, types: TileType[], config
|
||||
}
|
||||
|
||||
// the blocks a placed tile takes up, both corners in it
|
||||
interface Box {
|
||||
export interface Box {
|
||||
min: [number, number, number];
|
||||
max: [number, number, number];
|
||||
}
|
||||
@@ -148,8 +150,9 @@ function try_plan(rng: { next(): number }, types: TileType[], config: InteriorPl
|
||||
const used = new Set<string>();
|
||||
|
||||
const add = (type: TileType, position: Position, quarters: number) => {
|
||||
tiles.push({ tile: type.id, position, rotation: quarters * 90 as PlacedTile["rotation"] });
|
||||
boxes.push(tile_box(type, position, quarters));
|
||||
const box = tile_box(type, position, quarters);
|
||||
tiles.push({ tile: type.id, position, rotation: quarters * 90 as PlacedTile["rotation"], box });
|
||||
boxes.push(box);
|
||||
if (type.one_time) used.add(type.id);
|
||||
// a marker of this tile where it is in the world
|
||||
const placed_marker = (marker: Marker) => {
|
||||
|
||||
Reference in New Issue
Block a user