// src/views/flow/nodes/StartNode.js
import { CircleNode, CircleNodeModel } from '@logicflow/core'

export class StartNode extends CircleNode {}

export class StartNodeModel extends CircleNodeModel {
  constructor(data, graphModel) {
    super(data, graphModel)
    this.r = 30
    this.fill = '#55ff7f'
    this.stroke = '#55ff7f'
    this.text.value = '开始'
  }

  getConnectedSourceRules() {
    const rules = super.getConnectedSourceRules()
    rules.push({
      message: '开始节点不能作为连线的起点',
      validate: () => false
    })
    return rules
  }
}