Registers HuntingModule (POST /api/hunts) into the DI graph alongside its new entities, and adds possibleMonsters (enabled LocationMonster pool, weight-descending, empty when hunting is disabled) to WorldService.getCurrentLocation. Also updates the pre-existing DB-less app.e2e-spec.ts to override HuntingModule the same way the other feature modules already are, since it now needs a real DataSource.
25 lines
828 B
TypeScript
25 lines
828 B
TypeScript
import { Module } from '@nestjs/common';
|
|
import { TypeOrmModule } from '@nestjs/typeorm';
|
|
import { Character } from '../characters/entities/character.entity';
|
|
import { LocationMonster } from '../monsters/entities/location-monster.entity';
|
|
import { MonsterDefinition } from '../monsters/entities/monster-definition.entity';
|
|
import { TravelModule } from '../travel/travel.module';
|
|
import { LocationConnection } from './entities/location-connection.entity';
|
|
import { WorldController } from './world.controller';
|
|
import { WorldService } from './world.service';
|
|
|
|
@Module({
|
|
imports: [
|
|
TypeOrmModule.forFeature([
|
|
Character,
|
|
LocationConnection,
|
|
LocationMonster,
|
|
MonsterDefinition,
|
|
]),
|
|
TravelModule,
|
|
],
|
|
controllers: [WorldController],
|
|
providers: [WorldService],
|
|
})
|
|
export class WorldModule {}
|