import { FeatureSystem } from '../../core/feature-system';

export class ChatSystem extends FeatureSystem {
    static Error(player: PlayerMp, message: string): void {
        player.call('chat:message', [`{FF0000}${message}`]);
    }

    static Info(player: PlayerMp, message: string): void {
        player.call('chat:message', [`{FFFFFF}${message}`]);
    }

    static Success(player: PlayerMp, message: string): void {
        player.call('chat:message', [`{00FF00}${message}`]);
    }

    static Warn(player: PlayerMp, message: string): void {
        player.call('chat:message', [`{FFFF00}${message}`]);
    }

    static AdminWarn(message: string, _permission?: string, _category?: string): void {
        mp.players.broadcast(`{FF6600}[ADMIN] ${message}`);
    }

    static Send(player: PlayerMp, message: string): void {
        player.call('chat:message', [message]);
    }

    static Notice(player: PlayerMp, message: string): void {
        player.call('chat:message', [`{AAAAAA}${message}`]);
    }

    static Message(player: PlayerMp, content: string, _tag?: string, _type?: string, _highlight?: boolean, _emoji?: boolean): void {
        player.call('chat:message', [content]);
    }

    static ImportantOOCNotice(player: PlayerMp, notice: string): void {
        player.call('chat:message', [`{FFFF00}[OOC] ${notice}`]);
    }
}

export const chatSystem = new ChatSystem();
