+Added SignalElements class parsing and storing extended information about signals +Added support for standard and dwarf EHA/ERI signals extended parsing (excluding eha_top_l, eha_top_r, eha_ps_k and eri_ps_k prefabs) (signs are not being parsed yet) +Added SignalElementsEnums const that will help to translate different signal types into one unified structure
25 lines
720 B
JavaScript
25 lines
720 B
JavaScript
import SignalElementsEnums from "../enums";
|
|
import SignalElements from "../signal-elements";
|
|
import SignalElementsParserCommon from "./common";
|
|
|
|
export default class SignalElementsParserEhaEriDwarf {
|
|
static parsers = [];
|
|
|
|
static isAppliable(prefabName) {
|
|
const regex = /^(eha|eri)_(sp|tm|to)_k$/;
|
|
return regex.test(prefabName);
|
|
}
|
|
|
|
static fromPrefabText(id, text) {
|
|
const entries = text.split(",");
|
|
|
|
return new SignalElements(
|
|
SignalElementsEnums.Type.DWARF,
|
|
SignalElementsEnums.HeadPosition.STANDARD,
|
|
SignalElementsParserCommon.getUnits(entries, 2, 3, 2),
|
|
SignalElementsEnums.BarType.NONE,
|
|
[]
|
|
);
|
|
}
|
|
}
|