interaction map type
This commit is contained in:
@@ -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(() => {
|
||||
|
||||
Reference in New Issue
Block a user