//——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
//  THIS FILE IS GENERATED BY EASY BINDINGS, DO NOT MODIFY IT
//——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————

import Cocoa

//——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————

protocol BoardModelVia_y : AnyObject {
  var y : Int { get }
}

//——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————

protocol BoardModelVia_padDiameter : AnyObject {
  var padDiameter : Int { get }
}

//——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————

protocol BoardModelVia_x : AnyObject {
  var x : Int { get }
}

//——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
//    Entity: BoardModelVia
//——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————

final class BoardModelVia : EBManagedObject,
         BoardModelVia_y,
         BoardModelVia_padDiameter,
         BoardModelVia_x {

  //····················································································································
  //   Atomic property: y
  //····················································································································

  final let y_property : EBStoredProperty_Int

  //····················································································································

  final func reset_y_toDefaultValue () {
    self.y = 0
  }

  //····················································································································

  final var y : Int {
    get { return self.y_property.propval }
    set { self.y_property.setProp (newValue) }
  }

  //····················································································································
  //   Atomic property: padDiameter
  //····················································································································

  final let padDiameter_property : EBStoredProperty_Int

  //····················································································································

  final func reset_padDiameter_toDefaultValue () {
    self.padDiameter = 0
  }

  //····················································································································

  final var padDiameter : Int {
    get { return self.padDiameter_property.propval }
    set { self.padDiameter_property.setProp (newValue) }
  }

  //····················································································································
  //   Atomic property: x
  //····················································································································

  final let x_property : EBStoredProperty_Int

  //····················································································································

  final func reset_x_toDefaultValue () {
    self.x = 0
  }

  //····················································································································

  final var x : Int {
    get { return self.x_property.propval }
    set { self.x_property.setProp (newValue) }
  }

  //····················································································································
  //    init
  //····················································································································

  required init (_ ebUndoManager : EBUndoManager?) {
    self.y_property = EBStoredProperty_Int (defaultValue: 0, undoManager: ebUndoManager)
    self.padDiameter_property = EBStoredProperty_Int (defaultValue: 0, undoManager: ebUndoManager)
    self.x_property = EBStoredProperty_Int (defaultValue: 0, undoManager: ebUndoManager)
    super.init (ebUndoManager)
  //--- Install undoers and opposite setter for relationships
  //--- Register properties for handling signature
  //--- Extern delegates
  }

  //····················································································································

  override func removeAllObservers () {
    super.removeAllObservers ()
  //--- Unregister properties for handling signature
  }

  //····················································································································
  //    Extern delegates
  //····················································································································


  //····················································································································
  //    populateExplorerWindow
  //····················································································································

  #if BUILD_OBJECT_EXPLORER
    override func populateExplorerWindow (_ y : inout CGFloat, view : NSView) {
      super.populateExplorerWindow (&y, view:view)
      createEntryForPropertyNamed (
        "y",
        object: self.y_property,
        y: &y,
        view: view,
        observerExplorer: &self.y_property.mObserverExplorer,
        valueExplorer: &self.y_property.mValueExplorer
      )
      createEntryForPropertyNamed (
        "padDiameter",
        object: self.padDiameter_property,
        y: &y,
        view: view,
        observerExplorer: &self.padDiameter_property.mObserverExplorer,
        valueExplorer: &self.padDiameter_property.mValueExplorer
      )
      createEntryForPropertyNamed (
        "x",
        object: self.x_property,
        y: &y,
        view: view,
        observerExplorer: &self.x_property.mObserverExplorer,
        valueExplorer: &self.x_property.mValueExplorer
      )
      createEntryForTitle ("Properties", y: &y, view: view)
      createEntryForTitle ("Transients", y: &y, view: view)
      createEntryForTitle ("ToMany Relationships", y: &y, view: view)
      createEntryForTitle ("ToOne Relationships", y: &y, view: view)
    }
  #endif

  //····················································································································
  //    clearObjectExplorer
  //····················································································································

  #if BUILD_OBJECT_EXPLORER
    override func clearObjectExplorer () {
  //--- Atomic property: y
    self.y_property.mObserverExplorer = nil
    self.y_property.mValueExplorer = nil
  //--- Atomic property: padDiameter
    self.padDiameter_property.mObserverExplorer = nil
    self.padDiameter_property.mValueExplorer = nil
  //--- Atomic property: x
    self.x_property.mObserverExplorer = nil
    self.x_property.mValueExplorer = nil
    //---
      super.clearObjectExplorer ()
    }
  #endif

  //····················································································································
  //    cleanUpToManyRelationships
  //····················································································································

  override func cleanUpToManyRelationships () {
  //---
    super.cleanUpToManyRelationships ()
  }

  //····················································································································
  //    cleanUpToOneRelationships
  //····················································································································

  override func cleanUpToOneRelationships () {
  //---
    super.cleanUpToOneRelationships ()
  }

  //····················································································································
  //    saveIntoDictionary
  //····················································································································

  override func saveIntoDictionary (_ ioDictionary : NSMutableDictionary) {
    super.saveIntoDictionary (ioDictionary)
    //--- Atomic property: y
      self.y_property.storeIn (dictionary: ioDictionary, forKey: "y")
    //--- Atomic property: padDiameter
      self.padDiameter_property.storeIn (dictionary: ioDictionary, forKey: "padDiameter")
    //--- Atomic property: x
      self.x_property.storeIn (dictionary: ioDictionary, forKey: "x")
  }

  //····················································································································
  //    setUpWithDictionary
  //····················································································································

  override func setUpWithDictionary (_ inDictionary : NSDictionary,
                                     managedObjectArray : inout [EBManagedObject]) {
    super.setUpWithDictionary (inDictionary, managedObjectArray: &managedObjectArray)
  }

  //····················································································································
  //    setUpAtomicPropertiesWithDictionary
  //····················································································································

  override func setUpAtomicPropertiesWithDictionary (_ inDictionary : NSDictionary) {
    super.setUpAtomicPropertiesWithDictionary (inDictionary)
  //--- Atomic property: y
    self.y_property.readFrom (dictionary: inDictionary, forKey: "y")
  //--- Atomic property: padDiameter
    self.padDiameter_property.readFrom (dictionary: inDictionary, forKey: "padDiameter")
  //--- Atomic property: x
    self.x_property.readFrom (dictionary: inDictionary, forKey: "x")
  }


  //····················································································································
  //   appendPropertyNamesTo
  //····················································································································

  override func appendPropertyNamesTo (_ ioString : inout String) {
    super.appendPropertyNamesTo (&ioString)
  //--- Atomic properties
    ioString += "y\n"
    ioString += "padDiameter\n"
    ioString += "x\n"
  //--- To one relationships
  //--- To many relationships
  }

  //····················································································································
  //   appendPropertyValuesTo
  //····················································································································

  override func appendPropertyValuesTo (_ ioData : inout Data) {
    super.appendPropertyValuesTo (&ioData)
  //--- Atomic properties
    self.y.appendPropertyValueTo (&ioData)
    ioData.append (ascii: .lineFeed)
    self.padDiameter.appendPropertyValueTo (&ioData)
    ioData.append (ascii: .lineFeed)
    self.x.appendPropertyValueTo (&ioData)
    ioData.append (ascii: .lineFeed)
  //--- To one relationships
  //--- To many relationships
  }

  //····················································································································
  //    setUpWithTextDictionary
  //····················································································································

  override func setUpWithTextDictionary (_ inDictionary : [String : NSRange],
                                         _ inObjectArray : [EBManagedObject],
                                         _ inData : Data,
                                         _ inParallelObjectSetupContext : ParallelObjectSetupContext) {
    super.setUpWithTextDictionary (inDictionary, inObjectArray, inData, inParallelObjectSetupContext)
    inParallelObjectSetupContext.addOperation {
    //--- Atomic properties
      if let range = inDictionary ["y"], let value = Int.unarchiveFromDataRange (inData, range) {
        self.y = value
      }
      if let range = inDictionary ["padDiameter"], let value = Int.unarchiveFromDataRange (inData, range) {
        self.padDiameter = value
      }
      if let range = inDictionary ["x"], let value = Int.unarchiveFromDataRange (inData, range) {
        self.x = value
      }
    //--- To one relationships
    //--- To many relationships
    }
  //--- End of addOperation
  }

  //····················································································································
  //   accessibleObjects
  //····················································································································

  override func accessibleObjects (objects : inout [EBManagedObject]) {
    super.accessibleObjects (objects: &objects)
  }

  //····················································································································
  //   accessibleObjectsForSaveOperation
  //····················································································································

  override func accessibleObjectsForSaveOperation (objects : inout [EBManagedObject]) {
    super.accessibleObjectsForSaveOperation (objects: &objects)
  }

  //····················································································································

}

//——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————

