1
0
mirror of https://github.com/exane/not-gwent-online synced 2024-11-23 19:36:53 +00:00
not-gwent-online/server/CardManager.js

33 lines
601 B
JavaScript
Raw Normal View History

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;