2015-06-30 10:11:50 +00:00
|
|
|
var Card = require("./Card");
|
|
|
|
|
|
|
|
var CardManager = (function(){
|
|
|
|
var CardManager = function(){
|
|
|
|
if(!(this instanceof CardManager)){
|
|
|
|
return (new CardManager());
|
|
|
|
}
|
|
|
|
/**
|
|
|
|
* constructor here
|
|
|
|
*/
|
|
|
|
|
|
|
|
this._id = 0;
|
2015-06-30 10:34:57 +00:00
|
|
|
this._cards = {};
|
2015-06-30 10:11:50 +00:00
|
|
|
};
|
|
|
|
var r = CardManager.prototype;
|
|
|
|
/**
|
|
|
|
* methods && properties here
|
|
|
|
* r.property = null;
|
|
|
|
* r.getProperty = function() {...}
|
|
|
|
*/
|
|
|
|
|
|
|
|
r._id = null;
|
2015-06-30 10:34:57 +00:00
|
|
|
r._cards = null;
|
2015-06-30 10:11:50 +00:00
|
|
|
|
|
|
|
r.create = function(key, owner) {
|
|
|
|
return this._cards[this._id] = Card(key, owner, this._id++);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return CardManager;
|
|
|
|
})();
|
|
|
|
|
|
|
|
module.exports = CardManager;
|