package com.alterdekim.game.component.game;

import lombok.AllArgsConstructor;
import lombok.Getter;

@Getter
@AllArgsConstructor
public enum CommandType {
    UserCommand("$"),
    SetLocation("_LS"),
    RemoveUserFromLocation("_UL"),
    AddUserToLocation("_UE"),
    SetUserAvatarState("_S"),
    SetUserAvatarPosition("_P"),
    ChatMessage("_C"),
    Shoot("_NUS"),
    UseMagicAbility("_NUM"),
    OnFriendsAdded("_UFLA"),
    OnFriendshipRequestAdded("_UFLR"),
    OnFriendsRemoved("_UFLD"),
    AddNewPhoneMessage("_MP"),
    CardMessage("_MC"),
    UpdateTickets("_NNT"),
    Unknown("");

    private final String value;
    public static CommandType fromString(String s) {
        for( CommandType t : values() ) {
            if( t.getValue().equals(s) ) return t;
        }
        return CommandType.Unknown;
    }
}
