import List from "../../../../../src/core/collection/list/List.js";
import {
    SimulationStepDefinition
} from "../../../../../src/engine/graphics/particles/particular/engine/simulator/SimulationStepDefinition.js";
import { ObjectEditor } from "../primitive/ObjectEditor.js";
import { ImagePathEditor } from "../ImagePathEditor.js";
import { EnumEditor } from "../common/EnumEditor.js";
import {
    EmissionShapeType
} from "../../../../../src/engine/graphics/particles/particular/engine/emitter/EmissionShapeType.js";
import {
    EmissionFromType
} from "../../../../../src/engine/graphics/particles/particular/engine/emitter/EmissionFromType.js";
import { BinaryDataType } from "../../../../../src/core/binary/type/BinaryDataType.js";
import { ParameterTrackSetEditor } from "./ParameterTrackSetEditor.js";

export class ParticleEmitterLayerEditor extends ObjectEditor {
    get schema() {
        return {
            properties: {
                imageURL: {
                    type: String,
                    editor: new ImagePathEditor()
                },
                emissionShape: {
                    editor: new EnumEditor(EmissionShapeType)
                },
                emissionFrom: {
                    editor: new EnumEditor(EmissionFromType)
                },
                emissionRate: {
                    type: Number,
                    numeric_type: BinaryDataType.Uint32
                },
                emissionImmediate: {
                    type: Number,
                    numeric_type: BinaryDataType.Uint32
                },
                parameterTracks: {
                    editor: new ParameterTrackSetEditor()
                },
                scaledSpriteHalfSize: {
                    transient: true
                },
                baseBoundingBox: {
                    transient: true
                },
                steps: {
                    type: List,
                    type_parameters: [SimulationStepDefinition]
                },
                timeSinceLastEmission: {
                    transient: true
                }
            }
        };
    }
}
