interaction map type

This commit is contained in:
2026-03-15 13:10:13 +01:00
parent 621659a352
commit 57b753a6b5
7 changed files with 2854 additions and 9 deletions

View File

@@ -14,6 +14,7 @@ import { TranslateableComponent } from '../../components/translateable.component
import { Food } from '../../types/food';
import { interval } from 'rxjs';
import { ChibiState, STATES } from '../../types/chibi/chibi-state';
import { RandomService } from '../../logic/random.service';
enum EInteractionMenuState {
Neutral,
@@ -32,6 +33,7 @@ export class InteractionsComponent extends TranslateableComponent {
public readonly chibiId: InputSignal<ChibiId> = input.required<ChibiId>();
private readonly chibiStore: ChibiStore = inject(ChibiStore);
private readonly randomService: RandomService = inject(RandomService);
protected readonly chibi: Signal<Chibi> = computed(() => {
return this.chibiStore.chibis().find((chibi: Chibi) => chibi.id === this.chibiId()) as Chibi;
@@ -49,7 +51,7 @@ export class InteractionsComponent extends TranslateableComponent {
effect(() => {
if (this.chibi()) {
this.brain = BRAIN_MAP[this.chibi().name]!;
this.brain.init(this.chibi());
this.brain.init(this.chibi(), this.randomService);
}
})
interval(THINKING_INTERVAL).subscribe(() => {