diff --git a/docker-compose.yml b/docker-compose.yml index 1e9fa7a..178df74 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -3,9 +3,9 @@ version: '3.8' services: shattered_kingdom_client: - image: bastianwagner/stellar_lines_client:latest + image: bastianwagner/stellar-lines:latest pull_policy: always - container_name: stellar_lines_client + container_name: stellar-lines ports: - "3900:80" diff --git a/public/sprites/buildings/harbour-1.png b/public/sprites/buildings/harbour-1.png new file mode 100644 index 0000000..60f3174 Binary files /dev/null and b/public/sprites/buildings/harbour-1.png differ diff --git a/public/sprites/buildings/harbour-old.png b/public/sprites/buildings/harbour-old.png new file mode 100644 index 0000000..dc61f9a Binary files /dev/null and b/public/sprites/buildings/harbour-old.png differ diff --git a/public/sprites/buildings/harbour.png b/public/sprites/buildings/harbour.png index dc61f9a..006a804 100644 Binary files a/public/sprites/buildings/harbour.png and b/public/sprites/buildings/harbour.png differ diff --git a/public/sprites/buildings/spaceship-launch-place.png b/public/sprites/buildings/spaceship-launch-place.png new file mode 100644 index 0000000..d39dde8 Binary files /dev/null and b/public/sprites/buildings/spaceship-launch-place.png differ diff --git a/public/sprites/planets/arboris-old.png b/public/sprites/planets/arboris-old.png new file mode 100644 index 0000000..adcb8f3 Binary files /dev/null and b/public/sprites/planets/arboris-old.png differ diff --git a/public/sprites/planets/arboris.png b/public/sprites/planets/arboris.png new file mode 100644 index 0000000..1f632c0 Binary files /dev/null and b/public/sprites/planets/arboris.png differ diff --git a/public/sprites/planets/aurora.png b/public/sprites/planets/aurora.png new file mode 100644 index 0000000..41f6c90 Binary files /dev/null and b/public/sprites/planets/aurora.png differ diff --git a/public/sprites/planets/borealis.png b/public/sprites/planets/borealis.png new file mode 100644 index 0000000..a2ea08c Binary files /dev/null and b/public/sprites/planets/borealis.png differ diff --git a/public/sprites/planets/celestia.png b/public/sprites/planets/celestia.png new file mode 100644 index 0000000..62b3d7e Binary files /dev/null and b/public/sprites/planets/celestia.png differ diff --git a/public/sprites/planets/crystallia.png b/public/sprites/planets/crystallia.png new file mode 100644 index 0000000..79f4b20 Binary files /dev/null and b/public/sprites/planets/crystallia.png differ diff --git a/public/sprites/planets/draco.png b/public/sprites/planets/draco.png new file mode 100644 index 0000000..c321e5b Binary files /dev/null and b/public/sprites/planets/draco.png differ diff --git a/public/sprites/planets/dryad.png b/public/sprites/planets/dryad.png new file mode 100644 index 0000000..5a306fd Binary files /dev/null and b/public/sprites/planets/dryad.png differ diff --git a/public/sprites/planets/eclipse.png b/public/sprites/planets/eclipse.png new file mode 100644 index 0000000..4ffdfa8 Binary files /dev/null and b/public/sprites/planets/eclipse.png differ diff --git a/public/sprites/planets/flamara.png b/public/sprites/planets/flamara.png new file mode 100644 index 0000000..2c20fc2 Binary files /dev/null and b/public/sprites/planets/flamara.png differ diff --git a/public/sprites/planets/ignis-minor.png b/public/sprites/planets/ignis-minor.png new file mode 100644 index 0000000..9753b97 Binary files /dev/null and b/public/sprites/planets/ignis-minor.png differ diff --git a/public/sprites/planets/luminis.png b/public/sprites/planets/luminis.png new file mode 100644 index 0000000..5da702a Binary files /dev/null and b/public/sprites/planets/luminis.png differ diff --git a/public/sprites/planets/maridia.png b/public/sprites/planets/maridia.png new file mode 100644 index 0000000..af3e268 Binary files /dev/null and b/public/sprites/planets/maridia.png differ diff --git a/public/sprites/planets/nautilus.png b/public/sprites/planets/nautilus.png new file mode 100644 index 0000000..b4a7dc6 Binary files /dev/null and b/public/sprites/planets/nautilus.png differ diff --git a/public/sprites/planets/solaris.png b/public/sprites/planets/solaris.png new file mode 100644 index 0000000..257c422 Binary files /dev/null and b/public/sprites/planets/solaris.png differ diff --git a/public/sprites/planets/titanus.png b/public/sprites/planets/titanus.png new file mode 100644 index 0000000..f7c6b30 Binary files /dev/null and b/public/sprites/planets/titanus.png differ diff --git a/public/sprites/planets/umbra.png b/public/sprites/planets/umbra.png new file mode 100644 index 0000000..1f8b8e9 Binary files /dev/null and b/public/sprites/planets/umbra.png differ diff --git a/public/sprites/planets/vespera.png b/public/sprites/planets/vespera.png new file mode 100644 index 0000000..d2f551d Binary files /dev/null and b/public/sprites/planets/vespera.png differ diff --git a/public/sprites/planets/zephyra.png b/public/sprites/planets/zephyra.png new file mode 100644 index 0000000..0eb30ec Binary files /dev/null and b/public/sprites/planets/zephyra.png differ diff --git a/src/app/app.component.html b/src/app/app.component.html index 2e36826..3509171 100644 --- a/src/app/app.component.html +++ b/src/app/app.component.html @@ -14,4 +14,6 @@ @if (gameService.showTutorial) { -} \ No newline at end of file +} + + \ No newline at end of file diff --git a/src/app/app.component.ts b/src/app/app.component.ts index 28a4c47..58ff8a7 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -13,12 +13,13 @@ import { registerLocaleData } from '@angular/common'; import localeDe from '@angular/common/locales/de'; import localeDeExtra from '@angular/common/locales/extra/de'; import { WelcomeComponent } from './components/tutorial/welcome/welcome.component'; +import { TradeRouteComponent } from './components/dialog/trade-route/trade-route.component'; registerLocaleData(localeDe, 'de-DE', localeDeExtra); @Component({ selector: 'app-root', - imports: [MatDialogModule, ShipDialogComponent, PlanetDialogComponent, DragDropModule, StatusBarComponent, BuyComponent, WelcomeComponent], + imports: [MatDialogModule, ShipDialogComponent, PlanetDialogComponent, DragDropModule, StatusBarComponent, BuyComponent, WelcomeComponent, TradeRouteComponent], providers: [{ provide: LOCALE_ID, useValue: 'de-DE' }], templateUrl: './app.component.html', styleUrl: './app.component.scss' diff --git a/src/app/components/dialog/planet-dialog/planet-dialog.component.html b/src/app/components/dialog/planet-dialog/planet-dialog.component.html index 89c47b5..8314843 100644 --- a/src/app/components/dialog/planet-dialog/planet-dialog.component.html +++ b/src/app/components/dialog/planet-dialog/planet-dialog.component.html @@ -1,6 +1,6 @@
-
+
{{ planet.name }}
diff --git a/src/app/components/dialog/trade-route/trade-route.component.html b/src/app/components/dialog/trade-route/trade-route.component.html new file mode 100644 index 0000000..1530eac --- /dev/null +++ b/src/app/components/dialog/trade-route/trade-route.component.html @@ -0,0 +1,54 @@ +
+ +
+
Handelsrouten
+
+ +
+ + + + @if (availableRoutes.length > 0) { +
+

Routen:

+
+ @for (route of availableRoutes; track $index) { + + } +
+
oder:
+ +
+ } + + + +
+

Verfügbare Planeten:

+
+ @for(planet of availablePlanets;track planet.name) { + + + } +
+
+

Route:

+
+ +
+ @for(planet of selectedPlanets; track $index) { +
+
{{ planet.name }}
+ +
+ } +
+
+
+
+ + +
+ + +
\ No newline at end of file diff --git a/src/app/components/dialog/trade-route/trade-route.component.scss b/src/app/components/dialog/trade-route/trade-route.component.scss new file mode 100644 index 0000000..2e0c0c5 --- /dev/null +++ b/src/app/components/dialog/trade-route/trade-route.component.scss @@ -0,0 +1,17 @@ +:host { + position: absolute; + display: flex; + flex-direction: column; + position: absolute; + top: 24px; + left: 24px; + width: 600px; + // height: 240px; + // background-color: var(--background-color); + // color: var(--primary-color); + z-index: 1; +} + +h4 { + margin: 0; +} \ No newline at end of file diff --git a/src/app/components/dialog/trade-route/trade-route.component.spec.ts b/src/app/components/dialog/trade-route/trade-route.component.spec.ts new file mode 100644 index 0000000..29a0b50 --- /dev/null +++ b/src/app/components/dialog/trade-route/trade-route.component.spec.ts @@ -0,0 +1,23 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { TradeRouteComponent } from './trade-route.component'; + +describe('TradeRouteComponent', () => { + let component: TradeRouteComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + imports: [TradeRouteComponent] + }) + .compileComponents(); + + fixture = TestBed.createComponent(TradeRouteComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/components/dialog/trade-route/trade-route.component.ts b/src/app/components/dialog/trade-route/trade-route.component.ts new file mode 100644 index 0000000..0effdc4 --- /dev/null +++ b/src/app/components/dialog/trade-route/trade-route.component.ts @@ -0,0 +1,64 @@ +import { CdkDrag, CdkDragDrop, CdkDropList, DragDropModule, moveItemInArray } from '@angular/cdk/drag-drop'; +import { CommonModule } from '@angular/common'; +import { Component, inject } from '@angular/core'; +import { GameService } from '../../../service/game.service'; +import { Planet } from '../../../model/planet.model'; +import { TradeRoute } from '../../../model/routes/trade-route.model'; +import { MatTooltipModule } from '@angular/material/tooltip'; + +@Component({ + selector: 'app-trade-route', + imports: [CommonModule, DragDropModule, CdkDropList, CdkDrag, MatTooltipModule], + templateUrl: './trade-route.component.html', + styleUrl: './trade-route.component.scss' +}) +export class TradeRouteComponent { + + private gameService: GameService = inject(GameService); + + selectedPlanets: Planet[] = []; + + selectedRoute: TradeRoute = new TradeRoute([]); + + constructor() {} + + + + get availablePlanets(): Planet[] { + return this.gameService.planets.filter(p => p.hasHarbour || true) + } + + get availableRoutes(): TradeRoute[] { + return this.gameService.tradeRoutes; + } + + addPlanet(planet: Planet) { + this.selectedPlanets.push(planet); + console.log(this.selectedPlanets) + } + + remove(planet: Planet) { + this.selectedPlanets = this.selectedPlanets.filter(p => p != planet) + } + + drop(event: CdkDragDrop) { + moveItemInArray(this.selectedPlanets, event.previousIndex, event.currentIndex); + } + + selectRoute(route: TradeRoute) { + this.selectedRoute = route; + this.selectedPlanets = route.getPlanets(); + } + + + save() { + this.selectedRoute.setPlanets(this.selectedPlanets); + this.gameService.tradeRoutes.push(this.selectedRoute); + this.newRoute(); + + } + + newRoute() { + this.selectRoute(new TradeRoute([])) + } +} diff --git a/src/app/components/ships/buy/buy.component.html b/src/app/components/ships/buy/buy.component.html index 74ee5c0..89a2766 100644 --- a/src/app/components/ships/buy/buy.component.html +++ b/src/app/components/ships/buy/buy.component.html @@ -12,6 +12,10 @@
🚀 Neues Schiff: {{ selectedShip.name }}
+ +
{{ selectedShip.desciption }}