From 53f4eec7086fb186c1c89ea739615e24583645a1 Mon Sep 17 00:00:00 2001 From: Denis Zholob Date: Fri, 6 Dec 2024 12:36:14 -0700 Subject: [PATCH] Split Basic Power Sheet + Refactors * New Solar and Steam power sheets split from basic power * Update nav links * Move shared data files to data folder * Make cheat-sheet-template component standalone * Remove old belt sheet data by making belt component use the newer cheat-sheet-template * Convert components using the cheat-sheet-template to standalone --- package.json | 20 +- .../basic-power/basic-power.component.html | 176 ------------------ .../basic-power/basic-power.component.spec.ts | 25 --- .../basic-power.component.stories.ts | 25 --- .../basic-power/basic-power.component.ts | 84 --------- .../game-base/basic-power/basic-power.data.ts | 54 ------ .../basic-power/basic-power.module.spec.ts | 16 -- .../basic-power/basic-power.module.ts | 19 -- .../calculator-solar.component.spec.ts | 25 --- .../calculator-solar.module.spec.ts | 16 -- .../calculator-solar.module.ts | 13 -- .../game-base/belts/belts.component.html | 12 +- .../belts/belts.component.stories.ts | 3 +- .../game-base/belts/belts.component.ts | 45 ++--- .../game-base/belts/belts.data.ts | 51 ----- .../game-base/belts/belts.module.spec.ts | 16 -- .../game-base/belts/belts.module.ts | 13 -- .../cs-common-ratios.component.spec.ts | 25 --- .../cs-common-ratios.component.stories.ts | 3 +- .../cs-common-ratios.component.ts | 20 +- .../cs-common-ratios.module.spec.ts | 16 -- .../cs-common-ratios.module.ts | 20 -- .../game-base/game-base.component.html | 3 +- .../game-base/game-base.module.ts | 14 +- .../material-processing.component.ts | 16 +- .../game-base/mining/belt.data.ts | 39 ---- .../game-base/mining/mining.component.ts | 22 ++- .../calculator-solar.component.html | 0 .../calculator-solar.component.stories.ts | 18 +- .../calculator-solar.component.ts | 22 ++- .../power-solar/power-solar.component.html | 80 ++++++++ .../power-solar.component.stories.ts | 36 ++++ .../power-solar/power-solar.component.ts | 32 ++++ .../game-base/power-solar/power-solar.data.ts | 34 ++++ .../power-steam/power-steam.component.html | 102 ++++++++++ .../power-steam.component.stories.ts | 37 ++++ .../power-steam/power-steam.component.ts | 65 +++++++ .../game-base/power-steam/power-steam.data.ts | 51 +++++ .../space-age/space-age.component.stories.ts | 11 +- .../space-age/space-age.component.ts | 12 +- .../game-base/space-age/space-age.model.ts | 7 +- .../train-colors/train-colors.component.html | 4 +- .../contribute/contribute.component.html | 2 +- .../contribute/contribute.component.spec.ts | 25 --- .../contribute.component.stories.ts | 3 +- .../contribute/contribute.component.ts | 13 +- .../contribute/contribute.module.spec.ts | 16 -- .../game-mods/contribute/contribute.module.ts | 12 -- .../game-mods/game-mods.module.ts | 8 +- .../popular-mods/popular-mods.component.html | 2 +- .../popular-mods.component.spec.ts | 25 --- .../popular-mods.component.stories.ts | 3 +- .../popular-mods/popular-mods.component.ts | 20 +- .../popular-mods/popular-mods.module.spec.ts | 16 -- .../popular-mods/popular-mods.module.ts | 13 -- src/app/data/belt.data.ts | 51 +++++ .../basic-power => data}/burnables.data.ts | 1 + .../game-base/mining => data}/drill.data.ts | 0 .../furnaces.data.ts | 0 src/app/data/index.ts | 8 + .../game-base/mining => data}/ore.data.ts | 0 src/app/data/simple-ratio.model.ts | 4 + src/app/layout/nav/nav.data.ts | 24 ++- src/app/models/BasicPowerData.model.ts | 25 --- src/app/models/BeltsData.model.ts | 12 -- .../cheat-sheet-template.component.html | 4 +- .../cheat-sheet-template.component.spec.ts | 25 --- .../cheat-sheet-template.component.stories.ts | 10 +- .../cheat-sheet-template.component.ts | 48 +++-- .../cheat-sheet-template.module.spec.ts | 18 -- .../cheat-sheet-template.module.ts | 23 --- .../cheat-sheet/cheat-sheet.component.ts | 1 + .../factorio-icon.component.stories.ts | 1 + 73 files changed, 734 insertions(+), 981 deletions(-) delete mode 100644 src/app/cheat-sheets/game-base/basic-power/basic-power.component.html delete mode 100644 src/app/cheat-sheets/game-base/basic-power/basic-power.component.spec.ts delete mode 100644 src/app/cheat-sheets/game-base/basic-power/basic-power.component.stories.ts delete mode 100644 src/app/cheat-sheets/game-base/basic-power/basic-power.component.ts delete mode 100644 src/app/cheat-sheets/game-base/basic-power/basic-power.data.ts delete mode 100644 src/app/cheat-sheets/game-base/basic-power/basic-power.module.spec.ts delete mode 100644 src/app/cheat-sheets/game-base/basic-power/basic-power.module.ts delete mode 100644 src/app/cheat-sheets/game-base/basic-power/calculator-solar/calculator-solar.component.spec.ts delete mode 100644 src/app/cheat-sheets/game-base/basic-power/calculator-solar/calculator-solar.module.spec.ts delete mode 100644 src/app/cheat-sheets/game-base/basic-power/calculator-solar/calculator-solar.module.ts delete mode 100644 src/app/cheat-sheets/game-base/belts/belts.data.ts delete mode 100644 src/app/cheat-sheets/game-base/belts/belts.module.spec.ts delete mode 100644 src/app/cheat-sheets/game-base/belts/belts.module.ts delete mode 100644 src/app/cheat-sheets/game-base/cs-common-ratios/cs-common-ratios.component.spec.ts delete mode 100644 src/app/cheat-sheets/game-base/cs-common-ratios/cs-common-ratios.module.spec.ts delete mode 100644 src/app/cheat-sheets/game-base/cs-common-ratios/cs-common-ratios.module.ts delete mode 100644 src/app/cheat-sheets/game-base/mining/belt.data.ts rename src/app/cheat-sheets/game-base/{basic-power => power-solar}/calculator-solar/calculator-solar.component.html (100%) rename src/app/cheat-sheets/game-base/{basic-power => power-solar}/calculator-solar/calculator-solar.component.stories.ts (58%) rename src/app/cheat-sheets/game-base/{basic-power => power-solar}/calculator-solar/calculator-solar.component.ts (70%) create mode 100644 src/app/cheat-sheets/game-base/power-solar/power-solar.component.html create mode 100644 src/app/cheat-sheets/game-base/power-solar/power-solar.component.stories.ts create mode 100644 src/app/cheat-sheets/game-base/power-solar/power-solar.component.ts create mode 100644 src/app/cheat-sheets/game-base/power-solar/power-solar.data.ts create mode 100644 src/app/cheat-sheets/game-base/power-steam/power-steam.component.html create mode 100644 src/app/cheat-sheets/game-base/power-steam/power-steam.component.stories.ts create mode 100644 src/app/cheat-sheets/game-base/power-steam/power-steam.component.ts create mode 100644 src/app/cheat-sheets/game-base/power-steam/power-steam.data.ts delete mode 100644 src/app/cheat-sheets/game-mods/contribute/contribute.component.spec.ts delete mode 100644 src/app/cheat-sheets/game-mods/contribute/contribute.module.spec.ts delete mode 100644 src/app/cheat-sheets/game-mods/contribute/contribute.module.ts delete mode 100644 src/app/cheat-sheets/game-mods/popular-mods/popular-mods.component.spec.ts delete mode 100644 src/app/cheat-sheets/game-mods/popular-mods/popular-mods.module.spec.ts delete mode 100644 src/app/cheat-sheets/game-mods/popular-mods/popular-mods.module.ts create mode 100644 src/app/data/belt.data.ts rename src/app/{cheat-sheets/game-base/basic-power => data}/burnables.data.ts (99%) rename src/app/{cheat-sheets/game-base/mining => data}/drill.data.ts (100%) rename src/app/{cheat-sheets/game-base/material-processing => data}/furnaces.data.ts (100%) create mode 100644 src/app/data/index.ts rename src/app/{cheat-sheets/game-base/mining => data}/ore.data.ts (100%) create mode 100644 src/app/data/simple-ratio.model.ts delete mode 100644 src/app/models/BasicPowerData.model.ts delete mode 100644 src/app/models/BeltsData.model.ts delete mode 100644 src/app/shared/cheat-sheet-template/cheat-sheet-template.component.spec.ts delete mode 100644 src/app/shared/cheat-sheet-template/cheat-sheet-template.module.spec.ts delete mode 100644 src/app/shared/cheat-sheet-template/cheat-sheet-template.module.ts diff --git a/package.json b/package.json index a04f18b..6285e1e 100644 --- a/package.json +++ b/package.json @@ -11,27 +11,27 @@ "npm": ">= 8.19.2" }, "scripts": { - "ng": "ng", "i": "npm i", "start": "ng serve --port 9009", + "storybook:docs": "npm run docs:json && npm run storybook", + "storybook": "ng run factorio-cheat-sheet:storybook --port 6006", + "lint": "ng lint --fix", + "format": "prettier --cache --write --ignore-unknown .", + "lint:check": "ng lint", + "format:check": "prettier --cache --check --ignore-unknown .", + "test": "echo 'No tests'", "start:prod": "http-server -p 8080 -c-1 public", "build": "npm run build:prod", "build:sh": "sh ./build/build.sh", "build:dev": "ng --configuration development", "build:prod": "ng build --configuration production", "watch": "ng build --watch --configuration development", - "test": "echo 'No tests'", - "lint": "ng lint --fix", - "lint:check": "ng lint", - "format": "prettier --cache --write --ignore-unknown .", - "format:check": "prettier --cache --check --ignore-unknown .", + "docs:json": "compodoc -p ./tsconfig.json -e json -d .", + "build-storybook": "npm run docs:json && storybook build", "prepare": "husky install", "pre-commit": "npm run update-devcontainer-extensions && npx lint-staged", "update-devcontainer-extensions": "node .devcontainer/dev-container-update-extensions.js ", - "docs:json": "compodoc -p ./tsconfig.json -e json -d .", - "storybook": "ng run factorio-cheat-sheet:storybook --port 6006", - "storybook:docs": "npm run docs:json && npm run storybook", - "build-storybook": "npm run docs:json && storybook build" + "ng": "ng" }, "lint-staged": { "**/*.{ts,tsx,js,jsx}": [ diff --git a/src/app/cheat-sheets/game-base/basic-power/basic-power.component.html b/src/app/cheat-sheets/game-base/basic-power/basic-power.component.html deleted file mode 100644 index 38d3c24..0000000 --- a/src/app/cheat-sheets/game-base/basic-power/basic-power.component.html +++ /dev/null @@ -1,176 +0,0 @@ - -
-

- - Steam Power - Build Ratio
- - - - - - {{ sheetData?.steamRatioPower }} -

- -

- Solar Power (Usable) - Build Ratio
- - - - - - {{ sheetData?.solarRatioPower }} -

- -

- Solar Total to Usable
- - - - {{ 10 * solarPowerRatio }}MW -

-
- -
- -

Steam Power

- - - - - - - - - - - - - - - - - - - - - - - -
- - Boilers supported by a full belt of fuel -
- (Rounded up to nearest whole number) -
- - {{ col.name }} - - - - -
- - {{ boilerCount }}
- -

- Boilers supported by belt of fuel = Belt Throughput(i/s) * [Fuel Energy(MJ) / Boiler Energy({{ STEAM_BOILER_ENERGY_MJ }}MJ)] -

- -

Solar Power (Nauvis)

- -
-
-
    -
  • - Solar panels - only provide energy during the day.
    - ( {{ sheetData?.solar_energy_max }}{{ sheetData?.solar_energy_unit }} - Max, - {{ sheetData?.solar_energy_avg }}{{ sheetData?.solar_energy_unit }} - average per solar panel, ratio of - {{ solarPowerRatio | percent }} - "usable" to total) -
  • -
  • - 10MW worth of solar panels will power a factory of - {{ 10 * solarPowerRatio }}MW. -
  • -
  • - During the day, excess power generated is stored in - accumulators, during the night, accumulators - release their charge to power your factory. -
  • -
  • Place accumulators until they can keep your factory powered through the night.
  • -
  • Add some extra accumulators to account for burst consumption, such as firing a lot of lasers.
  • -
  • Then place solar panels until those accumulators are fully charged by the end of the day.
  • -
  • - User - Cilya on the forums - did the - math - to figure out exactly how many solar panels we need per accumulator. -
  • -
-
-
- -
-
-
diff --git a/src/app/cheat-sheets/game-base/basic-power/basic-power.component.spec.ts b/src/app/cheat-sheets/game-base/basic-power/basic-power.component.spec.ts deleted file mode 100644 index 82207d1..0000000 --- a/src/app/cheat-sheets/game-base/basic-power/basic-power.component.spec.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; - -import { BasicPowerComponent } from './basic-power.component'; -import { BasicPowerModule } from './basic-power.module'; - -describe('BasicPowerComponent', () => { - let component: BasicPowerComponent; - let fixture: ComponentFixture; - - beforeEach(waitForAsync(() => { - TestBed.configureTestingModule({ - imports: [BasicPowerModule], - }).compileComponents(); - })); - - beforeEach(() => { - fixture = TestBed.createComponent(BasicPowerComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/src/app/cheat-sheets/game-base/basic-power/basic-power.component.stories.ts b/src/app/cheat-sheets/game-base/basic-power/basic-power.component.stories.ts deleted file mode 100644 index 02155a8..0000000 --- a/src/app/cheat-sheets/game-base/basic-power/basic-power.component.stories.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { Meta, moduleMetadata, StoryObj } from '@storybook/angular'; -import { StorybookCsModule } from 'app/shared/storybook-cs.module'; - -import { BasicPowerComponent } from './basic-power.component'; -import { BasicPowerModule } from './basic-power.module'; - -type ComponentWithCustomControls = BasicPowerComponent; - -// More on how to set up stories at: https://storybook.js.org/docs/7.0/angular/writing-stories/introduction -const meta: Meta = { - title: 'Cheat Sheets/Game Base/Basic Power', - component: BasicPowerComponent, - decorators: [ - moduleMetadata({ - imports: [BasicPowerModule, StorybookCsModule], - }), - ], - args: {}, -}; - -export default meta; -type Story = StoryObj; - -// More on writing stories with args: https://storybook.js.org/docs/7.0/angular/writing-stories/args -export const BasicPower: Story = {}; diff --git a/src/app/cheat-sheets/game-base/basic-power/basic-power.component.ts b/src/app/cheat-sheets/game-base/basic-power/basic-power.component.ts deleted file mode 100644 index 5334772..0000000 --- a/src/app/cheat-sheets/game-base/basic-power/basic-power.component.ts +++ /dev/null @@ -1,84 +0,0 @@ -// Angular Imports -import { Component, OnInit } from '@angular/core'; -import { BasicPowerData } from 'app/models/BasicPowerData.model'; -// Models -import { Data } from 'app/models/Data.model'; -// Services -import { DataService } from 'app/services/data.service'; -import { CheatSheet } from 'app/shared/cheat-sheet/cheat-sheet.model'; -import { FactorioIconData } from 'app/shared/factorio-icon/factorio-icon.model'; - -import { BELT_DATA, BeltData } from '../mining/belt.data'; -// Constants -import { BASIC_POWER_DATA } from './basic-power.data'; -import { BURNABLES_DATA, BurnablesData } from './burnables.data'; - -interface BoilerTableColumn extends FactorioIconData { - type: 'Text' | 'FactorioIcon'; -} - -interface BoilerTableRow extends FactorioIconData { - boilerCounts: number[]; -} - -const STEAM_BOILER_ENERGY_MJ = 1.8; - -@Component({ - selector: 'app-basic-power', - templateUrl: './basic-power.component.html', -}) -export class BasicPowerComponent implements OnInit { - protected readonly STEAM_BOILER_ENERGY_MJ = STEAM_BOILER_ENERGY_MJ; - public cheatSheet?: CheatSheet; - public sheetData?: BasicPowerData; - - public solarPowerRatio = 0.7; - public solarAvgMw: number = 42 / 1000; // MW - - protected boilerTableColumns: BoilerTableColumn[] = [ - { type: 'Text', name: '' }, - ...BURNABLES_DATA.map( - (burnable: BurnablesData): BoilerTableColumn => ({ - type: 'FactorioIcon', - spaceAge: burnable.spaceAge, - name: burnable.name, - text: - burnable.fuelEnergyMj > 1000 - ? `${burnable.fuelEnergyMj / 1000}GJ` - : `${burnable.fuelEnergyMj}MJ`, - }) - ), - ]; - - protected boilerTableRows: BoilerTableRow[] = BELT_DATA.map( - (belt: BeltData) => ({ - spaceAge: belt.spaceAge, - name: belt.name, - boilerCounts: BURNABLES_DATA.map((burnable: BurnablesData) => - Math.ceil( - (belt.throughput * burnable.fuelEnergyMj) / STEAM_BOILER_ENERGY_MJ - ) - ), - }) - ); - - constructor(public dataService: DataService) {} - - /** Get Data for the Cheat Sheet from the DataService */ - ngOnInit() { - this.dataService - .getLocalCheatSheetData(BASIC_POWER_DATA) - .subscribe( - (result: Data) => { - this.cheatSheet = result.cheatSheet; - this.sheetData = result.data; - this.solarAvgMw = this.sheetData.solar_energy_avg / 1000; - this.solarPowerRatio = - this.sheetData.solar_energy_avg / this.sheetData.solar_energy_max; - }, - (error) => { - console.log(error); - } - ); - } -} diff --git a/src/app/cheat-sheets/game-base/basic-power/basic-power.data.ts b/src/app/cheat-sheets/game-base/basic-power/basic-power.data.ts deleted file mode 100644 index 4116278..0000000 --- a/src/app/cheat-sheets/game-base/basic-power/basic-power.data.ts +++ /dev/null @@ -1,54 +0,0 @@ -import { BasicPowerData } from 'app/models/BasicPowerData.model'; -import { RawData } from 'app/models/Data.model'; - -export const BASIC_POWER_DATA: RawData = { - cheatSheet: { - title: 'Basic Power', - icon: 'Accumulator', - }, - data: { - steamRatioPower: '360MW', - steamRatio: [ - { - iconId: 'Offshore_pump', - count: 1, - }, - { - iconId: 'Boiler', - count: 200, - }, - { - iconId: 'Steam_engine', - count: 400, - }, - { - iconId: 'Electric_mining_drill', - count: 180, - }, - { - iconId: 'Transport_belt', - count: 6, - }, - ], - solarRatioPower: '1MW', - solarRatio: [ - { - iconId: 'Solar_panel', - count: 25, - }, - { - iconId: 'Accumulator', - count: 21, - }, - ], - offshore_pump_water: 1200, - steam_boiler_water: 6, - steam_boiler_steam: 60, - steam_boiler_energy: '1.8MJ', - steam_engine_steam: 30, - steam_engine_power: '0.9MW', - solar_energy_max: 60, - solar_energy_avg: 42, - solar_energy_unit: 'kW', - }, -}; diff --git a/src/app/cheat-sheets/game-base/basic-power/basic-power.module.spec.ts b/src/app/cheat-sheets/game-base/basic-power/basic-power.module.spec.ts deleted file mode 100644 index 61c56b5..0000000 --- a/src/app/cheat-sheets/game-base/basic-power/basic-power.module.spec.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { TestBed } from '@angular/core/testing'; - -import { BasicPowerModule } from './basic-power.module'; - -describe('BasicPowerModule', () => { - beforeEach(() => { - TestBed.configureTestingModule({ - imports: [BasicPowerModule], - }); - }); - - it('initializes', () => { - const module: BasicPowerModule = TestBed.inject(BasicPowerModule); - expect(module).toBeTruthy(); - }); -}); diff --git a/src/app/cheat-sheets/game-base/basic-power/basic-power.module.ts b/src/app/cheat-sheets/game-base/basic-power/basic-power.module.ts deleted file mode 100644 index 0053c20..0000000 --- a/src/app/cheat-sheets/game-base/basic-power/basic-power.module.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { CommonModule } from '@angular/common'; -import { NgModule } from '@angular/core'; -import { FactorioIconModule } from 'app/shared'; -import { CheatSheetModule } from 'app/shared/cheat-sheet/cheat-sheet.module'; - -import { BasicPowerComponent } from './basic-power.component'; -import { CalculatorSolarModule } from './calculator-solar/calculator-solar.module'; - -@NgModule({ - imports: [ - CommonModule, - FactorioIconModule, - CheatSheetModule, - CalculatorSolarModule, - ], - declarations: [BasicPowerComponent], - exports: [BasicPowerComponent], -}) -export class BasicPowerModule {} diff --git a/src/app/cheat-sheets/game-base/basic-power/calculator-solar/calculator-solar.component.spec.ts b/src/app/cheat-sheets/game-base/basic-power/calculator-solar/calculator-solar.component.spec.ts deleted file mode 100644 index f8c2d4d..0000000 --- a/src/app/cheat-sheets/game-base/basic-power/calculator-solar/calculator-solar.component.spec.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; - -import { CalculatorSolarComponent } from './calculator-solar.component'; -import { CalculatorSolarModule } from './calculator-solar.module'; - -describe('CalculatorSolarComponent', () => { - let component: CalculatorSolarComponent; - let fixture: ComponentFixture; - - beforeEach(waitForAsync(() => { - TestBed.configureTestingModule({ - imports: [CalculatorSolarModule], - }).compileComponents(); - })); - - beforeEach(() => { - fixture = TestBed.createComponent(CalculatorSolarComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/src/app/cheat-sheets/game-base/basic-power/calculator-solar/calculator-solar.module.spec.ts b/src/app/cheat-sheets/game-base/basic-power/calculator-solar/calculator-solar.module.spec.ts deleted file mode 100644 index 5555355..0000000 --- a/src/app/cheat-sheets/game-base/basic-power/calculator-solar/calculator-solar.module.spec.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { TestBed } from '@angular/core/testing'; - -import { CalculatorSolarModule } from './calculator-solar.module'; - -describe('CalculatorSolarModule', () => { - beforeEach(() => { - TestBed.configureTestingModule({ - imports: [CalculatorSolarModule], - }); - }); - - it('initializes', () => { - const module: CalculatorSolarModule = TestBed.inject(CalculatorSolarModule); - expect(module).toBeTruthy(); - }); -}); diff --git a/src/app/cheat-sheets/game-base/basic-power/calculator-solar/calculator-solar.module.ts b/src/app/cheat-sheets/game-base/basic-power/calculator-solar/calculator-solar.module.ts deleted file mode 100644 index 2cb398d..0000000 --- a/src/app/cheat-sheets/game-base/basic-power/calculator-solar/calculator-solar.module.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { CommonModule } from '@angular/common'; -import { NgModule } from '@angular/core'; -import { FormsModule } from '@angular/forms'; -import { FactorioIconModule } from 'app/shared'; - -import { CalculatorSolarComponent } from './calculator-solar.component'; - -@NgModule({ - imports: [CommonModule, FormsModule, FactorioIconModule], - declarations: [CalculatorSolarComponent], - exports: [CalculatorSolarComponent], -}) -export class CalculatorSolarModule {} diff --git a/src/app/cheat-sheets/game-base/belts/belts.component.html b/src/app/cheat-sheets/game-base/belts/belts.component.html index 41b16be..30f33d8 100644 --- a/src/app/cheat-sheets/game-base/belts/belts.component.html +++ b/src/app/cheat-sheets/game-base/belts/belts.component.html @@ -1,4 +1,4 @@ - +

@@ -15,7 +15,7 @@
Transport Belt Density - Maximum items that fit in one tile: - {{ sheetData?.belt_density }} items + {{ BELT_DATA.beltDensity }} items for all belts.

@@ -36,7 +36,7 @@ - + @@ -46,7 +46,7 @@ i/s - {{ item.underground_spacing }} + {{ item.undergroundSpacing }} tiles @@ -57,7 +57,7 @@

All belts can hold up to - {{ sheetData?.belt_density }} items + {{ BELT_DATA.beltDensity }} items on each tile.

- + diff --git a/src/app/cheat-sheets/game-base/belts/belts.component.stories.ts b/src/app/cheat-sheets/game-base/belts/belts.component.stories.ts index fd2a84f..2a87025 100644 --- a/src/app/cheat-sheets/game-base/belts/belts.component.stories.ts +++ b/src/app/cheat-sheets/game-base/belts/belts.component.stories.ts @@ -2,7 +2,6 @@ import { Meta, moduleMetadata, Story } from '@storybook/angular'; import { StorybookCsModule } from 'app/shared/storybook-cs.module'; import { BeltsComponent } from './belts.component'; -import { BeltsModule } from './belts.module'; type ComponentWithCustomControls = BeltsComponent; @@ -11,7 +10,7 @@ const meta: Meta = { component: BeltsComponent, decorators: [ moduleMetadata({ - imports: [BeltsModule, StorybookCsModule], + imports: [StorybookCsModule], }), ], parameters: { diff --git a/src/app/cheat-sheets/game-base/belts/belts.component.ts b/src/app/cheat-sheets/game-base/belts/belts.component.ts index 093f2a2..1875042 100644 --- a/src/app/cheat-sheets/game-base/belts/belts.component.ts +++ b/src/app/cheat-sheets/game-base/belts/belts.component.ts @@ -1,38 +1,27 @@ -// Angular Imports -import { Component, OnInit } from '@angular/core'; -import { BeltsData } from 'app/models/BeltsData.model'; -// Models -import { Data } from 'app/models/Data.model'; -// Services +import { CommonModule } from '@angular/common'; +import { Component } from '@angular/core'; +import { BELT_DATA, BeltData } from 'app/data'; import { DataService } from 'app/services/data.service'; -// Constants -import { APP_INFO } from 'app/shared/app-settings'; -import { CheatSheet } from 'app/shared/cheat-sheet/cheat-sheet.model'; +import { FactorioIconModule } from 'app/shared'; +import { APP_INFO, AppInfo } from 'app/shared/app-settings'; +import { CheatSheetTemplateComponent } from 'app/shared/cheat-sheet-template/cheat-sheet-template.component'; -import { BELTS_DATA } from './belts.data'; +export const BELTS_SHEET_ICON = 'Transport_belt'; +export const BELTS_SHEET_TITLE = 'Belts'; @Component({ selector: 'app-belts', templateUrl: './belts.component.html', - // styleUrls: ['./belts.component.scss'] // Enable as needed + styles: [':host{display:contents}'], // Makes component host as if it was not there, can offer less css headaches. Use @HostBinding class approach for easier overrides. + standalone: true, + imports: [CommonModule, CheatSheetTemplateComponent, FactorioIconModule], }) -export class BeltsComponent implements OnInit { - public cheatSheet?: CheatSheet; - public sheetData?: BeltsData; +export class BeltsComponent { + protected readonly cheatSheetIconId: string = BELTS_SHEET_ICON; + protected readonly cheatSheetTitle: string = BELTS_SHEET_TITLE; - public APP_INFO = APP_INFO; + protected readonly APP_INFO: AppInfo = APP_INFO; + protected readonly BELT_DATA: BeltData = BELT_DATA; - constructor(public dataService: DataService) {} - - ngOnInit() { - this.dataService.getLocalCheatSheetData(BELTS_DATA).subscribe( - (result: Data) => { - this.cheatSheet = result.cheatSheet; - this.sheetData = result.data; - }, - (error) => { - console.log(error); - } - ); - } + constructor(protected dataService: DataService) {} } diff --git a/src/app/cheat-sheets/game-base/belts/belts.data.ts b/src/app/cheat-sheets/game-base/belts/belts.data.ts deleted file mode 100644 index ea431d8..0000000 --- a/src/app/cheat-sheets/game-base/belts/belts.data.ts +++ /dev/null @@ -1,51 +0,0 @@ -import { BeltsData } from 'app/models/BeltsData.model'; -import { RawData } from 'app/models/Data.model'; - -export const BELTS_DATA: RawData = { - cheatSheet: { - title: 'Belts', - icon: 'Transport_belt', - }, - data: { - belt_density: 8, - belt_info: [ - { - tier: 1, - icons: ['Transport_belt', 'Underground_belt', 'Splitter'], - throughput: 15, - underground_spacing: 4, - }, - { - tier: 2, - icons: [ - 'Fast_transport_belt', - 'Fast_underground_belt', - 'Fast_splitter', - ], - throughput: 30, - underground_spacing: 6, - }, - { - tier: 3, - icons: [ - 'Express_transport_belt', - 'Express_underground_belt', - 'Express_splitter', - ], - throughput: 45, - underground_spacing: 8, - }, - { - tier: 4, - icons: [ - 'Turbo_transport_belt', - 'Turbo_underground_belt', - 'Turbo_splitter', - ], - throughput: 60, - underground_spacing: 10, - spaceAge: true, - }, - ], - }, -}; diff --git a/src/app/cheat-sheets/game-base/belts/belts.module.spec.ts b/src/app/cheat-sheets/game-base/belts/belts.module.spec.ts deleted file mode 100644 index 8f83131..0000000 --- a/src/app/cheat-sheets/game-base/belts/belts.module.spec.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { TestBed } from '@angular/core/testing'; - -import { BeltsModule } from './belts.module'; - -describe('BeltsModule', () => { - beforeEach(() => { - TestBed.configureTestingModule({ - imports: [BeltsModule], - }); - }); - - it('initializes', () => { - const module: BeltsModule = TestBed.inject(BeltsModule); - expect(module).toBeTruthy(); - }); -}); diff --git a/src/app/cheat-sheets/game-base/belts/belts.module.ts b/src/app/cheat-sheets/game-base/belts/belts.module.ts deleted file mode 100644 index 35435d2..0000000 --- a/src/app/cheat-sheets/game-base/belts/belts.module.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { CommonModule } from '@angular/common'; -import { NgModule } from '@angular/core'; -import { FactorioIconModule } from 'app/shared'; -import { CheatSheetModule } from 'app/shared/cheat-sheet/cheat-sheet.module'; - -import { BeltsComponent } from './belts.component'; - -@NgModule({ - imports: [CommonModule, CheatSheetModule, FactorioIconModule], - declarations: [BeltsComponent], - exports: [BeltsComponent], -}) -export class BeltsModule {} diff --git a/src/app/cheat-sheets/game-base/cs-common-ratios/cs-common-ratios.component.spec.ts b/src/app/cheat-sheets/game-base/cs-common-ratios/cs-common-ratios.component.spec.ts deleted file mode 100644 index cf330e1..0000000 --- a/src/app/cheat-sheets/game-base/cs-common-ratios/cs-common-ratios.component.spec.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; - -import { CsCommonRatiosComponent } from './cs-common-ratios.component'; -import { CsCommonRatiosModule } from './cs-common-ratios.module'; - -describe('CsCommonRatiosComponent', () => { - let component: CsCommonRatiosComponent; - let fixture: ComponentFixture; - - beforeEach(waitForAsync(() => { - TestBed.configureTestingModule({ - imports: [CsCommonRatiosModule], - }).compileComponents(); - })); - - beforeEach(() => { - fixture = TestBed.createComponent(CsCommonRatiosComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/src/app/cheat-sheets/game-base/cs-common-ratios/cs-common-ratios.component.stories.ts b/src/app/cheat-sheets/game-base/cs-common-ratios/cs-common-ratios.component.stories.ts index 1f4d5ce..6246cc9 100644 --- a/src/app/cheat-sheets/game-base/cs-common-ratios/cs-common-ratios.component.stories.ts +++ b/src/app/cheat-sheets/game-base/cs-common-ratios/cs-common-ratios.component.stories.ts @@ -2,7 +2,6 @@ import { Meta, moduleMetadata, StoryObj } from '@storybook/angular'; import { StorybookCsModule } from 'app/shared/storybook-cs.module'; import { CsCommonRatiosComponent } from './cs-common-ratios.component'; -import { CsCommonRatiosModule } from './cs-common-ratios.module'; type ComponentWithCustomControls = CsCommonRatiosComponent & { content: string; }; @@ -13,7 +12,7 @@ const meta: Meta = { component: CsCommonRatiosComponent, decorators: [ moduleMetadata({ - imports: [CsCommonRatiosModule, StorybookCsModule], + imports: [StorybookCsModule], }), ], }; diff --git a/src/app/cheat-sheets/game-base/cs-common-ratios/cs-common-ratios.component.ts b/src/app/cheat-sheets/game-base/cs-common-ratios/cs-common-ratios.component.ts index 7b42000..5ff8e6d 100644 --- a/src/app/cheat-sheets/game-base/cs-common-ratios/cs-common-ratios.component.ts +++ b/src/app/cheat-sheets/game-base/cs-common-ratios/cs-common-ratios.component.ts @@ -1,18 +1,34 @@ +import { CommonModule } from '@angular/common'; import { Component } from '@angular/core'; +import { RouterModule } from '@angular/router'; import { DataService } from 'app/services'; +import { FactorioIconModule, RatioModule } from 'app/shared'; +import { CheatSheetTemplateComponent } from 'app/shared/cheat-sheet-template/cheat-sheet-template.component'; import { COMMON_RATIO_DATA, RatioSection } from './common-ratios.data'; import { MACHINE_SPEEDS, MachineSpeeds } from './machine-speeds.data'; import { Ratio } from './ratio.model'; import { ROCKET_RATIO_DATA } from './rocket-ratios.data'; +export const CS_COMMON_RATIOS_SHEET_ICON = 'Repair_pack'; +export const CS_COMMON_RATIOS_SHEET_TITLE = 'Common Ratios'; + @Component({ selector: 'app-cs-common-ratios', templateUrl: './cs-common-ratios.component.html', + styles: [':host{display:contents}'], // Makes component host as if it was not there, can offer less css headaches. Use @HostBinding class approach for easier overrides. + standalone: true, + imports: [ + CommonModule, + CheatSheetTemplateComponent, + FactorioIconModule, + RouterModule, + RatioModule, + ], }) export class CsCommonRatiosComponent { - public readonly cheatSheetIconId: string = 'Repair_pack'; - public readonly cheatSheetTitle: string = 'Common Ratios'; + public readonly cheatSheetIconId: string = CS_COMMON_RATIOS_SHEET_ICON; + public readonly cheatSheetTitle: string = CS_COMMON_RATIOS_SHEET_TITLE; public ROCKET_RATIO_DATA: Ratio[] = ROCKET_RATIO_DATA; public COMMON_RATIO_DATA: RatioSection[] = COMMON_RATIO_DATA; diff --git a/src/app/cheat-sheets/game-base/cs-common-ratios/cs-common-ratios.module.spec.ts b/src/app/cheat-sheets/game-base/cs-common-ratios/cs-common-ratios.module.spec.ts deleted file mode 100644 index aeb69b7..0000000 --- a/src/app/cheat-sheets/game-base/cs-common-ratios/cs-common-ratios.module.spec.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { TestBed } from '@angular/core/testing'; - -import { CsCommonRatiosModule } from './cs-common-ratios.module'; - -describe('CsCommonRatiosModule', () => { - beforeEach(() => { - TestBed.configureTestingModule({ - imports: [CsCommonRatiosModule], - }); - }); - - it('initializes', () => { - const module: CsCommonRatiosModule = TestBed.inject(CsCommonRatiosModule); - expect(module).toBeTruthy(); - }); -}); diff --git a/src/app/cheat-sheets/game-base/cs-common-ratios/cs-common-ratios.module.ts b/src/app/cheat-sheets/game-base/cs-common-ratios/cs-common-ratios.module.ts deleted file mode 100644 index 3b15b2b..0000000 --- a/src/app/cheat-sheets/game-base/cs-common-ratios/cs-common-ratios.module.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { CommonModule } from '@angular/common'; -import { NgModule } from '@angular/core'; -import { RouterModule } from '@angular/router'; -import { FactorioIconModule, RatioModule } from 'app/shared'; -import { CheatSheetTemplateModule } from 'app/shared/cheat-sheet-template/cheat-sheet-template.module'; - -import { CsCommonRatiosComponent } from './cs-common-ratios.component'; - -@NgModule({ - imports: [ - CommonModule, - RouterModule, - CheatSheetTemplateModule, - RatioModule, - FactorioIconModule, - ], - declarations: [CsCommonRatiosComponent], - exports: [CsCommonRatiosComponent], -}) -export class CsCommonRatiosModule {} diff --git a/src/app/cheat-sheets/game-base/game-base.component.html b/src/app/cheat-sheets/game-base/game-base.component.html index f328ebe..87a4cb3 100644 --- a/src/app/cheat-sheets/game-base/game-base.component.html +++ b/src/app/cheat-sheets/game-base/game-base.component.html @@ -4,7 +4,8 @@ - + + diff --git a/src/app/cheat-sheets/game-base/game-base.module.ts b/src/app/cheat-sheets/game-base/game-base.module.ts index f38ed41..5a693b7 100644 --- a/src/app/cheat-sheets/game-base/game-base.module.ts +++ b/src/app/cheat-sheets/game-base/game-base.module.ts @@ -3,10 +3,9 @@ import { NgModule } from '@angular/core'; import { RouterModule } from '@angular/router'; import { BalancersModule } from './balancers/balancers.module'; -import { BasicPowerModule } from './basic-power/basic-power.module'; -import { BeltsModule } from './belts/belts.module'; +import { BeltsComponent } from './belts/belts.component'; import { CargoWagonTransferModule } from './cargo-wagon-transfer/cargo-wagon-transfer.module'; -import { CsCommonRatiosModule } from './cs-common-ratios/cs-common-ratios.module'; +import { CsCommonRatiosComponent } from './cs-common-ratios/cs-common-ratios.component'; import { FluidWagonTransferModule } from './fluid-wagon-transfer/fluid-wagon-transfer.module'; import { GameBaseComponent } from './game-base.component'; import { ROUTES_GAME_BASE } from './game-base.routes'; @@ -18,6 +17,8 @@ import { MiningModule } from './mining/mining.module'; import { ModulesAndBeaconsModule } from './modules-and-beacons/modules-and-beacons.module'; import { NuclearPowerModule } from './nuclear-power/nuclear-power.module'; import { OilRefiningModule } from './oil-refining/oil-refining.module'; +import { PowerSolarComponent } from './power-solar/power-solar.component'; +import { PowerSteamComponent } from './power-steam/power-steam.component'; import { ProductivityModulePayoffsModule } from './productivity-module-payoffs/productivity-module-payoffs.module'; import { ScienceModule } from './science/science.module'; import { SpaceAgeComponent } from './space-age/space-age.component'; @@ -32,11 +33,10 @@ import { VehicleFuelBonusModule } from './vehicle-fuel-bonus/vehicle-fuel-bonus. // Sheets BalancersModule, - BasicPowerModule, - BeltsModule, + BeltsComponent, CargoWagonTransferModule, // CombatModule, - CsCommonRatiosModule, + CsCommonRatiosComponent, FluidWagonTransferModule, InserterCapacityBonusModule, InserterThroughputModule, @@ -46,6 +46,8 @@ import { VehicleFuelBonusModule } from './vehicle-fuel-bonus/vehicle-fuel-bonus. ModulesAndBeaconsModule, NuclearPowerModule, OilRefiningModule, + PowerSolarComponent, + PowerSteamComponent, ProductivityModulePayoffsModule, ScienceModule, TipsModule, diff --git a/src/app/cheat-sheets/game-base/material-processing/material-processing.component.ts b/src/app/cheat-sheets/game-base/material-processing/material-processing.component.ts index ecf22bd..149e4a4 100644 --- a/src/app/cheat-sheets/game-base/material-processing/material-processing.component.ts +++ b/src/app/cheat-sheets/game-base/material-processing/material-processing.component.ts @@ -1,5 +1,12 @@ // Angular Imports import { Component, OnInit } from '@angular/core'; +import { + BELT_DATA, + BeltInfo, + BURNABLES_DATA, + FurnaceData, + FURNACES_DATA, +} from 'app/data'; // Models import { Data } from 'app/models/Data.model'; import { MaterialProcessingData } from 'app/models/MaterialProcessingData.model'; @@ -9,9 +16,6 @@ import { CheatSheet } from 'app/shared/cheat-sheet/cheat-sheet.model'; // Constants import { FactorioIconData } from 'app/shared/factorio-icon/factorio-icon.model'; -import { BURNABLES_DATA } from '../basic-power/burnables.data'; -import { BELT_DATA, BeltData } from '../mining/belt.data'; -import { FurnaceData, FURNACES_DATA } from './furnaces.data'; import { MATERIAL_PROCESSING_DATA } from './material-processing.data'; interface CoalFurnaceTableColumn { @@ -26,8 +30,8 @@ interface CoalFurnaceTableRow { const coalFurnaceTableColumns: CoalFurnaceTableColumn[] = [ { icon: { name: 'Coal' } }, - ...BELT_DATA.map( - (belt: BeltData): CoalFurnaceTableColumn => ({ + ...BELT_DATA.beltInfo.map( + (belt: BeltInfo): CoalFurnaceTableColumn => ({ icon: { name: belt.name, spaceAge: belt.spaceAge }, }) ), @@ -38,7 +42,7 @@ FURNACES_DATA.forEach((furnace: FurnaceData) => { if (!groupedCoalFurnaceTableRows.has(furnace.energyConsumptionKw)) { groupedCoalFurnaceTableRows.set(furnace.energyConsumptionKw, { furnaceTypes: [], - furnaceCounts: BELT_DATA.map((belt: BeltData): number => + furnaceCounts: BELT_DATA.beltInfo.map((belt: BeltInfo): number => calcFurnaceCount(belt.throughput, furnace.energyConsumptionKw) ), }); diff --git a/src/app/cheat-sheets/game-base/mining/belt.data.ts b/src/app/cheat-sheets/game-base/mining/belt.data.ts deleted file mode 100644 index 0e64e62..0000000 --- a/src/app/cheat-sheets/game-base/mining/belt.data.ts +++ /dev/null @@ -1,39 +0,0 @@ -export interface BeltData { - spaceAge?: boolean; - name: string; - throughput: number; - undergroundSpacing: number; - icons: string[]; -} - -export const BELT_DATA: BeltData[] = [ - { - name: 'Transport_belt', - throughput: 15, - undergroundSpacing: 4, - icons: ['Transport_belt', 'Underground_belt', 'Splitter'], - }, - { - name: 'Fast_transport_belt', - throughput: 30, - undergroundSpacing: 6, - icons: ['Fast_transport_belt', 'Fast_underground_belt', 'Fast_splitter'], - }, - { - name: 'Express_transport_belt', - throughput: 45, - undergroundSpacing: 8, - icons: [ - 'Express_transport_belt', - 'Express_underground_belt', - 'Express_splitter', - ], - }, - { - name: 'Turbo_transport_belt', - throughput: 60, - undergroundSpacing: 10, - icons: ['Turbo_transport_belt', 'Turbo_underground_belt', 'Turbo_splitter'], - spaceAge: true, - }, -]; diff --git a/src/app/cheat-sheets/game-base/mining/mining.component.ts b/src/app/cheat-sheets/game-base/mining/mining.component.ts index 2d610f6..8bd93ab 100644 --- a/src/app/cheat-sheets/game-base/mining/mining.component.ts +++ b/src/app/cheat-sheets/game-base/mining/mining.component.ts @@ -1,5 +1,13 @@ // Angular Imports import { Component, OnInit } from '@angular/core'; +import { + BELT_DATA, + BeltInfo, + DRILL_DATA, + DrillData, + ORE_DATA, + OreData, +} from 'app/data'; // Models import { Data } from 'app/models/Data.model'; // Services @@ -10,11 +18,7 @@ import { CheatSheet } from 'app/shared/cheat-sheet/cheat-sheet.model'; // RXJS import { combineLatest } from 'rxjs'; -import { BELTS_DATA } from '../belts/belts.data'; -import { BELT_DATA, BeltData } from './belt.data'; -import { DRILL_DATA, DrillData } from './drill.data'; import { MINING_DATA } from './mining.data'; -import { ORE_DATA, OreData } from './ore.data'; interface MineTableColumn { name: string; @@ -38,7 +42,7 @@ const prodBonusPercent = 10; const miningTableColumns: MineTableColumn[] = [ { name: 'Ore', type: 'Text' }, { name: 'Drill', type: 'Text' }, - ...BELTS_DATA.data.belt_info.map( + ...BELT_DATA.beltInfo.map( (belt): MineTableColumn => ({ name: belt.icons[0], type: belt.spaceAge ? 'FactorioSaIcon' : 'FactorioIcon', @@ -66,8 +70,8 @@ ORE_DATA.forEach((ore: OreData) => { spaceAge: drillData.spaceAge, miner: drillData.name, rate, - beltRates: BELT_DATA.map( - (beltData: BeltData): number => beltData.throughput / rate + beltRates: BELT_DATA.beltInfo.map( + (beltData: BeltInfo): number => beltData.throughput / rate ), }; }), @@ -133,8 +137,8 @@ export class MiningComponent implements OnInit { this.mineTableRowGroups.forEach((value: MineTableRowGroup) => { value.mineData.forEach((row: MineTableRow) => { - row.beltRates = BELT_DATA.map( - (beltData: BeltData): number => + row.beltRates = BELT_DATA.beltInfo.map( + (beltData: BeltInfo): number => beltData.throughput / (row.rate * productivity) ); }); diff --git a/src/app/cheat-sheets/game-base/basic-power/calculator-solar/calculator-solar.component.html b/src/app/cheat-sheets/game-base/power-solar/calculator-solar/calculator-solar.component.html similarity index 100% rename from src/app/cheat-sheets/game-base/basic-power/calculator-solar/calculator-solar.component.html rename to src/app/cheat-sheets/game-base/power-solar/calculator-solar/calculator-solar.component.html diff --git a/src/app/cheat-sheets/game-base/basic-power/calculator-solar/calculator-solar.component.stories.ts b/src/app/cheat-sheets/game-base/power-solar/calculator-solar/calculator-solar.component.stories.ts similarity index 58% rename from src/app/cheat-sheets/game-base/basic-power/calculator-solar/calculator-solar.component.stories.ts rename to src/app/cheat-sheets/game-base/power-solar/calculator-solar/calculator-solar.component.stories.ts index 6f92151..c00e7ab 100644 --- a/src/app/cheat-sheets/game-base/basic-power/calculator-solar/calculator-solar.component.stories.ts +++ b/src/app/cheat-sheets/game-base/power-solar/calculator-solar/calculator-solar.component.stories.ts @@ -1,24 +1,26 @@ import { Meta, moduleMetadata, StoryObj } from '@storybook/angular'; import { DataService } from 'app/services'; +import { POWER_SOLAR_DATA } from '../power-solar.data'; import { CalculatorSolarComponent } from './calculator-solar.component'; -import { CalculatorSolarModule } from './calculator-solar.module'; type ComponentWithCustomControls = CalculatorSolarComponent; // More on how to set up stories at: https://storybook.js.org/docs/7.0/angular/writing-stories/introduction const meta: Meta = { - title: 'Cheat Sheets/Game Base/Basic Power/Calculator Solar', + title: 'Cheat Sheets/Game Base/Power Solar/Calculator Solar', component: CalculatorSolarComponent, decorators: [ - moduleMetadata({ - imports: [CalculatorSolarModule], - providers: [DataService], - }), + moduleMetadata({ imports: [], providers: [DataService] }), + // applicationConfig({ providers: [importProvidersFrom()] }), ], + parameters: { + docs: { description: { component: `PowerSolar` } }, + // layout: 'fullscreen', + }, args: { - solarPowerRatio: 0.7, - solarAvgMw: 42 / 1000, // MW + solarPowerEffectiveness: POWER_SOLAR_DATA.solarPowerEffectiveness, + solarAvgMw: POWER_SOLAR_DATA.solarEnergyAvgKw / 1000, // MW }, }; diff --git a/src/app/cheat-sheets/game-base/basic-power/calculator-solar/calculator-solar.component.ts b/src/app/cheat-sheets/game-base/power-solar/calculator-solar/calculator-solar.component.ts similarity index 70% rename from src/app/cheat-sheets/game-base/basic-power/calculator-solar/calculator-solar.component.ts rename to src/app/cheat-sheets/game-base/power-solar/calculator-solar/calculator-solar.component.ts index a52fb61..b191448 100644 --- a/src/app/cheat-sheets/game-base/basic-power/calculator-solar/calculator-solar.component.ts +++ b/src/app/cheat-sheets/game-base/power-solar/calculator-solar/calculator-solar.component.ts @@ -1,5 +1,10 @@ +import { CommonModule } from '@angular/common'; import { Component, Input } from '@angular/core'; +import { FormsModule } from '@angular/forms'; import { DataService } from 'app/services'; +import { FactorioIconModule } from 'app/shared'; + +import { POWER_SOLAR_DATA } from '../power-solar.data'; interface SolarCalcData { solarPanels: number; @@ -10,24 +15,27 @@ interface SolarCalcData { @Component({ selector: 'app-calculator-solar', templateUrl: './calculator-solar.component.html', + standalone: true, + imports: [CommonModule, FormsModule, FactorioIconModule], }) export class CalculatorSolarComponent { @Input() - public solarPowerRatio = 0.7; + public solarPowerEffectiveness: number = + POWER_SOLAR_DATA.solarPowerEffectiveness; @Input() - public solarAvgMw: number = 42 / 1000; // MW + public solarAvgMw: number = POWER_SOLAR_DATA.solarEnergyAvgKw / 1000; // MW - constructor(public dataService: DataService) { + constructor(protected dataService: DataService) { this.onCalcFromSolar(); } - public solarCalcData: SolarCalcData = { + protected solarCalcData: SolarCalcData = { solarPanels: 850, accumulators: 21, usablePower: 0.7, }; - public onCalcFromSolar(): void { + protected onCalcFromSolar(): void { this.solarCalcData.accumulators = this.getAccumulatorsFromSolar( this.solarCalcData.solarPanels ); @@ -36,7 +44,7 @@ export class CalculatorSolarComponent { ); } - public onCalcFromPower(): void { + protected onCalcFromPower(): void { this.solarCalcData.solarPanels = this.getSolarFromPower( this.solarCalcData.usablePower ); @@ -45,7 +53,7 @@ export class CalculatorSolarComponent { ); } - public onCalcFromAccumulators(): void { + protected onCalcFromAccumulators(): void { this.solarCalcData.solarPanels = this.getSolarFromAccumulators( this.solarCalcData.accumulators ); diff --git a/src/app/cheat-sheets/game-base/power-solar/power-solar.component.html b/src/app/cheat-sheets/game-base/power-solar/power-solar.component.html new file mode 100644 index 0000000..32a22f8 --- /dev/null +++ b/src/app/cheat-sheets/game-base/power-solar/power-solar.component.html @@ -0,0 +1,80 @@ + +
+

+ + Solar Power (Usable) + Build Ratio + +
+ + + + + + + {{ POWER_SOLAR_DATA.solarBuildRatio.solarRatioPowerMw }}MW + +

+ +

+ + Solar Total to Usable + +
+ + + + + {{ 10 * POWER_SOLAR_DATA.solarPowerEffectiveness }}MW + +

+
+ +
+ +
+
+
    +
  • + Solar panels + only provide energy during the day.
    + ( {{ POWER_SOLAR_DATA.solarEnergyMaxKw }}KW Max, {{ POWER_SOLAR_DATA.solarEnergyAvgKw }}KW average per solar panel, ratio of + {{ POWER_SOLAR_DATA.solarBuildRatio.solarRatioPowerMw | percent }} + "usable" to total) +
  • +
  • + 10MW worth of solar panels will power a factory of + {{ 10 * POWER_SOLAR_DATA.solarPowerEffectiveness }}MW on Nauvis. +
  • +
  • + During the day, excess power generated is stored in + accumulators, during the night, accumulators + release their charge to power your factory. +
  • +
  • Place accumulators until they can keep your factory powered through the night.
  • +
  • Add some extra accumulators to account for burst consumption, such as firing a lot of lasers.
  • +
  • Then place solar panels until those accumulators are fully charged by the end of the day.
  • +
  • + User + Cilya on the forums + did the + + math + + to figure out exactly how many solar panels we need per accumulator. +
  • +
+
+ +
+ +
+
+
diff --git a/src/app/cheat-sheets/game-base/power-solar/power-solar.component.stories.ts b/src/app/cheat-sheets/game-base/power-solar/power-solar.component.stories.ts new file mode 100644 index 0000000..3215522 --- /dev/null +++ b/src/app/cheat-sheets/game-base/power-solar/power-solar.component.stories.ts @@ -0,0 +1,36 @@ +import { Meta, moduleMetadata, StoryObj } from '@storybook/angular'; +import { StoryFnAngularReturnType } from '@storybook/angular/dist/client/types'; +import { StorybookCsModule } from 'app/shared/storybook-cs.module'; + +import { PowerSolarComponent } from './power-solar.component'; + +type ComponentWithCustomControls = PowerSolarComponent; + +const meta: Meta = { + title: 'Cheat Sheets/Game Base/Power Solar', + component: PowerSolarComponent, + decorators: [ + moduleMetadata({ imports: [StorybookCsModule] }), + // applicationConfig({ providers: [importProvidersFrom()] }), + ], + parameters: { + docs: { description: { component: `PowerSolar` } }, + // layout: 'fullscreen', + }, + argTypes: { + /** === Input Mapping === */ + // input: { options: ['---', ...Object.values(YourEnum)], mapping: YourEnum & { '---': undefined }, control: { type: 'select' }} + /** === Output Actions === */ + // inputChange: { action: 'inputChange', table: { disable: true } } + /** === Control Hide === */ + // someControl: { table: { disable: true } } + /** === Control Disable === */ + // someControl: { control: { disable: true } } + }, + args: {}, +}; +export default meta; + +export const PowerSolar: StoryObj = { + render: (args): StoryFnAngularReturnType => ({ props: args }), +}; diff --git a/src/app/cheat-sheets/game-base/power-solar/power-solar.component.ts b/src/app/cheat-sheets/game-base/power-solar/power-solar.component.ts new file mode 100644 index 0000000..1f22f3c --- /dev/null +++ b/src/app/cheat-sheets/game-base/power-solar/power-solar.component.ts @@ -0,0 +1,32 @@ +import { CommonModule } from '@angular/common'; +import { Component } from '@angular/core'; +import { DataService } from 'app/services'; +import { FactorioIconModule } from 'app/shared'; +import { CheatSheetTemplateComponent } from 'app/shared/cheat-sheet-template/cheat-sheet-template.component'; + +import { CalculatorSolarComponent } from './calculator-solar/calculator-solar.component'; +import { POWER_SOLAR_DATA, PowerSolarData } from './power-solar.data'; + +export const POWER_SOLAR_SHEET_ICON = 'Solar_panel'; +export const POWER_SOLAR_SHEET_TITLE = 'Solar Power'; + +@Component({ + selector: 'app-power-solar', + templateUrl: './power-solar.component.html', + styles: [':host{display:contents}'], // Makes component host as if it was not there, can offer less css headaches. Use @HostBinding class approach for easier overrides. + standalone: true, + imports: [ + CommonModule, + FactorioIconModule, + CheatSheetTemplateComponent, + CalculatorSolarComponent, + ], +}) +export class PowerSolarComponent { + protected readonly cheatSheetIconId: string = POWER_SOLAR_SHEET_ICON; + protected readonly cheatSheetTitle: string = POWER_SOLAR_SHEET_TITLE; + + protected readonly POWER_SOLAR_DATA: PowerSolarData = POWER_SOLAR_DATA; + + constructor(protected dataService: DataService) {} +} diff --git a/src/app/cheat-sheets/game-base/power-solar/power-solar.data.ts b/src/app/cheat-sheets/game-base/power-solar/power-solar.data.ts new file mode 100644 index 0000000..8b91e83 --- /dev/null +++ b/src/app/cheat-sheets/game-base/power-solar/power-solar.data.ts @@ -0,0 +1,34 @@ +import { SimpleRatio } from 'app/data'; + +export interface PowerSolarData { + solarBuildRatio: SolarBuildRatio; + solarEnergyMaxKw: number; + solarEnergyAvgKw: number; + /** Effective solar power due to no power at night */ + solarPowerEffectiveness: number; +} + +interface SolarBuildRatio { + solarRatioPowerMw: number; + solarRatio: SimpleRatio[]; +} + +export const POWER_SOLAR_DATA: PowerSolarData = { + solarBuildRatio: { + solarRatioPowerMw: 1, + solarRatio: [ + { + iconId: 'Solar_panel', + count: 25, + }, + { + iconId: 'Accumulator', + count: 21, + }, + ], + }, + + solarEnergyMaxKw: 60, + solarEnergyAvgKw: 42, + solarPowerEffectiveness: 0.7, +}; diff --git a/src/app/cheat-sheets/game-base/power-steam/power-steam.component.html b/src/app/cheat-sheets/game-base/power-steam/power-steam.component.html new file mode 100644 index 0000000..7f7f2ad --- /dev/null +++ b/src/app/cheat-sheets/game-base/power-steam/power-steam.component.html @@ -0,0 +1,102 @@ + +
+

+ + Steam Power + Build Ratio
+ + + + + + {{ POWER_STEAM_DATA.steamBuildRatio.steamRatioPowerMw }}MW +

+
+ +
+ +
    +
  • + An + offshore pump + provides + {{ POWER_STEAM_DATA.offshorePumpWater }} + units of water per second. +
  • +
  • + A + steam boiler + can convert up to + {{ POWER_STEAM_DATA.steamBoilerWater }} + units of water into + {{ POWER_STEAM_DATA.steamBoilerSteam }} + units of steam per second, providing + {{ POWER_STEAM_DATA.steamBoilerEnergyMj }}MJ of steam (at 165 °C). +
  • +
  • + A steam boiler consumes + {{ POWER_STEAM_DATA.steamBoilerEnergyMj }}MJ of fuel per second. +
  • +
  • + A + steam engine + can convert + {{ POWER_STEAM_DATA.steamEngineSteam }} + units of steam (at 165 °C) per second into + {{ POWER_STEAM_DATA.steamEnginePowerMw }}MW of electric power. +
  • +
  • + {{ POWER_STEAM_DATA.steamBuildRatio.steamRatio[2].count }} + steam engines will provide + {{ POWER_STEAM_DATA.steamBuildRatio.steamRatioPowerMw }}MW of power. +
  • +
+ + + + + + + + + + + + + + + + + + + + + + +
+ + Boilers supported by a full belt of fuel +
+ (Rounded up to nearest whole number) +
+ + {{ col.name }} + + + + +
+ + {{ boilerCount }}
+ +

+ Boilers supported by belt of fuel = Belt Throughput(i/s) * [Fuel Energy(MJ) / Boiler Energy({{ + POWER_STEAM_DATA.steamBoilerEnergyMj + }}MJ)] +

+
diff --git a/src/app/cheat-sheets/game-base/power-steam/power-steam.component.stories.ts b/src/app/cheat-sheets/game-base/power-steam/power-steam.component.stories.ts new file mode 100644 index 0000000..3d5f2cc --- /dev/null +++ b/src/app/cheat-sheets/game-base/power-steam/power-steam.component.stories.ts @@ -0,0 +1,37 @@ +import { Meta, moduleMetadata, StoryObj } from '@storybook/angular'; +import { StoryFnAngularReturnType } from '@storybook/angular/dist/client/types'; +import { StorybookCsModule } from 'app/shared/storybook-cs.module'; + +import { PowerSteamComponent } from './power-steam.component'; + +type ComponentWithCustomControls = PowerSteamComponent; + +const meta: Meta = { + title: 'Cheat Sheets/Game Base/Power Steam', + component: PowerSteamComponent, + decorators: [ + moduleMetadata({ imports: [StorybookCsModule] }), + // applicationConfig({ providers: [importProvidersFrom()] }), + ], + parameters: { + docs: { description: { component: `PowerSteam` } }, + // layout: 'fullscreen', + }, + argTypes: { + /** === Input Mapping === */ + // input: { options: ['---', ...Object.values(YourEnum)], mapping: YourEnum & { '---': undefined }, control: { type: 'select' }} + /** === Output Actions === */ + // inputChange: { action: 'inputChange', table: { disable: true } } + /** === Control Hide === */ + // someControl: { table: { disable: true } } + /** === Control Disable === */ + // someControl: { control: { disable: true } } + }, + args: {}, +}; +export default meta; + +export const PowerSteam: StoryObj = { + args: {}, // Overrides args from default + render: (args): StoryFnAngularReturnType => ({ props: args }), +}; diff --git a/src/app/cheat-sheets/game-base/power-steam/power-steam.component.ts b/src/app/cheat-sheets/game-base/power-steam/power-steam.component.ts new file mode 100644 index 0000000..635c9a7 --- /dev/null +++ b/src/app/cheat-sheets/game-base/power-steam/power-steam.component.ts @@ -0,0 +1,65 @@ +import { CommonModule } from '@angular/common'; +import { Component } from '@angular/core'; +import { BELT_DATA, BeltInfo, BURNABLES_DATA, BurnablesData } from 'app/data'; +import { DataService } from 'app/services'; +import { FactorioIconModule } from 'app/shared'; +import { CheatSheetTemplateComponent } from 'app/shared/cheat-sheet-template/cheat-sheet-template.component'; +import { FactorioIconData } from 'app/shared/factorio-icon/factorio-icon.model'; + +import { POWER_STEAM_DATA, PowerSteamData } from './power-steam.data'; + +interface BoilerTableColumn extends FactorioIconData { + type: 'Text' | 'FactorioIcon'; +} + +interface BoilerTableRow extends FactorioIconData { + boilerCounts: number[]; +} + +export const POWER_STEAM_SHEET_ICON = 'Steam_engine'; +export const POWER_STEAM_SHEET_TITLE = 'Steam Power'; + +@Component({ + selector: 'app-power-steam', + templateUrl: './power-steam.component.html', + styles: [':host{display:contents}'], // Makes component host as if it was not there, can offer less css headaches. Use @HostBinding class approach for easier overrides. + // host: { class: 'contents' }, + standalone: true, + imports: [CommonModule, FactorioIconModule, CheatSheetTemplateComponent], +}) +export class PowerSteamComponent { + protected readonly cheatSheetIconId: string = POWER_STEAM_SHEET_ICON; + protected readonly cheatSheetTitle: string = POWER_STEAM_SHEET_TITLE; + + protected readonly POWER_STEAM_DATA: PowerSteamData = POWER_STEAM_DATA; + + protected boilerTableColumns: BoilerTableColumn[] = [ + { type: 'Text', name: '' }, + ...BURNABLES_DATA.map( + (burnable: BurnablesData): BoilerTableColumn => ({ + type: 'FactorioIcon', + spaceAge: burnable.spaceAge, + name: burnable.name, + text: + burnable.fuelEnergyMj > 1000 + ? `${burnable.fuelEnergyMj / 1000}GJ` + : `${burnable.fuelEnergyMj}MJ`, + }) + ), + ]; + + protected boilerTableRows: BoilerTableRow[] = BELT_DATA.beltInfo.map( + (belt: BeltInfo): BoilerTableRow => ({ + spaceAge: belt.spaceAge, + name: belt.name, + boilerCounts: BURNABLES_DATA.map((burnable: BurnablesData): number => + Math.ceil( + (belt.throughput * burnable.fuelEnergyMj) / + POWER_STEAM_DATA.steamBoilerEnergyMj + ) + ), + }) + ); + + constructor(protected dataService: DataService) {} +} diff --git a/src/app/cheat-sheets/game-base/power-steam/power-steam.data.ts b/src/app/cheat-sheets/game-base/power-steam/power-steam.data.ts new file mode 100644 index 0000000..cbaf5f4 --- /dev/null +++ b/src/app/cheat-sheets/game-base/power-steam/power-steam.data.ts @@ -0,0 +1,51 @@ +import { SimpleRatio } from 'app/data'; + +export interface PowerSteamData { + steamBuildRatio: SteamBuildRatio; + offshorePumpWater: number; + steamBoilerWater: number; + steamBoilerSteam: number; + steamBoilerEnergyMj: number; + steamEngineSteam: number; + steamEnginePowerMw: number; +} + +interface SteamBuildRatio { + steamRatioPowerMw: number; + steamRatio: SimpleRatio[]; +} + +export const POWER_STEAM_DATA: PowerSteamData = { + // TODO: Calculate? + steamBuildRatio: { + steamRatioPowerMw: 360, + steamRatio: [ + { + iconId: 'Offshore_pump', + count: 1, + }, + { + iconId: 'Boiler', + count: 200, + }, + { + iconId: 'Steam_engine', + count: 400, + }, + { + iconId: 'Electric_mining_drill', + count: 180, + }, + { + iconId: 'Transport_belt', + count: 6, + }, + ], + }, + offshorePumpWater: 1200, + steamBoilerWater: 6, + steamBoilerSteam: 60, + steamBoilerEnergyMj: 1.8, + steamEngineSteam: 30, + steamEnginePowerMw: 0.9, +}; diff --git a/src/app/cheat-sheets/game-base/space-age/space-age.component.stories.ts b/src/app/cheat-sheets/game-base/space-age/space-age.component.stories.ts index 40ba7c4..40b400a 100644 --- a/src/app/cheat-sheets/game-base/space-age/space-age.component.stories.ts +++ b/src/app/cheat-sheets/game-base/space-age/space-age.component.stories.ts @@ -1,15 +1,18 @@ -import { Meta, StoryObj } from '@storybook/angular'; +import { Meta, moduleMetadata, StoryObj } from '@storybook/angular'; import { StoryFnAngularReturnType } from '@storybook/angular/dist/client/types'; +import { StorybookCsModule } from 'app/shared/storybook-cs.module'; import { SpaceAgeComponent } from './space-age.component'; type ComponentWithCustomControls = SpaceAgeComponent; const meta: Meta = { - // TODO: Make sure this title path is correct, uncomment tile, then remove this comment. OR remove both comment and title - // title: 'Components/Space Age', + title: 'Cheat Sheets/Game Base/Space Age', component: SpaceAgeComponent, - // decorators: [moduleMetadata({ imports: [] }), applicationConfig({ providers: [ importProvidersFrom() ]})], + decorators: [ + moduleMetadata({ imports: [StorybookCsModule] }), + // applicationConfig({ providers: [importProvidersFrom()] }), + ], parameters: { docs: { description: { component: `SpaceAge` } }, // layout: 'fullscreen', diff --git a/src/app/cheat-sheets/game-base/space-age/space-age.component.ts b/src/app/cheat-sheets/game-base/space-age/space-age.component.ts index bd3e97c..39e5995 100644 --- a/src/app/cheat-sheets/game-base/space-age/space-age.component.ts +++ b/src/app/cheat-sheets/game-base/space-age/space-age.component.ts @@ -3,25 +3,29 @@ import { Component } from '@angular/core'; import { DataService } from 'app/services'; import { FactorioIconModule, RatioModule } from 'app/shared'; import { APP_INFO, AppInfo } from 'app/shared/app-settings'; -import { CheatSheetTemplateModule } from 'app/shared/cheat-sheet-template/cheat-sheet-template.module'; +import { CheatSheetTemplateComponent } from 'app/shared/cheat-sheet-template/cheat-sheet-template.component'; import { SPACE_AGE_DATA } from './space-age.data'; import { SpaceAgeData } from './space-age.model'; +export const SPACE_AGE_SHEET_ICON = 'Space_Age'; +export const SPACE_AGE_SHEET_TITLE = 'Space Age'; + @Component({ selector: 'app-space-age', templateUrl: './space-age.component.html', + styles: [':host{display:contents}'], // Makes component host as if it was not there, can offer less css headaches. Use @HostBinding class approach for easier overrides. standalone: true, imports: [ CommonModule, - CheatSheetTemplateModule, + CheatSheetTemplateComponent, FactorioIconModule, RatioModule, ], }) export class SpaceAgeComponent { - protected readonly cheatSheetIconId: string = 'Space_Age'; - protected readonly cheatSheetTitle: string = 'Space Age'; + protected readonly cheatSheetIconId: string = SPACE_AGE_SHEET_ICON; + protected readonly cheatSheetTitle: string = SPACE_AGE_SHEET_TITLE; protected readonly APP_INFO: AppInfo = APP_INFO; protected readonly SPACE_AGE_DATA: SpaceAgeData = SPACE_AGE_DATA; diff --git a/src/app/cheat-sheets/game-base/space-age/space-age.model.ts b/src/app/cheat-sheets/game-base/space-age/space-age.model.ts index ee3692b..7db11f0 100644 --- a/src/app/cheat-sheets/game-base/space-age/space-age.model.ts +++ b/src/app/cheat-sheets/game-base/space-age/space-age.model.ts @@ -1,3 +1,5 @@ +import { SimpleRatio } from 'app/data'; + import { Ratio } from '../cs-common-ratios/ratio.model'; export interface SpaceAgeData { @@ -10,8 +12,3 @@ export interface SpaceAgeData { recyclerScrapRatio: SimpleRatio[]; baseResources: string[][][]; } - -export interface SimpleRatio { - iconId: string; - count: number; -} diff --git a/src/app/cheat-sheets/game-base/train-colors/train-colors.component.html b/src/app/cheat-sheets/game-base/train-colors/train-colors.component.html index 7ae454a..d616f2c 100644 --- a/src/app/cheat-sheets/game-base/train-colors/train-colors.component.html +++ b/src/app/cheat-sheets/game-base/train-colors/train-colors.component.html @@ -2,7 +2,9 @@
- Suggested locomotive colors based on cargo + Suggested Locomotive/Stop colors based on cargo +
+ Trains will match the color of the destination stop, unless overridden.
Also see Train Painter Mod +

Wouldn't it be awesome to have cheat sheets for mods?

Some of you thought so! diff --git a/src/app/cheat-sheets/game-mods/contribute/contribute.component.spec.ts b/src/app/cheat-sheets/game-mods/contribute/contribute.component.spec.ts deleted file mode 100644 index 20cc42a..0000000 --- a/src/app/cheat-sheets/game-mods/contribute/contribute.component.spec.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; - -import { ContributeComponent } from './contribute.component'; -import { ContributeModule } from './contribute.module'; - -describe('ContributeComponent', () => { - let component: ContributeComponent; - let fixture: ComponentFixture; - - beforeEach(waitForAsync(() => { - TestBed.configureTestingModule({ - imports: [ContributeModule], - }).compileComponents(); - })); - - beforeEach(() => { - fixture = TestBed.createComponent(ContributeComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/src/app/cheat-sheets/game-mods/contribute/contribute.component.stories.ts b/src/app/cheat-sheets/game-mods/contribute/contribute.component.stories.ts index 4e00db1..72d1880 100644 --- a/src/app/cheat-sheets/game-mods/contribute/contribute.component.stories.ts +++ b/src/app/cheat-sheets/game-mods/contribute/contribute.component.stories.ts @@ -2,7 +2,6 @@ import { Meta, moduleMetadata, Story } from '@storybook/angular'; import { StorybookCsModule } from 'app/shared/storybook-cs.module'; import { ContributeComponent } from './contribute.component'; -import { ContributeModule } from './contribute.module'; type ComponentWithCustomControls = ContributeComponent; @@ -11,7 +10,7 @@ const meta: Meta = { component: ContributeComponent, decorators: [ moduleMetadata({ - imports: [ContributeModule, StorybookCsModule], + imports: [StorybookCsModule], }), ], parameters: { diff --git a/src/app/cheat-sheets/game-mods/contribute/contribute.component.ts b/src/app/cheat-sheets/game-mods/contribute/contribute.component.ts index 3d63fab..f146c5e 100644 --- a/src/app/cheat-sheets/game-mods/contribute/contribute.component.ts +++ b/src/app/cheat-sheets/game-mods/contribute/contribute.component.ts @@ -1,13 +1,22 @@ +import { CommonModule } from '@angular/common'; import { Component } from '@angular/core'; +import { CheatSheetTemplateComponent } from 'app/shared/cheat-sheet-template/cheat-sheet-template.component'; import { Links, MOD_REQUESTS } from './contribute.data'; +export const CONTRIBUTE_SHEET_ICON = 'Steam_engine'; +export const CONTRIBUTE_SHEET_TITLE = 'Steam Power'; + @Component({ selector: 'app-contribute', templateUrl: './contribute.component.html', + styles: [':host{display:contents}'], // Makes component host as if it was not there, can offer less css headaches. Use @HostBinding class approach for easier overrides. + standalone: true, + imports: [CommonModule, CheatSheetTemplateComponent], }) export class ContributeComponent { - public readonly iconId: string = 'Blueprint'; - public readonly title: string = 'Contribute'; + protected readonly cheatSheetIconId: string = CONTRIBUTE_SHEET_ICON; + protected readonly cheatSheetTitle: string = CONTRIBUTE_SHEET_TITLE; + public readonly MOD_REQUESTS: Links[] = MOD_REQUESTS; } diff --git a/src/app/cheat-sheets/game-mods/contribute/contribute.module.spec.ts b/src/app/cheat-sheets/game-mods/contribute/contribute.module.spec.ts deleted file mode 100644 index 15e9962..0000000 --- a/src/app/cheat-sheets/game-mods/contribute/contribute.module.spec.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { TestBed } from '@angular/core/testing'; - -import { ContributeModule } from './contribute.module'; - -describe('ContributeModule', () => { - beforeEach(() => { - TestBed.configureTestingModule({ - imports: [ContributeModule], - }); - }); - - it('initializes', () => { - const module: ContributeModule = TestBed.inject(ContributeModule); - expect(module).toBeTruthy(); - }); -}); diff --git a/src/app/cheat-sheets/game-mods/contribute/contribute.module.ts b/src/app/cheat-sheets/game-mods/contribute/contribute.module.ts deleted file mode 100644 index 84d1ec0..0000000 --- a/src/app/cheat-sheets/game-mods/contribute/contribute.module.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { CommonModule } from '@angular/common'; -import { NgModule } from '@angular/core'; -import { CheatSheetTemplateModule } from 'app/shared/cheat-sheet-template/cheat-sheet-template.module'; - -import { ContributeComponent } from './contribute.component'; - -@NgModule({ - imports: [CommonModule, CheatSheetTemplateModule], - declarations: [ContributeComponent], - exports: [ContributeComponent], -}) -export class ContributeModule {} diff --git a/src/app/cheat-sheets/game-mods/game-mods.module.ts b/src/app/cheat-sheets/game-mods/game-mods.module.ts index 02184ab..5f2cd8c 100644 --- a/src/app/cheat-sheets/game-mods/game-mods.module.ts +++ b/src/app/cheat-sheets/game-mods/game-mods.module.ts @@ -2,10 +2,10 @@ import { CommonModule } from '@angular/common'; import { NgModule } from '@angular/core'; import { RouterModule } from '@angular/router'; -import { ContributeModule } from './contribute/contribute.module'; +import { ContributeComponent } from './contribute/contribute.component'; import { GameModsComponent } from './game-mods.component'; import { ROUTES_GAME_MODS } from './game-mods.routes'; -import { PopularModsModule } from './popular-mods/popular-mods.module'; +import { PopularModsComponent } from './popular-mods/popular-mods.component'; @NgModule({ imports: [ @@ -13,8 +13,8 @@ import { PopularModsModule } from './popular-mods/popular-mods.module'; RouterModule.forChild(ROUTES_GAME_MODS), // Sheets - ContributeModule, - PopularModsModule, + ContributeComponent, + PopularModsComponent, ], declarations: [GameModsComponent], exports: [GameModsComponent, RouterModule], diff --git a/src/app/cheat-sheets/game-mods/popular-mods/popular-mods.component.html b/src/app/cheat-sheets/game-mods/popular-mods/popular-mods.component.html index 03542d0..3c80f49 100644 --- a/src/app/cheat-sheets/game-mods/popular-mods/popular-mods.component.html +++ b/src/app/cheat-sheets/game-mods/popular-mods/popular-mods.component.html @@ -1,4 +1,4 @@ - +

Factorio Mod Portal

diff --git a/src/app/cheat-sheets/game-mods/popular-mods/popular-mods.component.spec.ts b/src/app/cheat-sheets/game-mods/popular-mods/popular-mods.component.spec.ts deleted file mode 100644 index 14edc42..0000000 --- a/src/app/cheat-sheets/game-mods/popular-mods/popular-mods.component.spec.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; - -import { PopularModsComponent } from './popular-mods.component'; -import { PopularModsModule } from './popular-mods.module'; - -describe('UtilityModsComponent', () => { - let component: PopularModsComponent; - let fixture: ComponentFixture; - - beforeEach(waitForAsync(() => { - TestBed.configureTestingModule({ - imports: [PopularModsModule], - }).compileComponents(); - })); - - beforeEach(() => { - fixture = TestBed.createComponent(PopularModsComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/src/app/cheat-sheets/game-mods/popular-mods/popular-mods.component.stories.ts b/src/app/cheat-sheets/game-mods/popular-mods/popular-mods.component.stories.ts index 829297c..54b0a27 100644 --- a/src/app/cheat-sheets/game-mods/popular-mods/popular-mods.component.stories.ts +++ b/src/app/cheat-sheets/game-mods/popular-mods/popular-mods.component.stories.ts @@ -2,7 +2,6 @@ import { Meta, moduleMetadata, Story } from '@storybook/angular'; import { StorybookCsModule } from 'app/shared/storybook-cs.module'; import { PopularModsComponent } from './popular-mods.component'; -import { PopularModsModule } from './popular-mods.module'; type ComponentWithCustomControls = PopularModsComponent; @@ -11,7 +10,7 @@ const meta: Meta = { component: PopularModsComponent, decorators: [ moduleMetadata({ - imports: [PopularModsModule, StorybookCsModule], + imports: [StorybookCsModule], }), ], parameters: { diff --git a/src/app/cheat-sheets/game-mods/popular-mods/popular-mods.component.ts b/src/app/cheat-sheets/game-mods/popular-mods/popular-mods.component.ts index c8ade80..5a174a3 100644 --- a/src/app/cheat-sheets/game-mods/popular-mods/popular-mods.component.ts +++ b/src/app/cheat-sheets/game-mods/popular-mods/popular-mods.component.ts @@ -1,14 +1,30 @@ +import { CommonModule } from '@angular/common'; import { Component } from '@angular/core'; +import { RouterModule } from '@angular/router'; +import { FactorioIconModule } from 'app/shared'; +import { CheatSheetTemplateComponent } from 'app/shared/cheat-sheet-template/cheat-sheet-template.component'; import { MOD_LIST, ModGroup } from './popular-mods.data'; +export const POPULAR_MODS_SHEET_ICON = 'Repair_pack'; +export const POPULAR_MODS_SHEET_TITLE = 'Popular Mod List'; + @Component({ selector: 'app-popular-mods', templateUrl: './popular-mods.component.html', + styles: [':host{display:contents}'], // Makes component host as if it was not there, can offer less css headaches. Use @HostBinding class approach for easier overrides. + standalone: true, + imports: [ + CommonModule, + FactorioIconModule, + CheatSheetTemplateComponent, + RouterModule, + ], }) export class PopularModsComponent { - public readonly iconId: string = 'Repair_pack'; - public readonly title: string = 'Popular Mod List'; + protected readonly cheatSheetIconId: string = POPULAR_MODS_SHEET_ICON; + protected readonly cheatSheetTitle: string = POPULAR_MODS_SHEET_TITLE; + public readonly MOD_LIST: ModGroup[] = MOD_LIST; public getModSearchLink(modName: string): string | undefined { diff --git a/src/app/cheat-sheets/game-mods/popular-mods/popular-mods.module.spec.ts b/src/app/cheat-sheets/game-mods/popular-mods/popular-mods.module.spec.ts deleted file mode 100644 index 473b2e7..0000000 --- a/src/app/cheat-sheets/game-mods/popular-mods/popular-mods.module.spec.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { TestBed } from '@angular/core/testing'; - -import { PopularModsModule } from './popular-mods.module'; - -describe('UtilityModsModule', () => { - beforeEach(() => { - TestBed.configureTestingModule({ - imports: [PopularModsModule], - }); - }); - - it('initializes', () => { - const module: PopularModsModule = TestBed.inject(PopularModsModule); - expect(module).toBeTruthy(); - }); -}); diff --git a/src/app/cheat-sheets/game-mods/popular-mods/popular-mods.module.ts b/src/app/cheat-sheets/game-mods/popular-mods/popular-mods.module.ts deleted file mode 100644 index 31ea738..0000000 --- a/src/app/cheat-sheets/game-mods/popular-mods/popular-mods.module.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { CommonModule } from '@angular/common'; -import { NgModule } from '@angular/core'; -import { RouterModule } from '@angular/router'; -import { CheatSheetTemplateModule } from 'app/shared/cheat-sheet-template/cheat-sheet-template.module'; - -import { PopularModsComponent } from './popular-mods.component'; - -@NgModule({ - imports: [CommonModule, CheatSheetTemplateModule, RouterModule], - declarations: [PopularModsComponent], - exports: [PopularModsComponent], -}) -export class PopularModsModule {} diff --git a/src/app/data/belt.data.ts b/src/app/data/belt.data.ts new file mode 100644 index 0000000..a4df414 --- /dev/null +++ b/src/app/data/belt.data.ts @@ -0,0 +1,51 @@ +export interface BeltData { + beltDensity: number; + beltInfo: BeltInfo[]; +} + +export interface BeltInfo { + spaceAge?: boolean; + name: string; + throughput: number; + undergroundSpacing: number; + icons: string[]; +} + +export const BELT_DATA: BeltData = { + beltDensity: 8, + beltInfo: [ + { + name: 'Transport_belt', + throughput: 15, + undergroundSpacing: 4, + icons: ['Transport_belt', 'Underground_belt', 'Splitter'], + }, + { + name: 'Fast_transport_belt', + throughput: 30, + undergroundSpacing: 6, + icons: ['Fast_transport_belt', 'Fast_underground_belt', 'Fast_splitter'], + }, + { + name: 'Express_transport_belt', + throughput: 45, + undergroundSpacing: 8, + icons: [ + 'Express_transport_belt', + 'Express_underground_belt', + 'Express_splitter', + ], + }, + { + name: 'Turbo_transport_belt', + throughput: 60, + undergroundSpacing: 10, + icons: [ + 'Turbo_transport_belt', + 'Turbo_underground_belt', + 'Turbo_splitter', + ], + spaceAge: true, + }, + ], +}; diff --git a/src/app/cheat-sheets/game-base/basic-power/burnables.data.ts b/src/app/data/burnables.data.ts similarity index 99% rename from src/app/cheat-sheets/game-base/basic-power/burnables.data.ts rename to src/app/data/burnables.data.ts index 2b4141c..f025ff0 100644 --- a/src/app/cheat-sheets/game-base/basic-power/burnables.data.ts +++ b/src/app/data/burnables.data.ts @@ -3,6 +3,7 @@ export interface BurnablesData { name: string; fuelEnergyMj: number; } + export const BURNABLES_DATA: BurnablesData[] = [ { name: 'Wood', fuelEnergyMj: 2 }, { name: 'Coal', fuelEnergyMj: 4 }, diff --git a/src/app/cheat-sheets/game-base/mining/drill.data.ts b/src/app/data/drill.data.ts similarity index 100% rename from src/app/cheat-sheets/game-base/mining/drill.data.ts rename to src/app/data/drill.data.ts diff --git a/src/app/cheat-sheets/game-base/material-processing/furnaces.data.ts b/src/app/data/furnaces.data.ts similarity index 100% rename from src/app/cheat-sheets/game-base/material-processing/furnaces.data.ts rename to src/app/data/furnaces.data.ts diff --git a/src/app/data/index.ts b/src/app/data/index.ts new file mode 100644 index 0000000..ed4126d --- /dev/null +++ b/src/app/data/index.ts @@ -0,0 +1,8 @@ +export * from './belt.data'; +export * from './burnables.data'; +export * from './drill.data'; +export * from './furnaces.data'; +export * from './ore.data'; + +// TODO move to shared models later +export * from './simple-ratio.model'; diff --git a/src/app/cheat-sheets/game-base/mining/ore.data.ts b/src/app/data/ore.data.ts similarity index 100% rename from src/app/cheat-sheets/game-base/mining/ore.data.ts rename to src/app/data/ore.data.ts diff --git a/src/app/data/simple-ratio.model.ts b/src/app/data/simple-ratio.model.ts new file mode 100644 index 0000000..fb253f2 --- /dev/null +++ b/src/app/data/simple-ratio.model.ts @@ -0,0 +1,4 @@ +export interface SimpleRatio { + iconId: string; + count: number; +} diff --git a/src/app/layout/nav/nav.data.ts b/src/app/layout/nav/nav.data.ts index f622c00..3708825 100644 --- a/src/app/layout/nav/nav.data.ts +++ b/src/app/layout/nav/nav.data.ts @@ -1,13 +1,22 @@ import { CheatSheetCategory } from 'app/cheat-sheets/cheat-sheets.module'; +import { BELTS_SHEET_TITLE } from 'app/cheat-sheets/game-base/belts/belts.component'; +import { CS_COMMON_RATIOS_SHEET_TITLE } from 'app/cheat-sheets/game-base/cs-common-ratios/cs-common-ratios.component'; +import { POWER_SOLAR_SHEET_TITLE } from 'app/cheat-sheets/game-base/power-solar/power-solar.component'; +import { POWER_STEAM_SHEET_TITLE } from 'app/cheat-sheets/game-base/power-steam/power-steam.component'; +import { SPACE_AGE_SHEET_TITLE } from 'app/cheat-sheets/game-base/space-age/space-age.component'; +import { CONTRIBUTE_SHEET_TITLE } from 'app/cheat-sheets/game-mods/contribute/contribute.component'; +import { POPULAR_MODS_SHEET_TITLE } from 'app/cheat-sheets/game-mods/popular-mods/popular-mods.component'; +import { getIdFromTitle } from 'app/shared/cheat-sheet-template/cheat-sheet-template.component'; export const NAV_BASE: string[] = [ - 'common-ratios', - 'belts', + getIdFromTitle(CS_COMMON_RATIOS_SHEET_TITLE), + getIdFromTitle(BELTS_SHEET_TITLE), 'balancers', 'material-processing', 'mining', 'science', - 'basic-power', + getIdFromTitle(POWER_STEAM_SHEET_TITLE), + getIdFromTitle(POWER_SOLAR_SHEET_TITLE), 'nuclear-power', 'oil-refining', 'fluid-wagon-transfer', @@ -18,11 +27,16 @@ export const NAV_BASE: string[] = [ 'productivity-module-payoffs', 'vehicle-fuel-bonus', 'train-colors', - 'space-age', + getIdFromTitle(POWER_STEAM_SHEET_TITLE), + getIdFromTitle(SPACE_AGE_SHEET_TITLE), 'tips', 'links', ]; -export const NAV_MODS: string[] = ['contribute', 'popular-mod-list']; + +export const NAV_MODS: string[] = [ + getIdFromTitle(CONTRIBUTE_SHEET_TITLE), + getIdFromTitle(POPULAR_MODS_SHEET_TITLE), +]; export const NAV_ANCHOR_TAGS: Record = { base: NAV_BASE, diff --git a/src/app/models/BasicPowerData.model.ts b/src/app/models/BasicPowerData.model.ts deleted file mode 100644 index 3633e9a..0000000 --- a/src/app/models/BasicPowerData.model.ts +++ /dev/null @@ -1,25 +0,0 @@ -export interface BasicPowerData { - steamRatioPower: string; - steamRatio: SteamRatio[]; - solarRatioPower: string; - solarRatio: SolarRatio[]; - offshore_pump_water: number; - steam_boiler_water: number; - steam_boiler_steam: number; - steam_boiler_energy: string; - steam_engine_steam: number; - steam_engine_power: string; - solar_energy_max: number; - solar_energy_avg: number; - solar_energy_unit: string; -} - -export interface SteamRatio { - iconId: string; - count: number; -} - -export interface SolarRatio { - iconId: string; - count: number; -} diff --git a/src/app/models/BeltsData.model.ts b/src/app/models/BeltsData.model.ts deleted file mode 100644 index 92e3c54..0000000 --- a/src/app/models/BeltsData.model.ts +++ /dev/null @@ -1,12 +0,0 @@ -export interface BeltsData { - belt_density: number; - belt_info: BeltInfo[]; -} - -export interface BeltInfo { - tier: number; - icons: string[]; - throughput: number; - underground_spacing: number; - spaceAge?: boolean; -} diff --git a/src/app/shared/cheat-sheet-template/cheat-sheet-template.component.html b/src/app/shared/cheat-sheet-template/cheat-sheet-template.component.html index 87636fb..40da120 100644 --- a/src/app/shared/cheat-sheet-template/cheat-sheet-template.component.html +++ b/src/app/shared/cheat-sheet-template/cheat-sheet-template.component.html @@ -1,7 +1,7 @@

-
+
diff --git a/src/app/shared/cheat-sheet-template/cheat-sheet-template.component.spec.ts b/src/app/shared/cheat-sheet-template/cheat-sheet-template.component.spec.ts deleted file mode 100644 index bdd8be1..0000000 --- a/src/app/shared/cheat-sheet-template/cheat-sheet-template.component.spec.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; - -import { CheatSheetTemplateComponent } from './cheat-sheet-template.component'; -import { CheatSheetTemplateModule } from './cheat-sheet-template.module'; - -describe('CheatSheetTemplateComponent', () => { - let component: CheatSheetTemplateComponent; - let fixture: ComponentFixture; - - beforeEach(waitForAsync(() => { - TestBed.configureTestingModule({ - imports: [CheatSheetTemplateModule], - }).compileComponents(); - })); - - beforeEach(() => { - fixture = TestBed.createComponent(CheatSheetTemplateComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/src/app/shared/cheat-sheet-template/cheat-sheet-template.component.stories.ts b/src/app/shared/cheat-sheet-template/cheat-sheet-template.component.stories.ts index d7affe3..1f995ea 100644 --- a/src/app/shared/cheat-sheet-template/cheat-sheet-template.component.stories.ts +++ b/src/app/shared/cheat-sheet-template/cheat-sheet-template.component.stories.ts @@ -1,7 +1,7 @@ import { CommonModule } from '@angular/common'; import { RouterTestingModule } from '@angular/router/testing'; import { Meta, moduleMetadata, StoryObj } from '@storybook/angular'; -import { SheetCollapseToggleService } from 'app/services'; +import { DataService, SheetCollapseToggleService } from 'app/services'; import { FactorioIconIds } from '../factorio-icon/factorio-icon.model'; import { @@ -9,7 +9,6 @@ import { CHT_DEFAULT_ICON_ID, CHT_DEFAULT_TITLE, } from './cheat-sheet-template.component'; -import { CheatSheetTemplateModule } from './cheat-sheet-template.module'; type ComponentWithCustomControls = CheatSheetTemplateComponent & { content: string; @@ -21,9 +20,9 @@ const meta: Meta = { component: CheatSheetTemplateComponent, decorators: [ moduleMetadata({ - imports: [CommonModule, CheatSheetTemplateModule, RouterTestingModule], + imports: [CommonModule, RouterTestingModule], // declarations: [], - providers: [SheetCollapseToggleService], + providers: [SheetCollapseToggleService, DataService], }), ], argTypes: { @@ -35,6 +34,8 @@ const meta: Meta = { args: { iconId: CHT_DEFAULT_ICON_ID, title: CHT_DEFAULT_TITLE, + spaceAge: true, + animation: true, content: 'Cheat Sheet Contents', }, render(args) { @@ -43,6 +44,7 @@ const meta: Meta = { template: `${args.content}`, }; }, diff --git a/src/app/shared/cheat-sheet-template/cheat-sheet-template.component.ts b/src/app/shared/cheat-sheet-template/cheat-sheet-template.component.ts index df212be..a764ad6 100644 --- a/src/app/shared/cheat-sheet-template/cheat-sheet-template.component.ts +++ b/src/app/shared/cheat-sheet-template/cheat-sheet-template.component.ts @@ -1,4 +1,7 @@ +import { CommonModule } from '@angular/common'; import { Component, Input, OnDestroy } from '@angular/core'; +import { RouterModule } from '@angular/router'; +import { NgbCollapseModule } from '@ng-bootstrap/ng-bootstrap'; import { Collapse, DataService, @@ -6,7 +9,9 @@ import { } from 'app/services'; import { Subject, takeUntil } from 'rxjs'; +import { AdSenseModule } from '../ad-sense/ad-sense.module'; import { FactorioIcon } from '../factorio-icon/factorio-icon.model'; +import { FactorioIconModule } from '../factorio-icon/factorio-icon.module'; const CHT_BREAKPOINT_RESOLUTION = 767; // pixels export const CHT_DEFAULT_TITLE = 'Cheat Sheet'; @@ -15,30 +20,45 @@ export const CHT_DEFAULT_ICON_ID = 'Blueprint'; @Component({ selector: 'app-cheat-sheet-template', templateUrl: './cheat-sheet-template.component.html', + styles: [':host{display:contents}'], // Makes component host as if it was not there, can offer less css headaches. Use @HostBinding class approach for easier overrides. + standalone: true, + imports: [ + CommonModule, + FactorioIconModule, + AdSenseModule, + NgbCollapseModule, + RouterModule, + ], }) export class CheatSheetTemplateComponent implements OnDestroy { @Input() public set iconId(iconId: string) { this.factorioIcon = this.dataService.getFactorioIcon(iconId); } + private _title: string = CHT_DEFAULT_TITLE; @Input() public set title(title: string) { this._title = title; this.id = this.updateId(); } - public get title(): string { return this._title; } - public factorioIcon: FactorioIcon = + @Input() + public spaceAge: boolean = false; + + @Input() + public animation: boolean = true; + + protected factorioIcon: FactorioIcon = this.dataService.getFactorioIcon(CHT_DEFAULT_ICON_ID); - public id: string = this.updateId(); - public isCollapsed: boolean = this.defaultCollapsed(); + protected id: string = this.updateId(); + protected isCollapsed: boolean = this.defaultCollapsed(); - private clearSub$ = new Subject(); + private clearSub$: Subject = new Subject(); constructor( private dataService: DataService, @@ -47,40 +67,44 @@ export class CheatSheetTemplateComponent implements OnDestroy { sheetCollapseToggleService .getCollapseToggle() .pipe(takeUntil(this.clearSub$)) - .subscribe((collapseObj: Collapse) => { + .subscribe((collapseObj: Collapse): void => { if ((collapseObj.id && collapseObj.id === this.id) || !collapseObj.id) { collapseObj.doCollapse ? this.collapse() : this.expand(); } }); } - ngOnDestroy(): void { + public ngOnDestroy(): void { this.clearSub$.next(); this.clearSub$.complete(); } /** Collapsed By default on Mobile, expanded on Desktop */ - private defaultCollapsed() { + private defaultCollapsed(): boolean { return window.innerWidth < CHT_BREAKPOINT_RESOLUTION; } /** Toggle the isCollapsed Flag */ - public toggleCollapse() { + protected toggleCollapse(): void { this.isCollapsed = !this.isCollapsed; } /** Collapse the sheet by setting isCollapsed Flag true */ - public collapse() { + private collapse(): void { this.isCollapsed = true; } /** Expand the sheet by setting isCollapsed Flag false */ - public expand() { + private expand(): void { this.isCollapsed = false; } /** Convert string to lowercase dashed sting */ private updateId(): string { - return this.title.replace(/ /g, '-').toLocaleLowerCase(); + return getIdFromTitle(this.title); } } + +export function getIdFromTitle(title: string): string { + return title.replace(/ /g, '-').toLocaleLowerCase(); +} diff --git a/src/app/shared/cheat-sheet-template/cheat-sheet-template.module.spec.ts b/src/app/shared/cheat-sheet-template/cheat-sheet-template.module.spec.ts deleted file mode 100644 index aaf8c98..0000000 --- a/src/app/shared/cheat-sheet-template/cheat-sheet-template.module.spec.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { TestBed } from '@angular/core/testing'; - -import { CheatSheetTemplateModule } from './cheat-sheet-template.module'; - -describe('CheatSheetTemplateModule', () => { - beforeEach(() => { - TestBed.configureTestingModule({ - imports: [CheatSheetTemplateModule], - }); - }); - - it('initializes', () => { - const module: CheatSheetTemplateModule = TestBed.inject( - CheatSheetTemplateModule - ); - expect(module).toBeTruthy(); - }); -}); diff --git a/src/app/shared/cheat-sheet-template/cheat-sheet-template.module.ts b/src/app/shared/cheat-sheet-template/cheat-sheet-template.module.ts deleted file mode 100644 index c9a607d..0000000 --- a/src/app/shared/cheat-sheet-template/cheat-sheet-template.module.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { CommonModule } from '@angular/common'; -import { NgModule } from '@angular/core'; -import { RouterModule } from '@angular/router'; -import { NgbCollapseModule } from '@ng-bootstrap/ng-bootstrap'; -import { DataService } from 'app/services'; - -import { AdSenseModule } from '../ad-sense/ad-sense.module'; -import { FactorioIconModule } from '../factorio-icon/factorio-icon.module'; -import { CheatSheetTemplateComponent } from './cheat-sheet-template.component'; - -@NgModule({ - imports: [ - CommonModule, - FactorioIconModule, - AdSenseModule, - NgbCollapseModule, - RouterModule, - ], - declarations: [CheatSheetTemplateComponent], - exports: [CheatSheetTemplateComponent], - providers: [DataService], -}) -export class CheatSheetTemplateModule {} diff --git a/src/app/shared/cheat-sheet/cheat-sheet.component.ts b/src/app/shared/cheat-sheet/cheat-sheet.component.ts index 6c2d7cf..a16f5c0 100644 --- a/src/app/shared/cheat-sheet/cheat-sheet.component.ts +++ b/src/app/shared/cheat-sheet/cheat-sheet.component.ts @@ -8,6 +8,7 @@ import { CheatSheet } from 'app/shared/cheat-sheet/cheat-sheet.model'; // RXJX Observables import { Subscription } from 'rxjs'; +/** @deprecated Use CheatSheetTemplateComponent instead */ @Component({ selector: 'app-cheat-sheet', templateUrl: './cheat-sheet.component.html', diff --git a/src/app/shared/factorio-icon/factorio-icon.component.stories.ts b/src/app/shared/factorio-icon/factorio-icon.component.stories.ts index 69b7d0d..8cefeab 100644 --- a/src/app/shared/factorio-icon/factorio-icon.component.stories.ts +++ b/src/app/shared/factorio-icon/factorio-icon.component.stories.ts @@ -26,6 +26,7 @@ const meta: Meta = { name: 'name', text: '0', src: FactorioIconIds.Advanced_circuit, + spaceAge: true, icon: new Icon(''), }, render(args) {