Skip to content
Merged
Show file tree
Hide file tree
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
4 changes: 3 additions & 1 deletion fission/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,6 @@ dist-ssr
yarn.lock

test-results
src/test/**/__screenshots__
src/test/**/__screenshots__

tsconfig.tsbuildinfo
2 changes: 1 addition & 1 deletion fission/src/mirabuf/ProtectedZoneSceneObject.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import Jolt from "@azaleacolburn/jolt-physics"
import * as THREE from "three"
import MatchMode from "@/systems/match_mode/MatchMode"
import { MatchModeType } from "@/systems/match_mode/MatchModeTypes"
import { ScoreTracker } from "@/systems/match_mode/ScoreTracker.ts"
import ScoreTracker from "@/systems/match_mode/ScoreTracker"
import { OnContactAddedEvent, OnContactPersistedEvent, OnContactRemovedEvent } from "@/systems/physics/ContactEvents"
import PreferencesSystem from "@/systems/preferences/PreferencesSystem"
import type { ProtectedZonePreferences } from "@/systems/preferences/PreferenceTypes"
Expand Down
2 changes: 1 addition & 1 deletion fission/src/mirabuf/ScoringZoneSceneObject.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Jolt from "@azaleacolburn/jolt-physics"
import * as THREE from "three"
import { ScoreTracker } from "@/systems/match_mode/ScoreTracker.ts"
import ScoreTracker from "@/systems/match_mode/ScoreTracker"
import { OnContactAddedEvent, OnContactRemovedEvent } from "@/systems/physics/ContactEvents"
import PreferencesSystem from "@/systems/preferences/PreferencesSystem"
import type { ScoringZonePreferences } from "@/systems/preferences/PreferenceTypes"
Expand Down
2 changes: 1 addition & 1 deletion fission/src/systems/World.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as THREE from "three"
import { ScoreTracker } from "@/systems/match_mode/ScoreTracker.ts"
import ScoreTracker from "@/systems/match_mode/ScoreTracker"
import { PerformanceMonitoringSystem } from "@/systems/PerformanceMonitor.ts"
import AnalyticsSystem, { type AccumTimes } from "./analytics/AnalyticsSystem"
import InputSystem from "./input/InputSystem"
Expand Down
2 changes: 1 addition & 1 deletion fission/src/systems/match_mode/MatchMode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import MatchEnd from "@/assets/sound-files/MatchEnd.wav"
import MatchResume from "@/assets/sound-files/MatchResume.wav"
import MatchStart from "@/assets/sound-files/MatchStart.wav"
import DefaultMatchModeConfigs from "@/systems/match_mode/DefaultMatchModeConfigs.ts"
import { ScoreTracker } from "@/systems/match_mode/ScoreTracker.ts"
import ScoreTracker from "@/systems/match_mode/ScoreTracker"
import World from "@/systems/World.ts"
import { globalOpenModal } from "@/ui/components/GlobalUIControls"
import MatchResultsModal from "@/ui/modals/MatchResultsModal"
Expand Down
4 changes: 2 additions & 2 deletions fission/src/systems/match_mode/RobotDimensionTracker.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ScoreTracker } from "@/systems/match_mode/ScoreTracker.ts"
import World from "@/systems/World.ts"
import ScoreTracker from "@/systems/match_mode/ScoreTracker"
import World from "@/systems/World"
import MatchMode from "./MatchMode"

const BUFFER_HEIGHT = 0.1
Expand Down
2 changes: 1 addition & 1 deletion fission/src/systems/match_mode/ScoreTracker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { OnScoreChangedEvent } from "@/mirabuf/ScoringZoneSceneObject.ts"
import type { Alliance } from "@/systems/preferences/PreferenceTypes.ts"
import World from "@/systems/World.ts"

export class ScoreTracker {
export default class ScoreTracker {
private static _redScore: number = 0
private static _blueScore: number = 0
private static _perRobotScore: Map<MirabufSceneObject, number>
Expand Down
2 changes: 1 addition & 1 deletion fission/src/systems/multiplayer/MessageHandlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { ProgressHandle } from "@/components/ProgressNotificationData.ts"
import MirabufCachingService from "@/mirabuf/MirabufLoader"
import MirabufSceneObject, { createMirabuf } from "@/mirabuf/MirabufSceneObject"
import type { mirabuf } from "@/proto/mirabuf"
import { ScoreTracker } from "@/systems/match_mode/ScoreTracker.ts"
import ScoreTracker from "@/systems/match_mode/ScoreTracker"
import { globalAddToast } from "@/ui/components/GlobalUIControls"
import JOLT from "@/util/loading/JoltSyncLoader"
import MatchMode from "../match_mode/MatchMode"
Expand Down
13 changes: 3 additions & 10 deletions fission/src/test/RobotDimensionsTracker.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { afterEach, beforeEach, describe, expect, test, vi } from "vitest"
import { MiraType } from "@/mirabuf/MirabufLoader"
import MirabufSceneObject from "@/mirabuf/MirabufSceneObject"
import RobotDimensionTracker from "@/systems/match_mode/RobotDimensionTracker"
import { ScoreTracker } from "@/systems/match_mode/ScoreTracker.ts"
import ScoreTracker from "@/systems/match_mode/ScoreTracker"
import World from "@/systems/World"

interface MockDimensions {
Expand Down Expand Up @@ -62,11 +62,7 @@ type RecursivePartial<T> = {

vi.mock("@/systems/World", (): { default: RecursivePartial<typeof World> } => ({
default: {
sceneRenderer: {
mirabufSceneObjects: {
getRobots: vi.fn(),
},
},
getOwnRobots: vi.fn(),
},
}))

Expand Down Expand Up @@ -122,10 +118,7 @@ describe("RobotDimensionTracker", () => {
update: vi.fn(),
dispose: vi.fn(),
}
;(World.sceneRenderer.mirabufSceneObjects.getRobots as ReturnType<typeof vi.fn>).mockReturnValue([
mockRobot1,
mockRobot2,
])
;(World.getOwnRobots as ReturnType<typeof vi.fn>).mockReturnValue([mockRobot1, mockRobot2])
})

afterEach(() => {
Expand Down
2 changes: 1 addition & 1 deletion fission/src/test/mirabuf/FieldMiraEditor.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ describe("Devtool Scoring Zones Caching Tests", () => {

describe("Asset tests", () => {
test("FRC Field 2018_v13 has spawn locations", async () => {
const file = await MirabufCachingService.cacheRemote("/api/mira/Fields/FRC Field 2018_v13.mira", MiraType.FIELD)
const file = await MirabufCachingService.cacheRemote("/api/mira/fields/FRC Field 2018_v13.mira", MiraType.FIELD)
.then(x => MirabufCachingService.get(x!.hash))
.catch(e => {
console.error("Could not get mirabuf file", e)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { afterEach, beforeEach, describe, expect, test, vi } from "vitest"
import { MiraType } from "@/mirabuf/MirabufLoader"
import { ContactType } from "@/mirabuf/ZoneTypes"
import { MatchModeType } from "@/systems/match_mode/MatchModeTypes"
import { ScoreTracker } from "@/systems/match_mode/ScoreTracker.ts"
import ScoreTracker from "@/systems/match_mode/ScoreTracker"
import type { ProtectedZonePreferences } from "@/systems/preferences/PreferenceTypes"
import type MirabufSceneObject from "../../mirabuf/MirabufSceneObject"
import ProtectedZoneSceneObject from "../../mirabuf/ProtectedZoneSceneObject"
Expand Down
2 changes: 1 addition & 1 deletion fission/src/test/mirabuf/ScoringZoneSceneObject.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type Jolt from "@azaleacolburn/jolt-physics"
import { afterEach, beforeEach, describe, expect, test, vi } from "vitest"
import { ScoreTracker } from "@/systems/match_mode/ScoreTracker.ts"
import ScoreTracker from "@/systems/match_mode/ScoreTracker"
import type MirabufSceneObject from "../../mirabuf/MirabufSceneObject"
import ScoringZoneSceneObject, { OnScoreChangedEvent } from "../../mirabuf/ScoringZoneSceneObject"
import { createBodyMock } from "../mocks/jolt"
Expand Down
2 changes: 1 addition & 1 deletion fission/src/test/scene/SceneInteractionHandler.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ describe("ScreenInteractionHandler", () => {
expect(mockElement.addEventListener).toHaveBeenCalledWith("pointerup", expect.any(Function))
expect(mockElement.addEventListener).toHaveBeenCalledWith("pointercancel", expect.any(Function))
expect(mockElement.addEventListener).toHaveBeenCalledWith("pointerleave", expect.any(Function))
expect(mockElement.addEventListener).toHaveBeenCalledWith("touchmove", expect.any(Function))
expect(mockElement.addEventListener).toHaveBeenCalledWith("touchmove", expect.any(Function), expect.any(Object))
})

test("dispose removes event listeners", () => {
Expand Down
2 changes: 1 addition & 1 deletion fission/src/ui/components/Scoreboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import Draggable from "react-draggable"
import { OnScoreChangedEvent } from "@/mirabuf/ScoringZoneSceneObject"
import MatchMode, { UpdateTimeLeft } from "@/systems/match_mode/MatchMode"
import { MatchModeType } from "@/systems/match_mode/MatchModeTypes"
import { ScoreTracker } from "@/systems/match_mode/ScoreTracker.ts"
import ScoreTracker from "@/systems/match_mode/ScoreTracker"
import Label from "./Label"

const showTime = () => {
Expand Down
2 changes: 1 addition & 1 deletion fission/src/ui/modals/MatchResultsModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Divider, Stack, styled, Typography } from "@mui/material"
import type React from "react"
import { useEffect } from "react"
import MatchMode from "@/systems/match_mode/MatchMode"
import { ScoreTracker } from "@/systems/match_mode/ScoreTracker.ts"
import ScoreTracker from "@/systems/match_mode/ScoreTracker"
import { useThemeContext } from "@/ui/helpers/ThemeProviderHelpers.ts"
import Label from "../components/Label"
import type { ModalImplProps } from "../components/Modal"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { getSpotlightAssembly } from "@/mirabuf/MirabufSceneObject"
import InputSchemeManager from "@/systems/input/InputSchemeManager"
import InputSystem from "@/systems/input/InputSystem"
import { InputSchemeUseType } from "@/systems/input/InputTypes"
import { ScoreTracker } from "@/systems/match_mode/ScoreTracker.ts"
import ScoreTracker from "@/systems/match_mode/ScoreTracker"
import { PAUSE_REF_ASSEMBLY_MOVE } from "@/systems/physics/PhysicsTypes"
import type { Alliance, Station } from "@/systems/preferences/PreferenceTypes"
import SynthesisBrain from "@/systems/simulation/synthesis_brain/SynthesisBrain"
Expand Down
Loading