Commit 1b43699a authored by Neil Fraser's avatar Neil Fraser

Use prototypes for Connection properties.

parent 58db7735
...@@ -39,18 +39,47 @@ goog.require('goog.dom'); ...@@ -39,18 +39,47 @@ goog.require('goog.dom');
Blockly.Connection = function(source, type) { Blockly.Connection = function(source, type) {
/** @type {!Blockly.Block} */ /** @type {!Blockly.Block} */
this.sourceBlock_ = source; this.sourceBlock_ = source;
/** @type {Blockly.Connection} */
this.targetConnection = null;
/** @type {number} */ /** @type {number} */
this.type = type; this.type = type;
this.x_ = 0;
this.y_ = 0;
// Shortcut for the databases for this connection's workspace. // Shortcut for the databases for this connection's workspace.
this.dbList_ = source.workspace.connectionDBList; this.dbList_ = source.workspace.connectionDBList;
this.hidden_ = !this.dbList_; this.hidden_ = !this.dbList_;
this.inDB_ = false;
}; };
/**
* Connection this connection connects to. Null if not connected.
* @type {Blockly.Connection}
*/
Blockly.Connection.prototype.targetConnection = null;
/**
* List of compatible value types. Null if all types are compatible.
* @private
* @type {Array}
*/
Blockly.Connection.prototype.check_ = null;
/**
* Horizontal location of this connection.
* @private
* @type {number}
*/
Blockly.Connection.prototype.x_ = 0;
/**
* Vertical location of this connection.
* @private
* @type {number}
*/
Blockly.Connection.prototype.y_ = 0;
/**
* Has this connection been added to the connection database?
* @private
* @type {boolean}
*/
Blockly.Connection.prototype.inDB_ = false;
/** /**
* Sever all links to this connection (not including from the source object). * Sever all links to this connection (not including from the source object).
*/ */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment