package com.alterdekim.game.message.amf;

import lombok.extern.slf4j.Slf4j;

@Slf4j
public enum AMFValueType {
    NUMBER,
    BOOLEAN,
    STRING,
    OBJECT,
    NULL,
    MIXED_ARRAY,
    DATE;


    public static AMFValueType toValueType(byte b) {
        return switch (b) {
            case 0x00 -> NUMBER;
            case 0x01 -> BOOLEAN;
            case 0x02 -> STRING;
            case 0x03 -> OBJECT;
            case 0x08 -> MIXED_ARRAY;
            case 0x0b -> DATE;
            default -> NULL;
        };
    }
}
