import { Injectable } from '@angular/core';
import { BehaviorSubject, Observable, of } from 'rxjs';

export interface Character {
  id: string;
  name: string;
  gender: string;
  appearance: string;
  personality: string;
  avatar: string;
}

@Injectable({
  providedIn: 'root'
})
export class CharacterService {
  private characters = new BehaviorSubject<Character[]>([]);
  characters$ = this.characters.asObservable();

  generateCharacterAvatar(description: string): Observable<string> {
    // TODO: 实现AI生成头像的逻辑
    return of('assets/default-avatar.png');
  }

  createCharacterAgent(character: Character): Observable<Character> {
    const currentCharacters = this.characters.value;
    this.characters.next([...currentCharacters, character]);
    return of(character);
  }
} 