This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // adapted from: https://github.com/vpoupet/wolfenstein/blob/master/js/files.js | |
| class GameData { | |
| private declare VSWAP: DataView; | |
| private declare MAPHEAD: ArrayBuffer; | |
| private declare GAMEMAPS: ArrayBuffer; | |
| private declare wallTexturesOffset: number; | |
| private declare plane0: Uint16Array; | |
| private declare plane1: Uint16Array; | |
| private declare plane2: boolean[][]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* eslint-disable @typescript-eslint/no-inferrable-types */ | |
| import { SessionListService } from "$stores/list/sessionList"; | |
| import { tweened } from "svelte/motion"; | |
| import { sort, type PlayerFormats } from "./parsers/player"; | |
| import { isAppleMobileDevice } from "./utils/browserDetection"; | |
| import { browser } from "$app/environment"; | |
| import type { UserSettings } from "$stores/settings"; | |
| import { get, writable } from "svelte/store"; | |
| import { settings, type ISessionListProvider } from "./stores"; | |
| import { groupSession, type ConnectionState } from "./stores/sessions"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import {CurrentLevel} from '../../routes/editor/components/Level.svelte'; | |
| import type { Position, Position2D } from "$lib/types/position"; | |
| import { writable } from "svelte/store"; | |
| export const PlayerState = _playerState(); | |
| export type ButtonsPressed = { | |
| w: boolean; | |
| a: boolean; | |
| s: boolean; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import type { Position } from '$lib/types/position'; | |
| import { writable } from 'svelte/store'; | |
| export const PlayerState = _playerState(); | |
| export type ButtonsPressed = { | |
| forward: boolean; | |
| backward: boolean; | |
| strafeLeft: boolean; | |
| strafeRight: boolean; | |
| turnLeft: boolean; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <script lang="ts"> | |
| import Door from '$lib/components/Door.svelte'; | |
| import Guard from '$lib/components/Guard/Guard.svelte'; | |
| import Player from '$lib/components/Player.svelte'; | |
| import Wall from '$lib/components/Wall.svelte'; | |
| import { PlayerState } from '$lib/stores/player'; | |
| import type { Position } from '$lib/types/position'; | |
| import type { World } from '$lib/utils/map'; | |
| import { objectKeys } from '$lib/utils/object'; | |
| import { getDistanceFromPoints } from '$lib/utils/position'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * PromisePool limits the number of concurrent executions for any given task. | |
| * | |
| * @example | |
| * ```ts | |
| * import { PromisePool, InlineThread } from 'nanothreads'; | |
| * | |
| * const handle = new InlineThread({ | |
| * task: (a, b) => a * b | |
| * }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <svelte:options accessors={true} /> | |
| <script context="module" lang="ts"> | |
| export const DIRECTION_MAP: Record<string, number> = { | |
| front: 180, | |
| left: 90, | |
| back: 0, | |
| right: 270 | |
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * TODO: clean this module up massively. | |
| * | |
| * - Use class instead of func impl (...?) | |
| * | |
| */ | |
| import type { Artist, ArtistInfo, Item, Song, Subtitle, Thumbnail } from "$lib/types"; | |
| import { Logger, addToQueue, getSrc, notify, seededShuffle, type ResponseBody } from "$lib/utils"; | |
| import { Mutex } from "$lib/utils/sync"; | |
| import { splice } from "$lib/utils/collections/array"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <svelte:options | |
| immutable={true} | |
| accessors={true} | |
| /> | |
| <script | |
| context="module" | |
| lang="ts" | |
| > | |
| import { currentTrack, queuePosition } from "$lib/stores/list"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| type MixListAppendOp = [op: "append" | "set", data: ISessionListProvider["mix"]]; | |
| class ListService implements ISessionListService { | |
| private $: Writable<ISessionListProvider>; | |
| private state: ISessionListProvider = { | |
| clickTrackingParams: "", | |
| continuation: "", | |
| currentMixId: "", | |
| currentMixType: null, | |
| visitorData: "", |